Vous êtes sur la page 1sur 27

Combinatorics

Wiskundige Methoden / Mathematical Methods FEB21010(X)

dr. Twan Dollevoet


dollevoet@ese.eur.nl - H11-10

Econometric Institute

May 1, 2013

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

1 / 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

Example: Passwords
A 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}.

Choosing a password is equivalent to selecting 12 times a number


between 1 and 62.

Answer:
6212 = 3, 226, 266, 762, 397, 899, 821, 056 3.3 1021

Two important observations:

Repetition is allowed: AAABBBCCCAAA is a valid password.


Order is important: ABCDEFGHIJKL 6= LKJIHGFEDCBA.

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

3 / 27

Example: Counting the number of hands in a poker game


Texas Holdem
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

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Repetition is
not allowed
k-permutation
from n

Repetition is
allowed
k-permutation with
repetition from n

Order is not
important

k-combination
from n

k-combination with
repetition from n

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

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
not allowed
k-permutation
from n

k from n
Order is
important
Order is not
important

k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
k-combination with
repetition from n

May 1, 2013

6 / 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 10


grandchildren.
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

Four fundamental counting problems


Basic counting problem: Select k times from a set of n elements.
Four variants can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important
Order is not
important

Repetition is
not allowed
k-permutation
from n
forming a committee
k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
k-combination with
repetition from n
distributing chocolate

May 1, 2013

8 / 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 to
choose an element x A.

One-to-one rule 1.3


Let A and B be finite sets. If and only if there is a one-to-one
correspondence between A and B, then the number of elements in A and
B 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 Nn .


Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

9 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
forming a committee
k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
???
k-combination with
repetition from n
distributing chocolate

May 1, 2013

10 / 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 62
characters equals 6212 3.3 1021 .
The number of integers that a computer can represent by 8 bits (= 1
byte) equals 28 = 256.
The number of three-letter words on a license plate equals
263 = 17576.
Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

11 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
forming a committee
k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
nk
k-combination with
repetition from n
distributing chocolate

May 1, 2013

12 / 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 6= , 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

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 6= 1-CBA-213

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

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.
Exactly 100 three-letter combinations are forbidden.
{License plates} X Y Z ,
where
X = {1, . . . , 7} = N7 ,
Y = {three-letter, non-forbidden words},
Z = {three-digit number}.
One-to-one

Product rule

|{License plates}| = |X Y Z | = |X | |Y | |Z | = 7 (263 100) 103 .


Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

15 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
forming a committee
???
k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
nk
k-combination with
repetition from n
distributing chocolate

May 1, 2013

16 / 27

Example: Displaying products in a music store


Consider a music store with 50 DVDs .
The store has room for displaying 10 DVDs.
(Our recommendation / Our Top 10 / . . .)
Question: In how many ways can the shop display 10 DVDs?
40 39 . . . 1
40 39 . . . 1
50 49 . . . 41 40 39 . . . 1
=
40 39 . . . 1
50 49 . . . 1
=
40 39 . . . 1
50!
50!
=
=
40!
(50 10)!

50 49 . . . 41 = 50 49 . . . 41

Here n! = n (n 1) . . . 1.
Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

17 / 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 be
done in
n!
P(n, k) =
(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!
(n n)!
0!
1
ways.
Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

18 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
displaying DVDs
n!
P(n, k) = (nk)!
k-combination
from n
hands in a card game

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
nk
k-combination with
repetition from n
distributing chocolate

May 1, 2013

19 / 27

Exercise: Arranging books on a shelf


A student possesses
6 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?

the books on economics should be on the left?

all books on mathematics should be adjacent?

the subjects should alternate?

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

20 / 27

Exercise: Arranging books on a shelf


A student possesses
6 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?


12! = (6 + 6)! 4.8 108

the books on economics should be on the left?


6! 6! 5.2 105

all books on mathematics should be adjacent?


6! 7 6! 3.6 106

the subjects should alternate?


2 6! 6! 1.0 106

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

21 / 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 N6 = {1, 2, 3, 4, 5, 6} and A = {1, 2, 3, 5}.
Then
Nn A = {4, 6}.
Let B = {2, 5}. Then
A B = {1, 3}.
Let C = {3, 4}. Then
A C = {1, 2, 5}.

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

22 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
displaying DVDs
n!
P(n, k) = (nk)!
k-combination
from n
hands in a card game
???

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
nk
k-combination with
repetition from n
distributing chocolate

May 1, 2013

23 / 27

Our third result


Important observation: Two similar problems
1

Selecting k elements from a set of n elements without repetition

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 these
numbers!
Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

24 / 27

Combinatorial theorems I
Theorem: Complementarity (Exercise 1.21)
For n 0, 0 k n, it holds that
  

n
n
=
.
k
nk
Proof Consider the set Nn .

n
k is the number of subsets of Nn of size k.

If A is a subset of size k, then Nn A is a subset of size n k.


There is one-to-one correspondence between subsets of size k and
subsets of size n k:
{subsets of size k} {subsets of size n k} : A 7 Nn A
By the one-to-one rule the number of subsets of size k equals the
number of subsets of size n k.

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

25 / 27

Combinatorial theorems II
Theorem: Pascals identity (Exercise 1.22)
For n 0, 1 k n, it holds that

   

n+1
n
n
=
+
.
k
k
k 1
Proof Consider the set Nn+1 .

n+1
is the number of subsets of Nn+1 of size k.
k
Each subset A of size k satisfies either
1
2

n+1
/ A: A Nn : A is a subset of Nn of size k
n + 1 A: A {n + 1} Nn : |A {n + 1}| is a subset of Nn of size
k 1.

There is a one-to-one correspondence between


1
2

set of subsets of Nn of size k or k 1, and


set of subsets of Nn+1 of size k.

Twan Dollevoet (Econometric Institute)

Combinatorics

May 1, 2013

26 / 27

Four fundamental counting problems


Four basic counting problems can be classified according to
whether repetition is allowed;
whether the order is important.

k from n
Order is
important

Order is not
important

Repetition is
not allowed
k-permutation
from n
displaying DVDs
n!
P(n, k) = (nk)!
k-combination
from n
hands in a card game

C (n, k) = kn

Twan Dollevoet (Econometric Institute)

Combinatorics

Repetition is
allowed
k-permutation with
repetition from n
passwords
nk
k-combination with
repetition from n
distributing chocolate

May 1, 2013

27 / 27

Vous aimerez peut-être aussi