L03 - Sets
L03 - Sets
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
Proof Techniques
Discrete Probability
Sets
A set is a collection or group of objects or elements or
members.
o Specification by predicates:
S= {x | P(x)},
S contains all the elements from U which make the predicate P
true.
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 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.
Ai a1 , a2 ,..., an ai Ai
n
Notation: i 1
AxB = {<a, 1>, <a, 2>, <a, 3>, <b, 1>, <b, 2>, <b, 3>}
Boolean Algebra.
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,
AB =
AB=
A=
B=
A-B=
B -A =
AB=
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
U U
A B
A B
C
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 ]
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.
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) =
A (B - A) or x [xA (B - A) x ]
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)
Page: 67
Exercise 2.2