Discrete Structures 4
Discrete Structures 4
Union:Let A and B be sets.The union of the sets A and B ,denoted by A∪B,is the set that
contains those elements that are either in A or in B ,or in both
A∪B={x|xЄA v xЄB }
Intersection: Let A and B be sets.The intersection of the sets A and B, denoted by A∩B,is the
set containing those elements in both A and B
A∩B={x|xЄA ∧ xЄB }
Difference of two sets:Let A and B be two sets the difference of A and B denoted by A-
B is the set containing those elements that are in A but not in B.The difference of A and B is also
called the complement of B with respect to A.
A−¿B={x|xЄA ∧ x∉B }
A ⨁ B={x / x ∈ A ⨁ x ∈ B }
Example:If A={1,2,3}, B={1,3,5} then
A⨁B={2,5}
Note: A ⨁ B=(A-B)U(B-A)
Complement of a set:let U be the universal set .The complement of the set A denoted by
Á is the complement of A with respect to U .In other words ,the complement of the set A is U-A
Á = ={x|x∉A}
Example:let A={a,e,i,o,u} (where the universal set is the set of letters of the English
alphabet).Then Á ={b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z}
Set identities:
Set Identities
identity name
AU∅=A Identity laws
A∩U=A
AUU=U Domination laws
A∩ ∅=∅
AUA=A Idempotent laws
A∩ A= A
´ =A
( Á) Double
complementation Law
AUB=BUA Commutative Laws
A∩B=B∩ A
AU(BUC)=(AUB)UC Associative Laws
A∩(B∩C)=(A∩B)∩C
A∩(BUC)=(A∩B)U(A∩C) Distributive Laws
AU(B∩C)=(AUB)∩(AUC)
´ = Á ∩ B́
AUB De Morgan`s Law
A∩´ B= Á U B́
´ B.
Solution: First,suppose that x∈ A ∩
⟹x ∉ A ∩ B
⟹x ∉ A or x ∉ B
⟹x ∈ Á or x ∈ B́
⟹x ∈ Á U B́
´ B⊆ Á U B́
This implies that A ∩ …….(a)
⟹y ∈ Á or y ∈ B́ ,
⟹ y ∉ A∨ y ∉ B
⟹y ∉ A ∩ B
⟹ y∈ A ∩
´ B
´ B . ………(b)
This implies that Á U B́⊆ A ∩
Example Use set builder notation and logical equivalences to show that A ∩
´ B= Á U B́ .
={x│⇁(x∈(A∩B))}
={x│⇁(x∈A∧ x∈B)}
={x│x∉AVx∉B}
={ x│x ∈ Á Vx ∈ B́ }
´ B ={ x│x ∈ Á U B́}
A∩
A∩(BUC)=(A∩B)U(A∩C)
Example:let U={1,2,3,….10}
and A={1,3,5,7,9} and B={2,4,6,8,10}
then computer representation of A is the bit string 1010101010 and of B is 0101010101 and if
C={1,2,3,4,5} then computer representation of C is 1111100000
Example: let A={1,3,5,7,9} then what is the bit string for the complement of this set?
Solution: since A={1,3,5,7,9} then Á ={2,4,6,8,10} and its bit string is 0101010101
Exercise1.5:
Q1: let A be the set of students who live within one mile of the school and let B be the set of
students who walk to the classes.Describ the students in each of the following sets
a) (A∩B)
the set of students who live within one mile of the school and walk to the classes
b) (AUB)
the set of students who either live within one mile of the school or walk to the classes or
both.
c) A-B
the set of students who live within one mile of the school but do not walk to the classes
d) B-A
the set of students who walk to the classes but do not live within one mile of the school
Q2:suppose that A is the set of sophomores at your school and B is the set of students in discrete
mathematics at your school .Express each of the following sets in terms of A and B.
(A∩B)
b) the set of sophomores at your school who are not taking discrete mathematics
A-B
c)the set of students who either are sophomores or taking discrete mathematics
AUB
d)the set of somphomores at your school who either are not sophomores or not taking discrete
mathematics
A⊕B
c)A-B d)B-A
try yourself
c)A-B d)B-A
try yourself
⇒x∉ Á
⇒ x∈A
⟹ Á ⊆A…(a)
Let y∈A
⇒y∉ Á
⟹y∉ Á
⟹ A ⊆ Á ……(b)
⟹ x ∉ AUB.
⟹ x ∉ Aandx ∉B
⟹ x ∈ Á andx ∈ B́ .
⟹ x ∈ Á ∩ B́ .
´ ⊆ Á ∩ B́ ……(a)
⟹ AUB
let y ∈ Á ∩ B́ .
⟹ y ∈ Á andy ∈ B́ .
⟹ y ∉ Aand y ∉B
⟹ y ∉ AUB.
⟹y∈ AUB
´
´ ….(b)
⟹ Á ∩ B́ ⊆ AUB
´ = Á ∩ B́
Combining (a)and (b) we get AUB
b)
A B AUB ´
AUB Á B́ Á ∩ B́
1 1 1 0 0 0 0
1 0 1 0 0 1 0
0 1 1 0 1 0 0
0 0 0 1 1 1 1
´ C = Á U B́ U Ć
Q11;Show that if A,B,C are sets ,then A ∩ B∩
⟹ x ∉ A ∩ B ∩C.
⟹ x ∉ Aorx ∉Borx ∉ C
⟹ x ∈ Á orx ∈ B́ orx ∈ Ć .
⟹ x ∈ Á U B́ U Ć .
⟹ A ∩B´ ∩C ⊆ Á U B́ U Ć .……(a)
let y ∈ Á U B́ U Ć .
⟹ y ∈ Á ory ∈ B́ ory ∈ Ć .
⟹ y ∉ Aor y ∉Bor y ∉C
⟹ y ∉ A ∩B ∩C.
⟹ y∈ A ∩ B
´ ∩C
⟹ Á U B́ U Ć ⊆ A ∩B´ ∩C ….(b)
´ C = Á U B́ U Ć
Combining (a)and (b) we get A ∩ B∩
b)membership table
A B C A∩ B ∩C ´ C Á
A ∩ B∩ B́ Ć Á U B́ U Ć
1 1 1 1 0 0 0 0 0
1 1 0 0 1 0 0 1 1
1 0 1 0 1 0 1 0 1
1 0 0 0 1 0 1 1 1
0 1 1 0 1 1 0 0 1
0 1 0 0 1 1 0 1 1
0 0 1 0 1 1 1 0 1
0 0 0 0 1 1 1 1 1
Clearly from column 5th and 9th A ∩ B∩
´ C = Á U B́ U Ć
Proof:letx ∈A-B
⟹ x ∈A but x∉B
⟹ x ∈Aand x ∈ B́
⟹ x ∈A∩ B́
⟹ A-B⊆ A ∩ B́……(a)
lety ∈A∩ B́
⟹ y ∈Aand y ∈ B́
⟹ y ∈A and y∉B
⟹ y ∈A-B
⟹ A ∩ B́⊆ A−B……(b)
a)AU(BUC)=(AUB)UC
b)A∩(B∩C)=(A∩B)∩C
c) AU(B∩C)=(AUB)∩¿AUC)
Solution:try it yourself
Solution:
a) A ∩ B∩ C
b)AUBUC
c)( AUB)∩C
d)( A ∩ B)UC
solution:try yourself
Q18.Draw the venn diagram for each of the following combinations of the sets A,B,C