Professional Documents
Culture Documents
METHODS
Lecture 5:Set Theory
LECTURER: QURATULAIN
DEPARTMENT OF INFORMATION TECHNOLOGY
GOVERNMENT COLLEGE UNIVERSITY FAISALABAD
Formal Specification
FORMALISING AND REASONING ABOUT COMPUTATION
Given
(A ∪ B) = 60
n(A) = 27
n(B) = 42 then;
n(A ∩ B) = n(A) + n(B) - n(A ∪ B)
= 27 + 42 - 60
= 69 - 60 = 9
=9
Therefore, 9 people like both tea and coffee. (A ∩ B) ?
https://www.hitbullseye.com/Quant/Set-Theory.php
Scenario # 7.2:
In a group of 100 persons, 72 people can speak English and 43 can speak French. How many can speak English only?
How many can speak French only and how many can speak both English and French?
Solution: Let A be the set of people who speak English. B be the set of people who speak French.
A - B be the set of people who speak English and not French.
B - A be the set of people who speak French and not English.
A ∩ B be the set of people who speak both French and English. = 72 – 15 = 57
57 15 28 = 43 – 15 = 28
n(A) = 72
n(B) = 43
A-B A∩B B-A
n(A ∪ B) = 100
Therefore, Number of persons who speak both French and English = 15
n(A) = n(A - B) + n(A ∩ B) ⇒
Given, n(A - B) = n(A) - n(A ∩ B)
n(A) = 72 = 72 - 15
n(B) = 43 = 57
n(A ∪ B) = 100 and n(B - A) = n(B) - n(A ∩ B)
Now, n(A ∩ B) = n(A) + n(B) - n(A ∪ B) = 43 - 15
= 72 + 43 - 100 = 28
= 115 - 100 Therefore, Number of people speaking English only = 57
= 15 Number of people speaking French only = 28
Venn Diagrams
Venn diagrams were conceived around 1880
by John Venn.
They are used to teach elementary set theory, as well as
illustrate simple set relationships in probability, logic,
statistics linguistics and computer science.
Venn diagram consist of rectangles and closed curves usually
circles. The universal is represented usually by rectangles and its
subsets by circle.
ILLUSTRATION:
In fig U = { 1, 2, 3, …., 10 } is the universal set of
which
A = { 2, 4, 6, 8, 10 } and B = { 4, 6 } are subsets, and
also B ⊂ A
A‟ (A ∩ B)‟
SOME PROPERTIES OF THE OPERATION OF UNION
1) AUB=BUA ( commutative law )
2) (AU B ) UC =AU ( B U C ) ( associative law )
3) AUϕ=A ( law of identity element )
4) AUA=A ( idempotent law )
5) U UA= U ( law of U ) A∪B B’ (B dash)
1) Complement laws : 1) A U A‟ = U 2) A ∩ A‟ = Φ
2) De Morgan’s law :
(i) (A U B)' = A' ∩ B' (De Morgan's law of union).
(ii) (A ∩ B)' = A' U B' (De Morgan's law of intersection). (A ∪ B)’ (A - B)’
3) Laws of double complementation : ( A‟ ) „ = A
4) Laws of empty set and universal set : Φ „ = U & U‟ = Φ
For example;
Use Venn diagrams in different situations to find the following sets.
ξ = {a, b, c, d, e, f, g, h, i, j} (1) B - A
A = {a, b, c, d, f}
B = {d, f, e, g
(2) (A ∩ B)'
(3) (A ∪ B)' ?
B - A = {elements which are in B but not in A} = {e, g}
(A ∩ B)' = {elements of ξ which are not in A ∩ B}
= {a, b, c, e, g, h, i, j}
(A ∪ B)' = {elements of ξ which are not in A ∪ B} = {h, i, j}
There is only one dog that is black with a short tail and long hair. Two of the
dogs are black with short tails and do not have long hair. Two of the dogs
have short tails and long hair but are not black.
B + LH –ST = ? X LH= 15
U= 24
ST Only = ? B= 12 ST=6
= 6-2-1-2 = 1
B only = ?
= 12-2-1-x = 9-x
2
LH only = ?
= 15-2-1-x = 12-x
1
X 2
LH= 15
U= 24
B= 12 ST=6
B =?
12-X-1-2 = 12
B 9- X = 12
2 1
X = 3
B only = 6 1
X 2
LH only = 3+1+2-15
LH only = 9
LH= 15
U= 24
B= 12 ST=6
Sum of All
B+ST+LH= 24
12 + 6 + 15 = 24
6 2 1
1
3 2
9
LH= 15