UOL Discrete Maths - Week 1 - Sets A
Lex Toumbourou ·
My notes from Week 1 from Discrete Mathematics Course Notes.
1.104 The definition of a set
- Set Theory
- a branch of maths about well-defined collections of objects.
- concept of sets by Georg Cantor, a German mathematician.
- forms the basis of other fields:
- counting theory
- relations
- graph theory
- finite state machines
- Set Theory, Sets
- a collection of any kind of "well-defined" objects:
- people, ideas, numbers etc.
- Set is unordered and contains unique objects.
- Examples and notation:
- Set of positive even integers < 10: E={2,6,4,8}
- Set of vowels in English alphabet: V={a,e,i,o,u}
- Set of colours: C={red,green,blue}
- Empty set (a set containing nothing): {} = ∅
- In math notation, use ∈ to represent that something is element of set:
* 2∈E.
- Use ∈/ if not an element of set:
- Cardinality
- Given set S, the cardinality of S is the number of elements contained in S.
- Write cardinality as ∣S∣
- Example: ∣C∣=3
- Subset
- Express as: ⊆
- A is a subset of B if and only if every element of A is also in B.
- This gives us equivalence:
- A⊆B⟺x∈A then x∈B(for all x)
- Any set is a subset of itself: S⊆S
- Empty Set
- is a subset of any set ∅⊆S
- empty set is a subset of itself: ∅⊆∅
- Special Sets
- N = set of natural numbers = {1,2,3,4,...}
- Z = set of integers = {...,−3,−2,−1,0,1,...}
- Q = set of rational numbers (of form a/b where a and b are elements of Z and b = 0)
- R = set of real numbers
- N⊆Z⊆Q⊆R
1.106 The listing method and rule of inclusion
- Set Representation Methods
- Listing Method
- Represent a set S using all elements of set S.
- Examples:
- Set of all vowels in English alphabet.
- S1={a,e,i,o,u}
- Set of all positive integers less than 10.
- S2={1,2,3,4,5,6,7,8,9}
- Set Builder Notation
- Examples:
- Set of all even integers: { ..., -6, -4, -2, 0, 2, 4, 6 ... }
- Even={2n∣n∈Z}
- Odd={2n+1∣n∈Z}
- Set of rational numbers Q: { ..., 1/1, 1/2, 1/3, 1/4, ... }
- Q={mn∣n,m∈Z and m =0}
- Set of things in my bag: {pen, book, laptop, ...}
- Bag ={x∣x is in my bag }
- Exercise
- Rewrite the following sets using listing method
- S1={3n∣n∈N and n<6}
- S1=3,6,9,12,15
- S2={2n∣n∈Z and 0≤n≤4}
- S2=1,2,4,8,16
- S3={2−n∣n∈Z and 0≤n≤4}
- S3={1,21,41,...}
- Rewrite the following sets using set building method
- S1={21,41,61,81,...}
- S1=2n1∣n∈Z and 0<n≤5
1.108 The Powerset of a set
- Powerset
- A set can have another set as its element.
* {5,6}∈{{5,6},{7,8}}
* {5,6}⊆{5,6,7}
- A set containing all subsets of another set.
- The powerset of S is P(S) which is the set containing all subsets of S.
- Example
- S={1,2,3}
- P(S)={∅,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}
- Exercise 1
- S={a,b}
- P(S)={∅,{a},{b},{a,b}}
- {a}∈P(S)
- ∅⊆P(S) - empty set is subset of P(S)
- ∅∈P(S) - empty set is also in P(S)
- Exercise 2
- P(∅)=?
- P(P(∅))=?
- Powerset of empty set is set containing empty set: P(∅)={∅}
- Empty set is the only subset of the empty set: ∅⊆∅
- Empty set is a set subset of the power set of empty set: ∅⊆P(∅)
- P(P(∅))={∅,{∅}}
- Cardinality of a powerset
- ∣P(S)∣=2∣S∣
- S={1,2,3}, ∣S∣=3, ∣P(S)∣=23=6
- P(S)={∅,{1},{2},{3},{1,2},{2,3}}
1.110 Set operations
| A |
B |
A∪B |
| 0 |
0 |
0 |
| 0 |
1 |
1 |
| 1 |
0 |
1 |
| 1 |
1 |
1 |
- Intersection
- Notion: A∩B
- Set builder: A∩B={x∣x∈A and x∈B}
- Looks like a horse shoe. The kind you'd take to a dirt road intersection.
- Think of an intersection between roads: it's the part of road that both of them share.
- Membership table
| A |
B |
A∪B |
| 0 |
0 |
0 |
| 0 |
1 |
0 |
| 1 |
0 |
0 |
| 1 |
1 |
1 |
- Set Difference
- Elements in A, but not B.
- A−B={x∣x∈A and x∈/B}
- Example:
- {1,2}−{2,3}={1}
- Membership table:
| A |
B |
A∪B |
| 0 |
0 |
0 |
| 0 |
1 |
0 |
| 1 |
0 |
1 |
| 1 |
1 |
0 |
- Symmetric Difference
- Elements in A or in B but not in both.
- A⊕B={x∣(x∈A or x∈B) and x∈/A∩B}
- Latex:
\oplus
- Can think of it as union of A and B, with all the common elements of A and B removed.
- A⊕B=(A∪B)−(A∩B)
- Example:
- A = {1, 2, 3}
- B = {3, 4, 5}
- A⊕B={1,2,4,5}
- Membership table
| A |
B |
A∪B |
| 0 |
0 |
0 |
| 0 |
1 |
1 |
| 1 |
0 |
1 |
| 1 |
1 |
0 |
1.112 Essential reading
- Koshy, Thomas. Discrete Mathematics with Applications:
- pp. 67-70 and pp. 72- 75
- pp.76: Exercises: 1–8, 13-27, 30-32 and 41-44.