Upload
nemanja-milovanovic
View
215
Download
0
Embed Size (px)
Citation preview
8/9/2019 01 Combinatoriek I
1/27
Combinatorics
Wiskundige Methoden / Mathematical Methods FEB21010(X)
dr. Twan [email protected] - H11-10
Econometric Institute
May 1, 2013
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 1 / 27
8/9/2019 01 Combinatoriek I
2/27
What is combinatorics?
Combinatorics is about counting!
Counting all possible license plates
Counting the different hands in a card game
Counting the number of passwords for a website
Counting the possibilities to arrange books on a book shelf
Counting the ways to distribute bonuses over employees
. . .
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 2 / 27
8/9/2019 01 Combinatoriek I
3/27
Example: PasswordsA password for a website should satisfy the following conditions.
It should consist of 12 characters.
It should consist of letters and digits only.
Question: How many different passwords are possible.
1 {a, b , . . . , z , A, B , . . . , Z , 0, 1, . . . , 9} ↔ {1, 2, . . . , 62}.
2 Choosing a password is equivalent to selecting 12 times a numberbetween 1 and 62.
3 Answer:
6212 = 3, 226, 266, 762, 397, 899, 821, 056 ≈ 3.3 · 1021
4 Two important observations:◮ Repetition is allowed: AAABBBCCCAAA is a valid password.◮ Order is important: ABCDEFGHIJKL = LKJIHGFEDCBA.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 3 / 27
8/9/2019 01 Combinatoriek I
4/27
Example: Counting the number of hands in a poker gameTexas Hold’em
The game is played with a standard deck containing 52 cards.
Every player gets two cards from the deck.
Then, the game starts.
Examples of hands: {Ace♥, Ace♠}, {4♦, Jack♣}
Question: How many different hands are possible?
Two important observations:
Repetition is not allowed: You cannot have {Ace♠, Ace♠}.
Order is unimportant: {4♦, Jack♣} = {Jack♣, 4♦}.
Further questions:
What is the probability of getting two Aces?
What is the probability of getting two Hearts
. . .Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 4 / 27
8/9/2019 01 Combinatoriek I
5/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.
Repetition is Repetition is
k from n not allowed allowedOrder is k -permutation k -permutation with
important from n repetition from n
Order is not k -combination k -combination withimportant from n repetition from n
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 5 / 27
8/9/2019 01 Combinatoriek I
6/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.
Repetition is Repetition is
k from n not allowed allowedOrder is k -permutation k -permutation with
important from n repetition from npasswords
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 6 / 27
8/9/2019 01 Combinatoriek I
7/27
Examples for remaining fundamental counting problems
1 Committee to organize a party, consisting of
◮ a chairman, and◮ a treasurer, and◮ a secretary.
Characteristics: No repetition, order is important.
Question: If there are 10 candidates, how many committees can be formed?
2 A grandmother wants to distribute 20 chocolates over 10grandchildren.
Characteristics: With repetition, order is unimportant.
Question: In how many ways can grandmother distribute the chocolates over her grandchildren?
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 7 / 27
8/9/2019 01 Combinatoriek I
8/27
Four fundamental counting problems
Basic counting problem: Select k times from a set of n elements.
Four variants can be classified according towhether repetition is allowed;
whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
forming a committee passwords
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game distributing chocolate
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 8 / 27
8/9/2019 01 Combinatoriek I
9/27
What is counting?
Basic rule 1.0
Counting is determining the number of elements in a set.
We denote the number of elements in a set A by |A|.
The number of elements in a set A equals the number of ways tochoose an element x ∈ A.
One-to-one rule 1.3Let A and B be finite sets. If and only if there is a one-to-onecorrespondence between A and B , then the number of elements in A andB is equal: |A| = |B |.
A one-to-one correspondence is also called a bijection.Examples:
◮ {A, B , . . . , Z } ↔ {1, 2, . . . , 26}◮ Deck of cards ↔ {1, 2, 3, 4} × {1, 2, . . . , 13} ↔ {1, 2, . . . , 52}.
We denote the set {1, 2, . . . , n} by N n.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 9 / 27
8/9/2019 01 Combinatoriek I
10/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
forming a committee passwords???
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game distributing chocolate
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 10 / 27
8/9/2019 01 Combinatoriek I
11/27
Our first result
Theorem 1.4: k from n, with repetition, order is important
Selecting a k -permutation from n elements, with repetition, can be done in
nk
ways.
Examples:
The number of 12-character passwords over an alphabet of 62characters equals 6212 ≈ 3.3 × 1021.
The number of integers that a computer can represent by 8 bits (= 1byte) equals 28 = 256.
The number of three-letter ‘words’ on a license plate equals263 = 17576.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 11 / 27
8/9/2019 01 Combinatoriek I
12/27
8/9/2019 01 Combinatoriek I
13/27
Rule of sum and rule of product
Recall the following theorems from Precalculus.
Rule of sum 1.1
If A and B are finite, disjoint sets, then |A ∪ B | = |A| + |B |.
In general, if A ∪ B = ∅, then |A ∪ B | = |A| + |B | − |A ∩ B |.
Rule of product 1.2
If A and B are finite sets, then |A × B | = |A| · |B |.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 13 / 27
8/9/2019 01 Combinatoriek I
14/27
Example: Counting the possible license plates in Belgium
A license plate in Belgium consists of
a number between 1 and 7;three capital letters;
a number with three digits.
Examples: 1-ABC-123; 4-DKM-542; 3-ZZZ-999;
There are 100 combinations of three letters that cannot be used.Examples: AAP, BOM, DIK
Question: How many license plates are possible in Belgium?
Two important observations:Repetition is allowed: 1-TTT-111
Order is important: 1-ABC-123 = 1-CBA-213
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 14 / 27
8/9/2019 01 Combinatoriek I
15/27
Example: Counting the possible license plates in BelgiumA license plate in Belgium consists of
a number between 1 and 7;
three capital letters;
a number with three digits.
Exactly 100 three-letter combinations are forbidden.
{License plates} ↔ X × Y × Z ,
where
X = {1, . . . , 7} = N 7,
Y = {three-letter, non-forbidden words},
Z = {three-digit number}.
|{License plates}|One-to-one
↑= |X ×Y ×Z |
Product rule↑= |X | · |Y | · |Z | = 7 ·(263−100) ·103.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 15 / 27
8/9/2019 01 Combinatoriek I
16/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
forming a committee passwords??? nk
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game distributing chocolate
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 16 / 27
8/9/2019 01 Combinatoriek I
17/27
Example: Displaying products in a music store
Consider a music store with 50 DVD’s .
The store has room for displaying 10 DVD’s.(“Our recommendation” / “Our Top 10” / . . .)
Question: In how many ways can the shop display 10 DVD’s?
50 · 49 · . . . · 41 = 50 · 49 · . . . · 41 ·
40 · 39 · . . . · 1
40 · 39 · . . . · 1
= 50 · 49 · . . . · 41 · 40 · 39 · . . . · 1
40 · 39 · . . . · 1
= 50 · 49 · . . . · 1
40 · 39 · . . . · 1=
50!
40! =
50!
(50 − 10)!
Here n! = n · (n − 1) · . . . · 1.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 17 / 27
O
8/9/2019 01 Combinatoriek I
18/27
Our second result
Theorem 1.5: k from n, without repetition, order is important
Selecting a k -permutation from n elements, without repetition, can bedone in
P (n, k ) = n!
(n − k )!
ways.
Remarks:
Note that n! = n · (n − 1) · . . . · 1; 1! = 1; 0! = 1.
Arranging all n items can be done in
n!
(n − n)! =
n!
0! =
n!
1 = n!
ways.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 18 / 27
F f d l i bl
8/9/2019 01 Combinatoriek I
19/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
displaying DVD’s passwords
P (n, k ) = n!(n−k )! nk
Order is not k
-combination k
-combination withimportant from n repetition from nhands in a card game distributing chocolate
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 19 / 27
E i A i b k h lf
8/9/2019 01 Combinatoriek I
20/27
Exercise: Arranging books on a shelf
A student possesses6 books on economics, and
6 books on mathematics.
The books are arranged in a sequence on a book shelf.
How many options are there, if
1 the books can be placed in any order?
2 the books on economics should be on the left?
3 all books on mathematics should be adjacent?
4 the subjects should alternate?
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 20 / 27
8/9/2019 01 Combinatoriek I
21/27
I t S t diff
8/9/2019 01 Combinatoriek I
22/27
Intermezzo: Set difference
Set difference A− B
Let A and B be sets. Then we define their difference as
A − B = {x ∈ A : x /∈ B }.
Alternative notation for the set difference is A \ B .
Examples: Consider the sets N 6 = {1, 2, 3, 4, 5, 6} and A = {1, 2, 3, 5}.Then
N n − A = {4, 6}.
Let B = {2, 5}. Then
A − B = {1, 3}.
Let C = {3, 4}. ThenA − C = {1, 2, 5}.
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 22 / 27
F f d t l ti g bl s
8/9/2019 01 Combinatoriek I
23/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
displaying DVD’s passwords
P (n, k ) = n!(n−k )! nk
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game distributing chocolate???
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 23 / 27
Our third ‘result’
8/9/2019 01 Combinatoriek I
24/27
Our third result
Important observation: Two similar problems
1
Selecting k
elements from a set of n
elements without repetition2 Selecting a subset of size k from a set with n elements.
Definition: k from n, without repetition, order is unimportant
We define
C (n, k ) =
n
k
as the number of k -combinations without repetition from n
We pronounce this as ‘n choose k ’, or ‘n over k ’
Tomorrow, we will derive an expression that allows us to compute thesenumbers!
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 24 / 27
Combinatorial theorems I
8/9/2019 01 Combinatoriek I
25/27
Combinatorial theorems I
Theorem: Complementarity (Exercise 1.21)
For n ≥ 0, 0 ≤ k ≤ n, it holds that
n
k
=
n
n − k
.
Proof Consider the set N n.nk
is the number of subsets of N n of size k .
If A is a subset of size k , then N n − A is a subset of size n − k .
There is one-to-one correspondence between subsets of size k andsubsets of size n − k :
{subsets of size k } → {subsets of size n − k } : A → N n − A
By the one-to-one rule the number of subsets of size k equals thenumber of subsets of size n − k .
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 25 / 27
Combinatorial theorems II
8/9/2019 01 Combinatoriek I
26/27
Combinatorial theorems II
Theorem: Pascal’s identity (Exercise 1.22)
For n ≥ 0, 1 ≤ k ≤ n, it holds thatn + 1
k
=
n
k
+
n
k − 1
.
Proof Consider the set N n+1.n+1k
is the number of subsets of N n+1 of size k .
Each subset A of size k satisfies either1 n + 1 /∈ A: A ⊆ N n: A is a subset of N n of size k 2 n + 1 ∈ A: A − {n + 1} ⊆ N n: |A − {n + 1}| is a subset of N n of size
k − 1.There is a one-to-one correspondence between
1 set of subsets of N n of size k or k − 1, and2 set of subsets of N n+1 of size k .
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 26 / 27
Four fundamental counting problems
8/9/2019 01 Combinatoriek I
27/27
Four fundamental counting problems
Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.
Repetition is Repetition isk from n not allowed allowed
Order is k -permutation k -permutation withimportant from n repetition from n
displaying DVD’s passwords
P (n, k ) = n!(n−k )! nk
Order is not k -combination k -combination withimportant from n repetition from n
hands in a card game distributing chocolateC (n, k ) =
n
k
Twan Dollevoet (Econometric Institute) Combinatorics May 1, 2013 27 / 27