Permutations

Consider a list of objects. Any arrangement of these objects by changing the order in the list is called a permutation. We are interested in the number of possible permutations that can be formed. For this discussion,we need to distinguish between the case where all the objects are different, and the case where some of the objects can be similar (no way to distinguish one object from the other).

All objects are different

We first discuss the case where all objects are different. For example, consider the word TEA (the objects are now the letters T, E, A). The number of possible permutations is 66:

TEA, TAE, ETA, EAT, AET, ATE

One way to think about forming a new permutation of TEA is to repeatedly take a letter from TEA (without replacement) to form the a new word. So there are 33 options for selecting the first letter, and for each of those three options there are two options for selecting the second letter, and for all those 323\cdot 2 options there is 11 option to select the last letter. So in total we have

321=63\cdot 2\cdot 1=6

or

3!=63!=6

possible ways to rearrange the word. Using a tree, we can represent this process in an elegant way:

Using the same argument for a word with 66 different letters, we see that the number of possible words we can form is

654321=7206\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1 = 720

or

6!=7206! =720

To summarise:

Theorem 1

A list of nn different objects can be arranged in n!n! different ways.

Some objects are the same

If some of the objects in the list are identical, it is harder to find all the different arrangements, because some of the arrangements will be the same.

Consider, for example, the word TESS. If all letters were different, the number of possible permutations would be 4!=244!=24, but because some of the letters in the word are the same, some of these 2424 words will also be the same (e.g. switch the last two letters, you get twice the word TESS). In fact, the number of different words you can form is 1212:

TESS, TSES, TSSE, ETSS, ESTS, ESST, STES, STSE, SSTE, SSET, SETS, SEST

So how can we calculate this number? The formula is

4!2!=12\frac{4!}{2!}=12

The 4!4! in the numerator is the number of words we could form if all letters were different, and because every word is doubled (because of the two Ss), we have to divide by 2=2!2=2!

Let's have a look at the word MISSISSIPPI. The number of different words is

11!4!4!2!=34650\frac{11!}{4!\cdot 4!\cdot 2!}=34\,650

because if all letters were different, there are 11!11! possible words we could form, but there are a factor of 4!4!2!4!\cdot 4!\cdot 2! to many words because there are 44 S, 44 I, and 2 P. It is not the intention here to prove this formula. But let's discuss in more detail the simplest case where the list contains two different kind of objects.

List with two types of objects

Consider the word

AAABBBBAAABBBB

The number of different words we can form is

7!3!4!=35\frac{7!}{3!\cdot 4!}=35

Let us try to understand why. We start by giving the letters labels, so that we can distinguish them:

A1A2A3B1B2B3B4A_1 A_2 A_3 B_1 B_2 B_3 B_4

The number of possible words we can form now is 7!7!. We now form groups: all words which would form the same word if the labels were erased are put into a group. For example, the words

A1A2A3B1B2B3B4A_1 A_2 A_3 B_1 B_2 B_3 B_4 A3A1A2B2B1B3B4A_3 A_1 A_2 B_2 B_1 B_3 B_4

are in the same group, because they form the same word

AAABBBBAAABBBB

while the words

B1A2A3A1B2B3B4B_1 A_2 A_3 A_1 B_2 B_3 B_4 B2A2A3A1B1B3B4B_2 A_2 A_3 A_1 B_1 B_3 B_4

are in another group and form the word

BAAABBBBAAABBB

The question is now: how many words are there in each group? Well, there are 3!3! possibilities to rearrange the indices of the AAs, and for each of those possibilities there are 4!4! possibilities to arrange the indices of the BBs. So in total there must be 3!4!3!\cdot 4! words in each group. So if we get rid of the indices, each group has 3!4!3!\cdot 4! too many words. Thus, to eliminate the same words, we have to divide the 7!7! by the 3!4!3!\cdot 4!. And the formula above follows.