Professional Documents
Culture Documents
A B
C
SETS
MEMBERSHIP
Defining Sets CONTAINMENT/SUBSET
VENN DIAGRAMS
UNION COMPLEMENT
INTERSECTION
difference
POWER SETS
Sets
A set is a collection of objects, called elements
of the set.
{BIT1113 , BIT1073,…………}
{ 1 , 3 , 5, ……….., 21 }
The ordering of the elements is not important and
repetition of elements is ignored, for example
In general:
A = {xU | P(x)}, where U is the universe of discourse in
which the predicate P(x) must be interpreted,
or
A = {x | P(x)} if the universe of discourse for P(x) is
implicitly understood.
for instance,
A = {x Z | 1 x 5} = “set of integers x
such that 1 x 5” which is
A = {1, 2, 3, 4, 5}.
Example 2:
Set B = {1,3,5,……..,21}
= { x | 1 ≤ x ≤ 21 and x is odd }
Principle of Extension
“x is an element of A” or “x
element of xA
in A”
“A is a subset of B” ,
Or subset A B all elements of A are in B,
union A B “ A union B”
intersection A B “A intersect B”
` complement A` or Ac “A complement”
Membership ,
x A ; x is an element of A or x is in A
Examples:
Given a set as { 7, “Ahmad”, /2 , T }
7
2/3
improper subset Subset / Containment
AB
A is a subset of B
A is contained in B
Example:
Let A ={1,2,3,4,5}, B={1,2,3,4,5,6,7} and
C={1,2,3,4,5}
Thus,
A B , C B, and A C
A B (wrong)
exercise
1. Suppose that A={2,4,6}, B={2,6} and C={4,6}.
Determine which of these sets are subset of
which other of these sets.
B A
CA
union: A B = {x (x A) (x B) }
intersection: A B = {x (x A) (x B) }
difference: A-B = {x (x A) (x B) }
complement: Á = {x U x A} = U-A
where U be a universal set and A,B be two
subsets of U . The set of elements (in the
universal set) that do not belong to a given set.
Symmetric Difference: AB
Given two sets, their symmetric difference
is the set of elements that belong to either
one of the set but not both.
AB = {x | (x A) (x B)} .
It can be expressed also in the following way:
AB = A B − A B = (A − B) (B − A) .
Example 1:
Find AB if A = {1, 3, 5} and B = {1, 2, 3}.
Example 2:
Find SJ if S = {c, d, f, g} and J = {d, b, a, c}.
Example 1:
Find AB if A = {1, 3, 5} and B = {1, 2, 3}.
AB= { 5, 2}
A-B = {5}
B-A={2}
Example 2:
Find SJ if S = {c, d, f, g} and J = {d, b, a, c}.
SJ = {f, g, b, a}
J-S = {b,a}
S – J={f, g}
Venn diagrams
Figure 4 A B is shaded.
Intersection
The intersection of two sets A and B, denoted by
A B, is the set of elements common to both
A and B, i.e.
A B = {x : x A and x B} U
A B
Figure 5 A B is shaded.
then A B = { c, d, e }
BC ={e}
C A = { a, e }
Complement Á
The complement of a set A, denoted by Á (or A c ) , is
the set of elements which do not belong to A. It is the
same as the difference of the universal set U and A.
Á = {x: x U, x A}
Figure 7: Á is shaded.
Example
Let U = R. Consider the sets A = {xR|x < −1
or x > 1} and
B = {xR|x 0}. Find A c ?
Solution:
Ac = [−1, 1].
Difference
The difference of set A and B, denoted by A – B (A\B) is the
set of elements which belong to A but not to B, i.e.
A - B = {x : x A , x B}.
A - B is also called the
complement of B with respect
to A.
Figure 6 : (A – B) is shaded.
Example
Let S = { a, b, c, d } and
T = { c, d, e, f },
then S - T = { a, b }
T - S = { e, f }
Á
n(A- B) = n(A) – n(AB)
n(AUB) = n(A) +n(B) – n(AB)
n(AB) = n(A) + n(B) – n(AB)
1)
Example
In a class of 50 college students, 30 study Pascal, 25
study C and 10 study both computer languages. How
many students do not study computer language ?
U=50
Pascal C
20 10 15
Absorption laws A ( A B) A A ( A B) A
De Morgan’s laws A B A B A B A B
Algebra of sets
The following identities can be verified by
drawing Venn diagrams.
Example
Use Venn diagrams to represent the following set expressions.
(a)
( A B)(B C)
A B
A B
C C
( A B) (BC)
A B
C ( A B)(B C)
(b) A ( B C ) ( A B C )
(B C ) ( A B C )
A B
A ( B C ) ( A B C )
Exercise:
Example:
Let A={x,y}, B={1,2,3}, and C={a,b}.
Find
a. A x B x C
b. (A x B ) x C
answers
a. A × B × C =
{(x, 1, a), (x, 2, a), (x, 3, a), (y, 1, a), (y, 2, a), (y, 3, a), (x, 1
, b), (x, 2, b), (x, 3, b), (y, 1, b), (y, 2, b), (y, 3, b)}
b. (A × B) × C =
{((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a), ((y, 2), a), ((y,
3), a), ((x, 1), b), ((x, 2), b), ((x, 3), b), ((y, 1), b), ((y, 2),
b), ((y, 3), b)}
Power Set & Cardinality
The power set of a set A, written P(A), is the set
whose elements are all the subsets of A. For example
A = {1, 2} has a total of 4 subsets: {1}, {2}, , and A
itself. So for this example P(A) = {, {1}, {2}, A}.
Solution:
A = n(A) = 3