Combinatorics – Permutations
combinatorics, permutations, counting, probability
Many Probability problems involve the process of counting. For example,
How many ways are there to rearrange the letters in the word SHIP?
It is not very difficult to write down every possible way and count them up.
SHIP HSIP ISPH PSIH
SHPI HSPI ISHP PSHI
SIHP HIPS IPHS PISH
SIPH HISP IPSH PIHS
SPHI HPSI IHSP PHSI
SPIH HPIS IHPS PHIS
24.
But what if the question was
How many ways are there to rearrange the letters in the word SHIFTER?
Clearly, writing our every possibility is not a good idea (there are 5040 different ways). Luckily there is a formula for determining values like this. We refer to these rearrangements as Permutations.
A Permutation is a way of arranging different elements into a sequence where order matters. This is why we consider SHIP to be a different arrangement than HPSI – order matters.
The formula for the number of Permutations of k elements from a set with n elements is it is
n!
———
(n-k)!
Note, the ! symbol stands for factorial, which is a shorthand way of notating the product of an integer with every integer below it. So, 5! = 5*4*3*2*1, 8! = 8*7*6*5*4*3*2*1, etc.
So, let's look at our two examples.
Our first one asked the number of ways of rearranging SHIP. So, there are 4 elements in SHIP, and we want to rearrange all 4 of them. We get
4! 4! 24
——— = —— = ——
(4-4)! 0! 1 (0! = 1. Don't ask why, we just chose it that way)
So, we see it works. Similarly, we see the other example becomes 7! / 0! = 5040.
Here is a slightly different question:
How many ways are there if rearranging the letters in SHIFTER if I only want to choose 5 of the letters?
Luckily, we can use our formula again. We see our set has 7 elements, and we want to choose 5. So n = 7 and k = 5
7! 7! 5040
——— = — ——— = 2520. Success!
(7-5)! 2! 2
Now the we see how straightforward our formula is, often the most difficult part of these problems is figuring out what we are trying to find and what values we should use for n and k.
combinatorics, permutations, counting, probability