Week 3 Notes - (Inclusion, Exclusion, Boolean Algebra)
Week 3 Notes - (Inclusion, Exclusion, Boolean Algebra)
|A ∪ B| = |A| + |B|
However if A ∩ B ̸= ∅, then
|A ∪ B| = |A| +. |B| − |A ∩ B|
Example(s):
1. Find the number of integers between 1 and 100 (inclusive) that are divisible by either 2 or 5.
Solution
Let A be the set of all integers divisible by 2, between 1 and 100 (inclusive).
Let B be the set of all integers divisible by 5, between 1 and 100 (inclusive).
Hence,
|A ∪ B| = |A| + |B| − |A ∩ B| = 50 + 20 − 10 = 60
Exercise:
1. Find the number of integers between 1 and 100 (inclusive) divisible by 3, 5, or 7. [ans:
|A ∪ B ∪ C| = 55]
2. Find the number of even numbers between 200 and 400 (inclusive) which are divisible by 3, 5 or
7. [ans: |A ∪ B ∪ C| =]
1
0.2 Set identities (Boolean algebra) ⃝Francis
c Oketch
• A∩U =A • A∪A=A
2. Zero laws: • A ∩ (A ∪ B) = A
• A ∪ (A ∩ B) = A
• A∩∅=∅
• A∪U =U 8. Complementation laws:
3. Commutative laws: • A ∩ Ac = ∅
• A ∪ Ac = U
• A∩B =B∩A
• A∪B =B∪A 9. Double complementation:
Example(s):
(b) (A ∩ B)c = Ac ∪ B c
Example(s):
2
0.2 Set identities (Boolean algebra) ⃝Francis
c Oketch
Proof.
A ∩ (Ac ∪ B) = (A ∩ Ac ) ∪ (A ∩ B) “Distributive law”
= ∅ ∪ (A ∩ B) “Complementaion law”
= (∅ ∪ A) ∩ (∅ ∪ B) “Distributive law”
= A ∩ B “Identity law”
(b) (Ac ∩ B c ) ∩ (A ∪ B ∪ C) = Ac ∩ B c ∩ C
Proof.
(Ac ∩ B c ) ∩ (A ∪ B ∪ C) = (A ∪ B)c ∩ (A ∪ B ∪ C) “De Morgan’s law”
= [(A ∪ B)c ∩ (A ∪ B)] ∪ [(A ∪ B)c ∩ C] “Distributive law”
= ∅ ∪ [(A ∪ B)c ∩ C] “Complementation law”
= (A ∪ B)c ∩ C “Identity law”
= Ac ∩ B c ∩ C “De Morgan’s law”
(c) A − (B ∪ C) = (A − B) ∩ (A − C)
Proof.
A − (B ∪ C) = A ∩ (B ∪ C)c
= A ∩ (B c ∩ C c ) “De Morgan’s law”
= (A ∩ B c ) ∩ (A ∩ C c ) “Distributive law”
= (A − B) ∩ (A − C)
Example(s):
1. Prove the following set identities
(a) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Proof. Using sets, show that A ∩ (B ∪ C) ⊂ (A ∩ B) ∪ (A ∩ C) and (A ∩ B) ∪ (A ∩ C) ⊂
A ∩ (B ∪ C)
Let x ∈ A ∩ (B ∪ C) ⇒ x ∈ A and x ∈ B ∪ C
⇒ x ∈ A and (x ∈ B or x ∈ C)
⇒ (x ∈ A and x ∈ B) or (x ∈ A and x ∈ C)
⇒ (x ∈ A ∩ B) or (x ∈ A ∩ C)
⇒ x ∈ (A ∩ B) ∪ (A ∩ C)
Hence, A ∩ (B ∪ C) ⊂ (A ∩ B) ∪ (A ∩ C)
Conversely,
Let y ∈ (A ∩ B) ∪ (A ∩ C) ⇒ y ∈ A ∩ B or y ∈ A ∩ C
⇒ (y ∈ A and y ∈ B) or (y ∈ A and y ∈ C)
⇒ y ∈ A and (y ∈ B or y ∈ C)
⇒ y ∈ A and y ∈ B ∪ C
⇒ y ∈ A ∩ (B ∪ C)
Hence, (A ∩ B) ∪ (A ∩ C) ⊂ A ∩ (B ∪ C)
Therefore, A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
3
0.2 Set identities (Boolean algebra) ⃝Francis
c Oketch
(b) (A ∩ B)c = Ac ∪ B c
Proof. Using sets, show that (A ∩ B)c ⊂ Ac ∪ B c and Ac ∪ B c ⊂ (A ∩ B)c
Let x ∈ (A ∩ B)c ⇒ x ∈
/ A∩B
⇒ x∈
/ A or x ∈
/B
⇒ x ∈ Ac or x ∈ B c
⇒ x ∈ Ac ∪ B c
Hence, (A ∩ B)c ⊂ Ac ∪ B c
Conversely,
Let y ∈ Ac ∪ B c ⇒ y ∈ Ac or y ∈ B c
⇒ y∈
/ A or y ∈
/B
⇒ y∈
/ A∩B
⇒ y ∈ (A ∩ B)c
Hence, Ac ∪ B c ⊂ (A ∩ B)c
Therefore, (A ∩ B)c = Ac ∪ B c .
2. Let A ⊂ B ∪ C and A ∩ B = ∅. Show that A ⊂ C.
Proof.
Let x ∈ A ⇒ x ∈ B ∪ C
⇒ x ∈ B or x ∈ C
Proof.
Let x ∈ A ∪ B ⇒ x ∈ A or x ∈ ∪B
if x ∈ A ⇒ x ∈ C since A ⊂ C
if x ∈ B ⇒ x ∈ D since B ⊂ D
∴ x ∈ C or x ∈ ∪D
⇒ x∈C ∪D
Therefore, A ∪ B ⊂ C ∪ D.
Proof.
Let X ∈ P(A ∩ B) ⇒ X ⊂ A ∩ B
⇒ X ⊂ A and X ⊂ B
⇒ X ∈ P(A) and X ∈ P(B)
⇒ X ∈ P(A) ∩ P(B)
4
0.2 Set identities (Boolean algebra) ⃝Francis
c Oketch
Proof.
Conversely,
Therefore, A × (B ∩ C) = (A × B) ∩ (A × C).
Exercise:
1. Show that
(a) A − B = A ∩ B c
(b) (A ∩ B) ∩ C = A ∩ (B ∩ C)
(c) (A − C) − (B − C) = (A − B) − C. [hint: use boolean algebra]
(d) [A ∪ (B ∩ C)]c = (C ∩ B)c − A. [hint: use boolean algebra]
3. Show that P(A) ∪ P(B) ⊂ P(A ∪ B). Is P(A) ∪ P(B) = P(A ∪ B) in general? Explain. [ans:
P(A) ∪ P(B) ̸= P(A ∪ B). Use A = {a} and B = {b}]
1
Mathematics is fun!