Professional Documents
Culture Documents
A B
• Basic Definitions
• Operations on Sets
• Set Identities
• Russell’s Paradox
Defining Sets
{x A | P( x)}
nou utlisons la notation:
We use the notation
e.g.
Examples of Sets
Other examples:
The set of all polynomials with degree at most three: {1, x, x2, x3, 2x+3x2,…}.
Later we will study how to determine the size of the following sets:
apres nous etudierons comment determiner le cardinal des ensembles suivants:
• the set of poker hands which are “full house”.
l'ensemble de mains d'un poker les quels sont "...."
• the set of n-bit strings without three consecutive ones.
• the set of valid ways to add n pairs of parentheses
Subset
sous ensemble
A B
not a subset
• If A={4, 8, 12, 16} and B={2, 4, 6, 8, 10, 12, 14, 16}, then but
• If A is the set of prime numbers and B is the set of odd numbers, then
si a est un ensemble de nombre premier et B est l'ensemble des nombres impaire alors
A B
Fact: If A = B, then |A| = |B|.
Exercises
1. ?
2. {3} {5,7,3}?
3. every set?
5. {a} = {{a}}?
6. If A B and B C, then A C?
7. If A B and B C, then A C?
This Lecture
• Basic Definitions
• Operations on Sets
• Set Identities
• Russell’s Paradox
Basic Operations on Sets
intersection:
e.g. Let A be the set of odd numbers, and B be the set of even numbers.
Then A and B are disjoint.
union:
Fact:
Basic Operations on Sets
difference:
Fact:
complement:
Fact: If , then
Examples
Fact (to be explained later): If A has n elements, then pow(A) has 2n elements.
si A a n éléments, alors p(A) a 2n éléments
Cartesian Products
Using the above examples, AxAxA is the set of strings with three letters.
utilisant l'exemple ci-dessus, est l'ensembles de
Our ID card number has one letter and then six digits,
so the set of ID card numbers is the set AxBxBxBxBxBxB.
1. Let A be the set of prime numbers, and let B be the set of even numbers.
soit A l'ensemble des nombres premiers et soit B l'ensemble des nombres paires
What is A B and |A B|?
3. Let A be the set of all n-bit binary strings, Ai be the set of all n-bit
binary strings with i ones. Is (A1, A2, …, Ai, …, An) a partition of A?
• Basic Definitions
• Operations on Sets
• Set Identities
• Russell’s Paradox
Set Identities
Some basic properties of sets, which are true for all sets.
Set Identities
(2)
A B A B
C C
(1) (2)
Set Identities
Distributive Law:
L.H.S
S1 S2
S3
A B
S4
S5 S6
R.H.S.
S7
De Morgan’s Law:
Set Identities
De Morgan’s Law:
Disproof
A B A B
C C
L.H.S R.H.S
Disproof
1 2 3 1 2 3
A B A B
4 5 6 4 5 6
7 7
C C
by distributive law
Exercises
This Lecture
• Basic Definitions
• Operations on Sets
• Set Identities
• Russell’s Paradox
Russell’s Paradox (Optional)
Is W in W?
What’s wrong???
Barber’s Paradox (Optional)
What’s wrong???
Solution to Russell’s Paradox (Optional)
The halting problem: Can we write a program which detects infinite loop?