273 - Lecture 2 - Permutations and Combinations: 1 Combinatorics & Discrete Probability
273 - Lecture 2 - Permutations and Combinations: 1 Combinatorics & Discrete Probability
Version 1.01
Sariel Har-Peled
January 25, 2004
1 Combinatorics & Discrete Probability
Example 1.1 How many word Scrabbles can we make from ROSEN?
SNORE, NOSER, SENOR, ...
5 4 3 2 1 = 5!
by Rule of product.
We will consider 0! = 1.
Example 1.2 Q: How many dierent bijective functions are there between X to X, where
|X| = 5?
Draw a function.
Dene onto function,
dene one to one function
Dene bijective function = one to one + onto.
R S
O N
S O
E R
N E
Draw graph showing function.
Thus, a bijective function from X to X is just an ordering of X. This is known as a
permutation of X.
1
Theorem 1.3 There are n! ways to order a collection of n objects.
(Namely, there n! permutations of n objects.)
What if elements are indistinguishable?
Example 1.4 Word scrabble: FREEDOM. How many dierent ways to order it?
If FRE
1
E
2
DOM then 7!.
Example 1.5 Word scrabble: MISSISSIPPI. How many dierent ways to order it?
Theorem 1.6 There are
n!
n
1
!n
2
!n
k
!
ways to order n elements with k groups of identical ele-
ments with sizes n
1
, n
2
, . . . , n
k
.
Proof: (By induction.)
Base case: k = 1, all characters are identical, and there are only n!/n! = 1 way to do it.
Induction step: Assume true for k = i 1, show for k = i. So assume the ith group
elements are indistinguishable, then there are
n!
n
1
! . . . n
k1
!
ways. Now, if the elements of the ith groups are not distinguishable, then we are counting
every distinct ordering n
k
! times, by the overcounting argument. Thus, there are
n!
n
1
! . . . n
k1
!
1
n
k
!
.
ways, as claimed.
What if we consider ordering of r objects, but we have n r to choose from?
Example 1.7 Using the English alphabet, how many 4-letter words can be made, assuming
there are no words with two identical letters?
Theorem 1.8 There are P(n, r) = n(n 1) (n r +1) ways to make an ordered lists of
r objects from a collection n dierent objects (without replacement).
Note that P(n, r) =
Such orderings are sometime called r-permutations.
Here, whenever we choose an object, we take it away and it can not be used again.
This is known as choosing without replacement.
2
Q: What if allow replacement?
Theorem 1.9 There are n
r
ways to make an ordered list of r objects from a collection of n
dierent objects with replacement allowed.
Example 1.10 How many strings of length r can be formed from n symbols?
n
r
Example 1.11 How many functions f : X Y such that |X| = r and |Y | = n?
n
t
Now return to the case of without replacement, but lets forget about ordering.
Example 1.12 How many ways can we choose a set of 4 letters from the letters of the
English alphabet?
If we can about ordering, then P(26, 4) =
26!
24!
r-permutations. Note, that we have the
word
BDGX
a lot of times with dierent order:
BGDX, BXGD, XGDB...
How many exactly?
4!.
As such, the number of such sets is
26!
22!4!
=
26 25 24 23
4!
=
26 25 24 23
24
= 25 24 23.
Theorem 1.13 There are
n!
(nr)!r!
ways to select r objects from a collection of n distinct
objects (w/o replacement) if order is irrelevant.
Notation:
C(n, r)
n
r
n!
(n r)!r!
We read
n
r
as n choose r.
n
r
10 + 4
4
Note that this also the result for 11 boxes and 4 balls.
Theorem 1.16 The number of ways to place r indistinguishable balls into n boxes is
r+n1
r
n+r1
n1
.
Example 1.17 How many solutions are there to the equation
x
1
+x
2
+ +x
n
= r
such that x
i
0, i {1, . . . , n} and x
i
is an integer?
4