Set Theory
Set Theory
V aei
ou
This is equivalent to
A⊆B and B⊆A
Proper Subsets
Definition: If A ⊆ B, but A ≠B, then we say A is a
proper subset of B, denoted by A ⊂ B. If A ⊂ B, then
is true.
U
Venn Diagram B
A
Contd..
Set Cardinality(The Size of a Set )
Definition: If there are exactly n distinct elements in S where n is a
nonnegative integer, we say that S is finite. Otherwise it is infinite.
Definition: The cardinality of a finite set A, denoted by |A|, is
the number of (distinct) elements of A.
Examples:
1. |ø| = 0
2. Let S be the letters of the English alphabet. Then |S| = 26
3. |{1,2,3}| = 3
4. |{ø}| = 1
5. The set of integers is infinite.
6. Let A be the set of odd positive integers less than 10. Then |A| = 5
Power Sets
Definition: The set of all subsets of a set A, denoted
P(A), is called the power set of A.
Example: If A = {a,b} then
P(A) = {ø, {a},{b},{a,b}}
Cartesian Product
Definition: The Cartesian Product of two sets A and B, denoted
by A × B is the set of ordered pairs (a,b) where a ∈ A and b ∈
B.
Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}
Solution: {1,2,3,4,5} U
A B
Intersection
Definition: The intersection of sets A and B, denoted
by A ∩ B, is
• Example: Let A be the math majors in your class and B be the CS majors. To count
the number of students who are either math majors or CS majors, add the number of
math majors and the number of CS majors, and subtract the number of joint
CS/math majors.
• We will return to this principle in Chapter 6 and Chapter 8 where we will derive a
formula for the cardinality of the union of n sets, where n is a positive integer.
Review Questions
Example: U = {0,1,2,3,4,5,6,7,8,9,10} A = {1,2,3,4,5}, B ={4,5,6,7,8}
1. A∪B
Solution: {1,2,3,4,5,6,7,8}
2. A ∩ B
Solution: {4,5}
3. Ā
Solution: {0,6,7,8,9,10}
4.
Solution: {0,1,2,3,9,10}
5. A – B
Solution: {1,2,3}
6. B – A
Solution: {6,7,8}
Symmetric Difference (optional)
Definition: The symmetric difference of A and B,
denoted by ( is the set
Example:
U = {0,1,2,3,4,5,6,7,8,9,10}
A = {1,2,3,4,5} B ={4,5,6,7,8} U
What is : A B
Solution: {1,2,3,6,7,8}
Venn Diagram
PROBLEMS
1) Let U = {a, b, c, d, e, f, g}, A = {a, b, c, d}, B = {a, b, c, d, e, f} and C = {a, b, g}
find , , A – B, B – C, A B, (A B) and B C.
iv) A (B C) v) BC
Solution of Q2)
Given, , }
i)
[{}-A]
[{
Solution to Q2) Contd..
ii)
iii)
iv)
v)
Problems
3) Find the sets A and B if
and
Set Identities
Identity laws
Domination laws
Idempotent laws
Complementation law
Associative laws
Distributive laws
Absorption laws
Complement laws
Proving Set Identities
Different ways to prove set identities:
1. Prove that each set (side of the identity) is a subset of
the other.
2. Use set builder notation and propositional logic.
3. Membership Tables: Verify that elements in the same
combination of sets always either belong or do not
belong to the same side of the identity. Use 1 to
indicate it is in the set and a 0 to indicate that it is not.
Proof of Second De Morgan Law
Example: Prove that
Solution: We prove this identity by showing that:
1) and
2)
Solution:
A B C
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1
Computer Representation of Sets
a) Melbourne or Brisbane
d) neither city.
Solution to example 2
Let M be the set of people who
7
Example 4:
A car dealer has 160 new cars. 50 cars have automatic
transmission, 80 have the tilt steering and 30 have power
windows. 42 have both automatic transmission and tilt steering.
18 of them have both automatic transmission and power
windows. 15 cars have all 3 features. 65 cars have none of the
above mentioned features. Using Venn diagram find the
following:
Example 4 contd..
1) How many have tilt steering and power windows only?
15+5=20
2) How many have at least one of the features?
160-65=95
3) How many have exactly 2 of the features?
27+3+5=35
4) How many have exactly one of the features?
5+33+7=45
Exercises
1) Twenty-four people go on holidays. If 15 go swimming, 12 go fishing, and 6 do
neither, how many go swimming and fishing? Draw a Venn diagram and fill in the
number of people in all four regions.
2) In a certain school, there are 180 pupils in Year 7. One hundred and ten pupils
study French, 88 study German and 65 study Indonesian. Forty pupils study both
French and German, 38 study German and German only. Find the number of
pupils who study:
All three languages
Indonesian only