At times, we need to find different ways of ordering objects, and sometimes even how many different ways there are. Programmers, staticians, and systems analysts are among those who need to know such things. The name we give these operations is permutations.
A permutation is simply an ordered arrangement of distinct objects. For instance, if you have a set of objects such as {a,b,c,d}, a permutation of that set could be b,d,a,c. In fact, a,b,c,d is a permutation as well. The elements can be in any order for a permutation, but they cannot be repeated: a,d,b,a,c is not a valid permutation. This is what "distinct objects" means.
In addition, permutations do not necessarily have to have all of the elements of the set. The arrangement c,a is a permutation of our set as well. It is known as a 2-permutation, because it has 2 elements. An arrangement of r elements is called an r-permutation.
For natural numbers (0,1,2,...) r and n, n ≥ 1, 0 ≤ r ≤ n, the number of r-permutations P(n,r) of a set is
| P(n,r) = | n! |
![]() |
|
| (n-r)! |
Suppose we have 10 letters, a through j, and we want to make 3-permutations of them. For the first place, we have 10 choices. For the second place, we have 9 choices because one letter has already been used. Likewise, for the final spot, we have 8 choices of letters. Therefore, we have 10*9*8 = 720 different ways to arrange 10 letters into 3 ordered positions. 10! = 10*9*...*1, so we just need to eliminate 7*6*...*1 = 7! to get the correct answer. That is done by taking (letters-positions)! = (10-3)! = 7!. So if we divide 10! by (10-3)!, we get the desired result. Now we generalize it and say if we have n letters and we want r-permutations of them, there are n! / (n-r)! different permutations.
Let's say you and a friend love going to movies, and you get a Saturday afternoon free so you can indulge yourselves. You go to a multiplex that is showing 6 movies simultaneously, each starting at 2:00 pm, 4:00 pm, and 6:00 pm, after which you have to get back home. How many different ways can you watch the most different movies?
Answer: You have a choice of 6 movies, so this is your set. You can watch one movie at 2:00, one at 4:00, and one at 6:00, therefore you can watch 3 movies and you're looking for the number of 3-permutations. We have then
| P(6,3) = | 6! | = | 6*5*4*3*2*1 | = | 6*5*4 | = 120 |
![]() |
![]() |
|||||
| (6-3)! | 3*2*1 |
Many times, you will see probability associated with contests or uncertain events. Some of these are results of permutations. For instance, let's take a Keno casino modification for example. Suppose there are 100 numbers to choose from (00 to 99), you must choose 5 numbers in a specific order, and you can only choose a number once. What are your chances of winning the grand prize?
There are 100 choices, and we're only picking 5 of those, so we have P(100,5) = 100! / (100-5)! = 9,034,502,400 ways to pick 5 numbers in a specific order. Since only one of those is the winning sequence, your chances of winning are 1 in 9,034,502,400.
A government keeps some confidential information in a heavily guarded room that is locked with a 5-card mechanism. Eight different officials each carry a card, and to get access, the cards must be inserted in a specific order. The order changes daily, and 3 of the 8 cards will not be used on any given day. A novice spy needs to acquire some documents in this room. He manages to acquire all eight cards and slip past the guards, but doesn't realize until he gets to the door that only five cards are used and they must be inserted in the correct order. A wrong entry brings with it a mass of large men guys with big guns. What are his chances of getting the right sequence?
Proudly written entirely in VIM