TOA Handout-1
TOA Handout-1
Introduction
6
SETS
• Definition: A set is well defined collection of
objects, which are
• unordered
• distinct
• same type
• with common properties
• Sets are written with curly braces {}, and the
elements in the set are written within the curly
braces.
• The set {a, b, c} has elements a, b, and c.
• The sets {a, b, c} and {b, c, b, a, a} are the same
since order does not matter in a set and since
redundancy does not count.
• The set {a} has element a. Note that {a} and a are
different things; {a} is a set with one element a.
• The set {xn : n = 1, 2, 3, . . .} consists
of x, xx, xxx, . . ..
• The set of positive even numbers is {2,
4, 6, 8, 10, 12, . . .} = {2n : n =1, 2, 3, .
. .}.
• The set of odd numbers is {1, 3, 5, 7, 9,
11, 13, . . .} = {2n + 1 : n = 0, 1,
2, . . .}.
Set Representations
C = { a, b, c, d, e, f, g, h, i, j, k }
C = { a, b, …, k } finite set
S = { 2, 4, 6, … } infinite set
U = { 1 , … , 10 }
10
Set Operations
A = { 1, 2, 3 } B = { 2, 3, 4, 5}
A B
• Union
2 4
1
3
A U B = { 1, 2, 3, 4, 5 } 5
• Intersection
U
A B = { 2, 3 } 2
3
• Difference
A-B={1}
1
B - A = { 4, 5 }
Venn diagrams
Courtesy Costas Busch - RPI 11
• Complement
Universal set = {1, …, 7}
A = { 1, 2, 3 } A = { 4, 5, 6, 7}
4
A
A 3 6
1
2
5 7
A=A
12
{ even integers } = { odd
integers }
Integers
1 odd
even 5
2 6
0
4
3 7
13
DeMorgan’s Laws
U
AUB=A B
U
A B=AUB
14
Empty, Null Set:
={}
SU =S
U
S = = Universal Set
S- =S
-S=
15
Subset
A = { 1, 2,3,5} B = { 1, 2, 3, 4, 5 }
A B
U
Proper Subset: A B
U
B
A
16
Disjoint Sets
A = { 1, 2, 3 } B = { 5, 6}
U
A B=
A B
17
Set Cardinality
• For finite sets
A = { 2, 5, 7, 1, 10 }
|A| = 5
(set size)
18
Powersets
A powerset is a set of sets
S = { a, b, c }
={ , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c
Observation: | 2S | = 2|S| ( 8 = 23 )
19
Cartesian Product
A = { 2, 4 } B = { 2, 3, 5 } C={ 7,8}
A X B = { (2, 2), (2, 3), (2, 5), ( 4, 2), (4, 3), (4, 5) }
|A X B| = |A| |B|
AXBX…XZ
20