Set Theory
Set Theory
S = {a,b,c,d} = {b,c,a,d}
Order not important
S = {a,b,c,d} = {a,b,c,b,c,d}
the set.
S = {x | P(x)}
A predicate may be used:
Example: S = {x | Prime(x)}
p ,q }
Interval Notation
[a,b] = {x | a ≤ x ≤ b}
[a,b) = {x | a ≤ x < b}
(a,b] = {x | a < x ≤ b}
(a,b) = {x | a < x < b}
V aei
ou
Example 2: {N,Z,Q,R}
Example 3:
∅ ≠{∅}
containing the empty set.
Set Equality
Definition: Two sets are equal if and only if
they have the same elements.
Therefore if A and B are sets, then A and B are
equal if and only if .
{1,3,5} = {3, 5, 1}
We write A = B if A and B are equal sets.
{1,5,5,5,3,3,1} = {1,3,5}
Subsets
Definition: The set A is a subset of B, if and
only if every element of A is also an element
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
B
Venn Diagram 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.
1. |ø| = 0
Examples:
26
2. Let S be the letters of the English alphabet. Then |S| =
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}}
(1596-1650)
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)}
set:
U
Example:What is?
{1,2,3} ∩ {4,5,6} ?
A B
Solution: ∅
Complement
Definition: If A is a set, then the complement
the set U - A
of the A (with respect to U), denoted by Ā is
Ā = {x ∈ U | x ∉ A}
(The complement of A is sometimes denoted
by Ac .)
of {x | x > U
Example: If U is the positive integers
Venn less
Diagram for
70}
than 100, what is the complement
Complement
Solution: {x | x ≤ 70}
Ā
A
Difference
Definition: Let A and B be sets. The
difference of A and B, denoted by A – B, is the
set containing the elements of A that are not
in B. The difference of A and B is also called
A – B = {x | x ∈ A x ∉ B} = A ∩B
the complement of B with respect to A.
2. A ∩ B
Solution: {1,2,3,4,5,6,7,8}
Solution: {4,5}
3. Ā
Solution: {0,6,7,8,9,10}
4.
5. A – B
Solution: {0,1,2,3,9,10}
6. B – A
Solution: {1,2,3}
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
Solution: {1,2,3,6,7,8}
What is : A B
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) B C
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
1) and
2)
Solutio
n:
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.
Indonesian only