Set Theory: Presented By: Santosh Kumar Ravi Kumar Rai
Set Theory: Presented By: Santosh Kumar Ravi Kumar Rai
Presented By:
Santosh Kumar
Ravi Kumar Rai
1
and now for something
completely different
Set Theory
2
Actually, you will see that logic and
set theory are very closely related.
Set Theory
Set: Collection of objects (elements)
aeA a is an element of A
a is a member of A
aeA a is not an element of A
A = {a
1
, a
2
, , a
n
} A contains
Order of elements is meaningless
It does not matter how often the same element is
listed.
3
Set Equality
Sets A and B are equal if and only if they contain
exactly the same elements.
Examples:
4
A = {9, 2, 7, -3}, B = {7, 9, -3, 2} : A = B
A = {dog, cat, horse},
B = {cat, horse, squirrel, dog} :
A = B
A = {dog, cat, horse},
B = {cat, horse, dog, dog} :
A = B
Examples for Sets
Standard Sets:
Natural numbers N = {0, 1, 2, 3, }
Integers Z = {, -2, -1, 0, 1, 2, }
Positive Integers Z
+
= {1, 2, 3, 4, }
Real Numbers R = {47.3, -12, t, }
Rational Numbers Q = {1.5, 2.6, -3.8, 15, }
(correct definition will follow)
5
Examples for Sets
A = C empty set/null set
A = {z} Note: zeA, but z = {z}
A = {{b, c}, {c, x, d}}
A = {{x, y}}
Note: {x, y} eA, but {x, y} = {{x, y}}
A = {x | P(x)}
set of all x such that P(x)
A = {x | xeN . x > 7} = {8, 9, 10, }
set builder notation
6
Examples for Sets
We are now able to define the set of rational
numbers Q:
Q = {a/b | aeZ . beZ
+
}
or
Q = {a/b | aeZ . beZ . b=0}
And how about the set of real numbers R?
R = {r | r is a real number}
That is the best we can do.
7
Subsets
A _ B A is a subset of B
A _ B if and only if every element of A is also
an element of B.
We can completely formalize this:
A _ B x (xeA xeB)
Examples:
8
A = {3, 9}, B = {5, 9, 1, 3}, A _ B ? true
A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A _ B ?
false
true
A = {1, 2, 3}, B = {2, 3, 4}, A _ B ?
Subsets
Useful rules:
A = B (A _ B) . (B _ A)
(A _ B) . (B _ C) A _ C (see Venn Diagram)
9
U
A
B
C
Subsets
Useful rules:
C _ A for any set A
A _ A for any set A
Proper subsets:
A c B A is a proper subset of B
A c B x (xeA xeB) . -x (xeB . xeA)
or
A c B x (xeA xeB) . x (xeB xeA)
10
Cardinality of Sets
If a set S contains n distinct elements, neN,
we call S a finite set with cardinality n.
Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3
11
B = {1, {2, 3}, {4, 5}, 6} |B| = 4
C = C |C| = 0
D = { xeN | x s 7000 } |D| = 7001
E = { xeN | x > 7000 } E is infinite!
The Power Set
P(A) power set of A
P(A) = {B | B _ A} (contains all subsets of A)
Examples:
A = {x, y, z}
P(A)
= {C, {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}}
A = C
P(A) = {C}
Note: |A| = 0, |P(A)| = 1
12
The Power Set
Cardinality of power sets:
| P(A) | = 2
|A|
Imagine each element in A has an on/off switch
Each possible switch configuration in A corresponds
to one element in 2
A
13
z z z z z z z z z
y y y y y y y y y
x x x x x x x x x
8 7 6 5 4 3 2 1 A
For 3 elements in A, there are
222 = 8 elements in P(A)
Cartesian Product
The ordered n-tuple (a
1
, a
2
, a
3
, , a
n
) is an
ordered collection of objects.
Two ordered n-tuples (a
1
, a
2
, a
3
, , a
n
) and
(b
1
, b
2
, b
3
, , b
n
) are equal if and only if they
contain exactly the same elements in the same
order, i.e. a
i
= b
i
for 1 s i s n.
The Cartesian product of two sets is defined as:
AB = {(a, b) | aeA . beB}
Example: A = {x, y}, B = {a, b, c}
AB = {(x, a), (x, b), (x, c), (y, a), (y, b), (y, c)}
14
Cartesian Product
The Cartesian product of two sets is defined as:
AB = {(a, b) | aeA . beB}
Example:
A = {good, bad}, B = {student, prof}
AB = {
15
(good, student), (good, prof), (bad, student), (bad, prof)}
(student, good), (prof, good), (student, bad), (prof, bad)} BA = {
Cartesian Product
Note that:
AC = C
CA = C
For non-empty sets A and B: A=B AB = BA
|AB| = |A||B|
The Cartesian product of two or more sets is
defined as:
A
1
A
2
A
n
= {(a
1
, a
2
, , a
n
) | a
i
eA for 1 s i s n}
16
Set Operations
Union: AB = {x | xeA v xeB}
Example: A = {a, b}, B = {b, c, d}
AB = {a, b, c, d}
Intersection: AB = {x | xeA . xeB}
Example: A = {a, b}, B = {b, c, d}
AB = {b}
17
Set Operations
Two sets are called disjoint if their intersection is
empty, that is, they share no elements:
AB = C
The difference between two sets A and B contains
exactly those elements of A that are not in B:
A-B = {x | xeA . xeB}
Example: A = {a, b}, B = {b, c, d}, A-B = {a}
18
Set Operations
The complement of a set A contains exactly those
elements under consideration that are not in A:
A
c
= U-A
Example: U = N, B = {250, 251, 252, }
B
c
= {0, 1, 2, , 248, 249}
19
Set Operations
Table 1 in Section 1.5 shows many useful equations.
How can we prove A(BC) = (AB)(AC)?
Method I:
xeA(BC)
xeA v xe(BC)
xeA v (xeB . xeC)
(xeA v xeB) . (xeA v xeC)
(distributive law for logical expressions)
xe(AB) . xe(AC)
xe(AB)(AC)
20
Set Operations
Method II: Membership table
1 means x is an element of this set
0 means x is not an element of this set
21
1 1 1 1 1 1 1 1
1 1 1 1 0 1 1 0
1 1 1 1 0 1 0 1
1 1 1 1 0 1 0 0
1 1 1 1 1 0 1 1
0 0 1 0 0 0 1 0
0 1 0 0 0 0 0 1
0 0 0 0 0 0 0 0
(AB) (AC) AC AB A(BC) BC A B C
THANK YOU