Professional Documents
Culture Documents
3 Sets and Combinatorics
3 Sets and Combinatorics
A B
• Basic Definitions
• Operations on Sets
• Set Identities
Permutation
If n is any nonnegative integer, we define n factorial, which is denoted by n!, as
follows:
0!=1, 1!=1, 2!=1*2, 3!=1*2*3,
and in general,
n!=1*2*3*,…(n-1)n.
Theorem:
The number of ways an ordered list of r objects can be chosen without repetition
from n objects is
n!
n( n 1)...(n r 1)
( n r )!
and denote by P(n, r). These lists are called permutations of n objects, taken r
at a time.
n!
P ( n, r )
( n r )!
Defining Sets
e.g.
Examples of Sets
Other examples:
The set of all polynomials with degree at most three: {1, x, x 2, x3, 2x+3x2,…}.
Later we will study how to determine the size of the following sets:
• the set of poker hands which are “full house”.
• the set of n-bit strings without three consecutive ones.
• the set of valid ways to add n pairs of parentheses
Subset
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
U
A
Proper Subset, Equality
A B
Fact: If A = B, then |A| = |B|.
This Lecture
• Basic Definitions
• Operations on Sets
• Set Identities
Basic Operations on Sets
intersection:
B A
Basic Operations on Sets
union:
Fact:
B A
Basic Operations on Sets
difference:
Fact:
A-B=AB
complement:
Fact: If , then
Examples
A B = {6, 10},
A B = {1, 2, 3, 4, 6, 7, 8, 10}
A-B = {1, 3, 8}
Partitions of Sets
Then {A1, A2} is not a partition of A, because A 1 and A2 are not disjoint,
Fact (to be explained later): If A has n elements, then pow(A) has 2 n elements.
Cartesian Products
Using the above examples, AxAxA is the set of strings with three letters.
Our ID card number has one letter and then six digits,
so the set of ID card numbers is the set AxBxBxBxBxBxB.
• Basic Definitions
• Operations on Sets
• Set Identities
Famous Identities
• Identity AU=A
AU=A
• Domination
AUU=U (Lazy)
A=A
• Idempotent
AUA=A
AA=A
• Uniqueness AA=
• Double complement
A=A
(A U B) U C = A U (B U C)
(A B) C = A (B C)
• Associativity
A U (B C) = (A U B) (A U C)
A (B U C) = (A B) U (A C)
• Distributivity
(A B) = A U B
• DeMorgan’s II
p q
(2)
A B A B
C C
(1) (2)
Set Identities
De Morgan’s Law:
Set Identities
De Morgan’s Law:
Algebraic Proof
by distributive law
Exercises
Exercises