0% found this document useful (0 votes)
0 views

L03 - Sets

The document outlines the content of a lecture on Discrete Structures at the University of Dar es Salaam, covering topics such as sets, relations, functions, and basic logic. It includes definitions and notations related to sets, operations on sets, and examples illustrating these concepts. Additionally, it provides assignment details for students, referencing a specific textbook and exercises.

Uploaded by

japharyjaphet46
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

L03 - Sets

The document outlines the content of a lecture on Discrete Structures at the University of Dar es Salaam, covering topics such as sets, relations, functions, and basic logic. It includes definitions and notations related to sets, operations on sets, and examples illustrating these concepts. Additionally, it provides assignment details for students, referencing a specific textbook and exercises.

Uploaded by

japharyjaphet46
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

UNIVERSITY OF DAR ES SALAAM

COLLEGE OF ICT

IS 143
Discrete Structure

Lecture 3
Instructor
Dr. Joseph Cosmas

Kijitonyama Campus
Block A,
Room No. A023

[email protected]
Content
 Introduction to Course

 Proposition, Sets, Relations and Functions

 Algorithm and Basic Logics

 Proof Techniques

 Basics Of Counting (Mathematical Reasoning)

 Graphs And Trees

 Discrete Probability
Sets
 A set is a collection or group of objects or elements or
members.

o A set is said to contain its elements.

o There must be an underlying universal set U, either


specifically stated or understood.
Sets (cont.)
 Notation:

o List the elements between braces:


S = {a, b, c, d}={b, c, a, d, d}
 Note: listing an object more than once does not change the set.
 Ordering means nothing.

o Specification by predicates:
S= {x | P(x)},
 S contains all the elements from U which make the predicate P
true.

o Brace notation with ellipses:


S = { . . . , -3, -2, -1},
the negative integers.
Sets (cont.)
 Common Universal Sets
o R = reals
o N = natural numbers = {0,1, 2, 3, . . . }, the counting numbers
o Z = all integers = {. . , -3, -2, -1, 0, 1, 2, 3, 4, . .}
o Z+ is the set of positive integers

 Notation:
x is a member of S or x is an element of S:
x  S.

x is not an element of S:
x  S.
Sets (cont.)
 Subsets
o Definition: The set A is a subset of the set B, denoted
A  B, iff
x [x  A  x  B]

o Definition: The void set, the null set, the empty set, denoted
, is the set with no members.
Note: the assertion x   is always false.
Hence
x [x    x  B]
is always true.

o Therefore,  is a subset of every set.

Note: a set, say B, is always a subset of itself.


Sets (cont.)
o Definition:
If A  B but A  B then we say A is a proper subset
of B, denoted A  B.

o Definition:
The set of all subset of a set A, denoted P(A), is
called the power set of A.

o Example:
If A = {a, b} then
P(A) = {, {a}, {b}, {a,b}}
Sets (cont.)
o Definition:
The number of (distinct) elements in A, denoted |A|,
is called the cardinality of A.
If the cardinality is a natural number (in N), then the set is
called finite, else infinite.

o Example:
A = {a, b},
| A | = |{a, b}| = 2,
| P(A) | = |P({a, b})| = 4.

 If A is finite then P(A) is also finite.


n
 Useful Fact: |A| = n implies |P(A)| = 2
Sets (cont.)
 Definition: The Cartesian product of A with B, denoted A x B, is
the set of ordered pairs {<a, b> | a  A  b  B}

 Ai   a1 , a2 ,..., an  ai  Ai 
n
Notation: i 1

Note: The Cartesian product of anything with  is . (why?)


o Example:
A = {a,b}, B = {1, 2, 3}

AxB = {<a, 1>, <a, 2>, <a, 3>, <b, 1>, <b, 2>, <b, 3>}

o What is BxA? AxBxA?

o If |A| = m and |B| = n, what is |AxB|?


Set Operations (cont.)
 Propositional calculus and set theory are both instances
of an algebraic system called a

Boolean Algebra.

o The operators in set theory are defined in terms of the


corresponding operator in propositional calculus

o As always there must be a universe U. All sets are assumed


to be subsets of U
Set Operations (cont.)
 Definition:

Two sets A and B are equal, denoted A = B, iff


x [x  A  x  B].

o Note: From a previous logical equivalence we have

A = B iff x [(x  A  x  B)  (x  B  x  A)]

or

A = B iff A  B and B  A
Set Operations (cont.)
 Definitions:
o The union of A and B, denoted A U B, is the set {x | x  A  x  B}
o The intersection of A and B, denoted A  B, is the set
{x | x  A  x  B}
Note: If the intersection is void, A and B are said to be disjoint.
o The complement of A, denoted , is the set {x | (x  A)}
A and {x|x  A}.
Note: Alternative notation is Ac,

o The difference of A and B, or the complement of B relative to A,


denoted A - B, is the set A  B
Note: The (absolute) complement of A is U - A.

 The symmetric difference of A and B, denoted A  B, is the set


(A - B) U (B - A)
Set Operations (cont.)
o Examples:
U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
A= {1, 2, 3, 4, 5},
B = {4, 5, 6, 7, 8}.
Then

 AB =
 AB=
 A=
 B=
 A-B=
 B -A =
 AB=
Set Operations (cont.)
 Venn Diagrams
o A useful geometric visualization tool (for 3 or less sets)
o The Universe U is the rectangular box
o Each set is represented by a circle and its interior

o All possible combinations of the sets must be represented

U U
A B
A B
C

For 2 sets For 3 sets

o Shade the appropriate region to represent the given set operation.


Set Operations (cont.)
 Set Identities

o Set identities correspond to the logical equivalences.

o Example:
The complement of the union is the intersection of the
complements:
A B = A  B

Proof: To show:

x [x  A  B  x  A  B ]

To show two sets are equal we show for all x that x is a


member of one set if and only if it is a member of the other.
Set Operations (cont.)
o We now apply an important rule of inference (defined later)
called

Universal Instantiation
In a proof we can eliminate the universal quantifier which binds
a variable if we do not assume anything about the variable
other than it is an arbitrary member of the Universe. We can
then treat the resulting predicate as a proposition.
Set Operations (cont.)
o We say
'Let x be arbitrary.'
Then we can treat the predicates as propositions:
Set Operations (cont.)
o Hence
x A B  x  A  B

is a tautology.

Since

• x was arbitrary
• we have used only logically equivalent assertions
and definitions
Set Operations (cont.)
o we can apply another rule of inference called
Universal Generalization
We can apply a universal quantifier to bind a variable if we
have shown the predicate to be true for all values of the
variable in the Universe.

and claim the assertion is true for all x, i.e.,

x [x  A B  x  A  B ]
Set Operations (cont.)
o Note: As an alternative which might be easier in some cases, use the
identity
A = B  [A  B and B  A]

o Example:
Show A  (B - A) = 

The void set is a subset of every set. Hence,


A  (B - A)  
Therefore, it suffices to show

A  (B - A)   or x [xA  (B - A)  x  ]

So as before we say 'let x be arbitrary’.


Set Operations (cont.)
o Example (cont.)
Show xA  (B - A)  x   is a tautology.
But the consequent is always false.
Therefore, the antecedent better always be false also.
Apply the definitions:
Set Operations (cont.)
 Union and Intersection of Indexed Collections

o Let A1,A2 ,..., An be an indexed collection of sets.


o Union and intersection are associative (because 'and' and
'or' are) we have:
n
 Ai  A1  A2  ...  An
i 1
and
n
 Ai  A1  A2  ...  An
i 1
Set Operations (cont.)
o Examples

Let

Ai  [ i ,  ),1  i  
n
 Ai  [ 1 ,  )
i 1
n
 Ai  [ n ,  )
i 1
Examples
o Assignment details:
 Book Title: Discrete Mathematical Structure (shared earlier)

 Book Author: Shanker G. Rao

 Page: 67

 Exercise 2.2

 Question no. 2, 4, 7, 8, 25, 26

You might also like