Permutation Lock

It’s an intense moment. You watch the lottery presenter press the button. A ball swiftly rolls out and its number rotates onto the screen. Sadly, it’s not the number you would have liked. What are the chances of that?

What are the chances of that? Before we get onto that, let’s consider a situation when we have ten balls, each number 1 to 10, and we take all ten balls and line them up in a row. In how many ways could we line them up? This is another example of a permutation, and is exactly like the dictionary example we looked at last week. There are 10 balls to choose from first the first position, 9 for the second, and so on, giving 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1, or 10!.

Now we’ll consider what combinations are. Whereas the number of permutations is the number of ways you can order of group of items, the number of combinations only cares about what’s in the list of items, and not what the order is. In the example above, there is only one possible combination – this combination consists of the balls 1 to 10, and it doesn’t matter what order they’re in. Order matters in permutations, but not in combinations.

Let’s look at how many combinations there are when we’re only allowed to select only four balls out of the ten. We find that, using the formula from last week, the number of permutations is 10!/(10-4)! or 5040. This takes into account the order however, so we’ll expect that the number of combinations is fewer than this.

Say we selected the balls 1 to 4. We know that these four balls constitute one combination, and that there are 4! = 24 permutations, considering only these four balls. Therefore, for each combination, there are 4! times as many permutations. So to find the number of combinations, we just divide the number of permutations by the factorial of the size of the group we choose, or 4! in this case. This gives us a formula for the number of combinations, where n is the number of items you may choose from and r is the number of items you choose.


Now let’s return to the lottery situation where there are fifty possible numbers, from which you may choose six. What is the probability of matching all six balls and winning the jackpot? Using the formula as above, we find that the number of combinations is 50!/[6!(50-6)!] = 15,890,700 – the odds are about 1 in 16 million, a depressingly low probability…

We can also look at why a combination lock is named erroneously in mathematical terms. If your code is 1234, then a combination lock would imply that 3142 would also unlock it. We know that the number of permutations is far greater than the number of combinations, which is why locks are much more secure when the correct order also matters. They should, in fact, be named permutation locks.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s