Lecture 1. Permutations and Combinations

Lecture 1. Permutations and Combinations
June 23, 2014
A permutation of 123 is, say, 321 or 231: numbers cannot repeat. There are 3 · 2 · 1 = 3! = 6
permutations: there are 3 chioces for the first slot, 2 choices for the second slot (because one
of the numbers is already in the first slot and cannot be repeated), and only one choice for the
last, third slot.
In general, for 1, 2, 3, . . . , n − 1, n there are
n! = 1 · 2 · 3 · . . . · (n − 1) · n
permutations. This number is called n factorial. Examples:
1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720.
There is a convention that 0! = 1. Indeed, we have the property (n−1)!n = n! for n = 2, 3, 4, . . ..
It follows from the definition of the factorial, and this is the main property. We would like it
to be true also for n = 1: 0! · 1 = 1!, so 0! = 1.
Factorial grows very quickly. Indeed, 100! is extremely large; no modern computer can go
through permutations of 1, 2, . . . , 100. When a computer programming problem encounters
search among permutations of n numbers, then this problem is deemed unsolvable.
Stirling’s formula:
n n
√
n! v 2πn
as n → ∞
e
where f (n) v g(n) means limn→∞ f (n)/g(n) = 1.
If we have three slots for numbers 1, 2, 3, 4, 5, 6, 7, and repetitions are not allowed, this is
called an arrangement. Say, 364, 137, 634. There are 7 · 6 · 5 = 210 such arrangements: 7
choices for the first slot, 6 for the second and 5 for the third. We can write this as
A37 = 7 · 6 · 5 =
7·6·5·4·3·2·1
7!
=
.
4·3·2·1
(7 − 3)!
In general, if there are k slots for 1, 2, . . . , n, then the number of arrangements is
Akn = n · (n − 1) · (n − 2) · . . . · (n − k + 1) =
n!
.
(n − k)!
How many subsets of three elements are there in the set {1, 2, . . . , 7}? The difference between
an arrangement and a subset is that for a subset, order does not matter. (But in both of them,
there are no repetitions.) For example, {3, 4, 6} and {6, 3, 4} is the same subset, but 346 and
634 are different arrangements. From any subset, we can create 3! = 6 arrangements. So the
quantity of subsets is equal to the quantity of arrangements divided by 6:
7!
210
A37
=
=
= 35.
3!
4!3!
6
In general, the quantity of subsets of k elements in {1, . . . , n} is called combinations:
n
Ak
n · (n − 1) · . . . · (n − k + 1)
n!
= n =
=
k
k!
k!
(n − k)!k!
It is pronounced as “n choose k”.
Examples:
(i) 10 = 1, because there is only one subset of zero elements in {1}, and this is an empty
set ∅. (ii) 11 = 1, because there is only one subset of one element in {1}: the set {1} itself.
(iii) n0 = 1, for the same reason as in (i);
(iv) nn = 1, for the same reason as in (ii);
(v) 21 = 2, because there are two subsets of one element of {1, 2}: these are {1} and {2};
(vi) n1 = n, because there are n subsets of one element of {1, 2, . . . , n}: {1}, {2}, . . . , {n};
n
(vii) n−1
= n, because to choose a subset of n − 1 elements out of {1, 2, . . . , n}, we need
to throw away
one element, and it can be chosen in n ways;
4
(viii) 2 = 4!/(2!2!) = 24/4 = 6, and these subsets of {1, 2, 3, 4} are
{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}.