lecture 5: set theory 1 dr andrew purkiss-trew cancer research uk [email protected]...
TRANSCRIPT
Lecture 5:Set Theory 1
Dr Andrew Purkiss-TrewCancer Research UK
Mathematics for Computing
Material to be covered today
Set Theory 1
What are sets?
How are they represented?
Special and subsets
Set Operations
Power Sets
Cartesian Products
What are Sets?
A set is a well defined group of items.
Sets are made up of elementse.g. The set of students studying at Birkbeck College
Set representation 1
Enumerated form:{2,4,6,8} Positive even numbers <10{2,4,6,8,…,50} Positive even nos. <=50{2,4,6,8,…} Positive even numbers{2,3,5,7,11,13,17,19} Prime numbers <20
Set Representation 2
Predicate form{x:x is even and 0 < x <= 50}{x:P(x)}
Letters can represent setsA = {1,2,3,4,5}B = {x:x is a multiple of 2}
Set Representation 3
A = {1,2,3,4,5}, B = {x:x is a multiple of 2}
Representation of elements3 A, 2 B6 A, 3 B
Special Sets:N = {1,2,3,4,…}J = {…,-3,-2,-1,0,1,2,3,…}Q = {x: x = m/n for the integers m and n}R is the set of real numbers
Special Sets
The null set:
enumerated form {} or predicate form {x: xx}
The universal set:
examples: = R, = J
Subsets
Two sets A and BB is defined as a subset of A (represented B A), when all elements of B are also elements in A.
Example: A = {1,2,3,4,5,6}, B = {2,3,5}, C = {2,4,6,8}.BA but as 8C, but 8A, C is not a subset of A.
Set Representation 4
A={1,2,3,4,5,6},B={2,3,5},C={2,4,6,8}
3 5 2 4
681
A
B
C
7
Venn Diagrams
More on subsets
Another example:N J Q R
Other pointsFor any set A, AA and A
Set equality
Two sets A and BDefinition A = B if AB and B
Implications1) {1,2,3} = {3,1,2} = {3,2,1} = {2,1,3}2) {a,a,b} = {a,b}
Proper Subset
B is a proper subset of A if:B A andB A.
Set operations
Union A B
Intersection A B
Complement Ā
Difference A – B
Union
A B = {x:x A or x B}
A B
Intersection
A B = {x:x A and x B}
A B
Complement
Ā = {x:x and x }
A
Difference
A - B = {x:x A and x B}
A B
Difference 2
A B
A - B = A B̄
Cardinality
Cardinality. The number of elements in the set
A = {1,2,3,4,5}, |A| = 5B = {2,4,6,…,20}, |B| = 10
Power sets
If A is a set, the power set of A, (A) is the set of all subsets of A
A = {1,2,3}, (A) = {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}
Cartesian Products
A x B = {(x,y): x A and y B}
Example: A = {1,3,5}, B = {2,4}A x B = {(1,2),(1,4),(3,2),(3,4),(5,2),(5,4)}
Home time
End of Set Theory 1