Permutations, Combinations, Factorials, and the Binomial coefficient
(that is, Counting)

Most gambling games are well understood mathematically, and are rigged so that the house has a small advantage. Casino customers play games for entertainment, and rely on luck. Casinos host the games to make money, and rely on mathematics to succeed.

These gambling games, and many other practical concerns, are discussed in terms of probabilities. To understand probabilities, one needs to know how to count certain kinds of events. It is convenient to speak in terms of various familiar activities of selecting items from a set, where the event would be the result of a certain kind of selection. In games, the items might be cards or throws of a die, but the principles are very general, and applicable to many situations and kinds of items.

There are formulas for counting these events. To understand them fully, and to use them, it is helpful to understand how the formulas are derived, because the derivations provide crucial insight into the kind of thinking that can be applied to such problems.

Here are derivations for three of the most important formulas. The first is conceptually the hardest, but the other two follow easily.

Selection with replacement

One of the most basic ways to select items from a set is to replace the item each time one is chosen.

A simple example would be n distinct balls in an opaque bag. One at a time, a ball is drawn from the bag, noted, and returned.

Each draw is the same: there are n balls, so simply n ways for a ball to be chosen.

For each way to choose a first ball, there are n ways to draw it and then a second ball, so the number of ways to draw two balls is n × n.

Repeating this process k times yields the number of ways to draw k balls from the n in the bag as

nk.

Permutations of n items

A permutation of distinct items is an ordering, or sequence, of the items.

For instance

	a, b, c

and

	c, a, b

are two different permutations of the letters a, b, and c.

The number of permutations of n items is written symbolically as P(n) .

guess a formula

all permutations of letters a, b, and c
abc
acb
bac
bca
cab
cba

How many permutations of

1 item? 1
2 items? 2 (note this is 2 × 1)
3 items? 6 (note this is 3 × 2 × 1)

You might guess that, in general, the number of permutations of n items would be given by the formula

P(n) = n × (n−1) × … × 1

This special product is called n factorial, and it is written

n!

How would one argue that this formula is correct, though?

derivation of formula

Suppose you count all the ways to arrange n−1 items, and call it P(n−1). Can you then find a formula for n items based on that?

adding a 4th item to a permutation of 3 items can be done in 4 ways
dabc
adbc
abdc
abcd

Consider how to insert another item into each of these arrangements of n−1 items. For each arrangement, another item could be inserted in any of n positions: before the first, between the first and second, etc., and after the last.

So the number of ways to arrange n items is

(number of ways to arrange n−1 items) × (number of ways to insert a new item among n−1 items)

That is,

P(n−1) × n

If the formula holds for n−1 items, then the formula for n items is

= (n−1)! × n
= n!

It follows by the principle of “mathematical induction” that the formula

P(n) = n!

holds for each n.

Permutations of k items taken from n items

Now consider the different arrangements or orderings of k items, taken from n items.

This is the number of ways to choose k items from n distinct items, where the order of the items matters. It is often written

P(n, k) ,

and read “permutations of n items taken k at a time”.

derivation of formula

Suppose k items are pulled out of a bag of n items. Then there are nk items remaining in the bag.

Now, the number of ways to pull out the remaining items is just the number of permutations of the remaining items, P(nk) .

For each of the P(nk) ways to pull out the first k items, there are P(nk) ways to pull out the remaining items. This is P(nk) × P(nk) altogether.

But the number of ways to pull out k items, then pull out the remaining nk, is the same as the number of ways to pull out all n items, which is to say,

P(nk) P(nk) = P(n) .

Now apply the formula for P(n):

P(n, k) (nk)! = n! ,

and rearrange to get

P(nk) = n! ⁄ (nk)!

Combinations of k items taken from n items

The phrase “combinations of n distinct items taken k at a time” means the ways in which k of the n items can be combined, regardless of order.

So rather than considering the orders in which items are chosen, as with permutations, the combinations consider which sets of items are chosen.

The combinations of n distinct items taken k at a time is often written

C(nk)

or

(n)
k

The C in C(nk) stands for “combinations” or “choices”. The number C(nk) is also often read “n choose k”.

derivation of formula

To derive a formula for C(nk), separate the issue of the order in which the items are chosen, from the issue of which items are chosen, as follows.

The number of permutations of k items taken from n items is

( number of sets of k items taken from n ) × ( number of ways to order the k items ) .

That is to say:

P(nk) = C(nk) × P(kk) .

Rearrange this to get:

C(nk) = P(nk) ⁄ P(kk)
= ( n! ⁄ (nk)! ) ⁄ k!
= n! ⁄ (k! (nk)! ) ,

and that is your “binomial coefficient”

C(nk) = n! ⁄ (k! (nk)! ) .

calculation

While the above expression for the binomial coefficient is convenient to write, it is a very poor way to calculate the value, because most of the factors cancel out in the division.

To calculate, say, C(10, 3), first note that

10! ⁄ (10 − 3)!
= 10! ⁄ 7!

consists of just the largest 3 factors of 10!

10 × 9 × 8 ;

all the other terms cancel. So

10! ⁄ ( 3! (10 − 3)! )
= 10 × 9 × 8 ⁄ 3!

The binomial coefficient always turns out to be a whole number, so all the factors of the denominator will cancel with factors in the numerator.

10! ⁄ ( 3! (10 − 3)! )
= 10 × 9 × 8 ⁄ ( 3 × 2 )
= 10 × 3 × 4
= 120