Permutation / Computation Guide

il_bandito
Fri, 02 Sep 2005 14:28:09 +0000

Yeah, usually in situations where you want to find the number of permutations possible with a certain limitation, it is good to find the ones noninclusive to the limitation and subtract it from the total.

Permutation is simple, it is the different arrangements of a set of elements, such as: 123, 321, 231, 213

So a permutation of 4 elements is 4 x 3 x 2 x 1 because you have 4 choices for the 1st item, 3 for the 2nd, 2 for the third, and 1 for the last. (Note there can be repeated elements in each arrangement because the 1st for one arrangement might be picked as the 2nd or 3rd or 4th in another arrangement.) The equation is 4!

Thus, nPr stands for n elements choose r elements for a Permutation. (P stands for Permutation.) And the formula would be n!

A combination is a set of unique elements with no consideration towards the sequence.

nCr means n items, Choose r for a Combination. (C stands for combination.) So a combination is n!/(n-r)! (r!)

If you don’t understand why this formula is the way it is, think of it this way:

If you want to pick 3 items from 4, you will have 4 for the 1st choice, 3 for the 2nd, and 2 for the 3rd.

4!/4-3 is equal to this. It cancels out the factorization up to the first 3 or first r factors.

So it becomes: 4 x 3 x 2

However, this is still a permutation. This is because the first item can be picked as the 2nd item if it were not picked as the first. This goes for all elements modeled this way and thus it has repeats. A combination does not have repeats. So simply divide the permutation by the number of permutations 3 (or r) elements can have. This gives you the number of unique combinations by cancelling out all of the different permutations with the same elements.

So the nCr equation is n!/(n-r)!r!