Wow. There's a bunch of specific formulas for calculating the number of possible permutations, but I don't feel like looking any of them up, so I'm going to pull this from my *cough* posterior regions.

(I'm going to use numbers instead of letters because I think it's clearer.)

We'll start with a set of 1 element, {1}. How many permutations are possible? 1, of course. That's easy to see.

Expanding our set to 2 elements, {1, 2}, we find that 2 permutations are possible:

12

21

This is the same as 1 * 2.

Expanding to 3 elements, {1, 2, 3}, we find 6 possibilities:

1(23)

1(32)

2(13)

2(31)

3(12)

3(21)

...which is the same as 1 * 2 * 3.

Let's take a moment to examine that last set. Notice that there are two permutations that begin with each number. That's because there are only two distinct numbers that can follow the first in the series, and remember that the total number of permutations possible with two numbers is 2. So, having three numbers that can occupy the first position, and two permutations possible with each series that begins with a given number, the total number of permutations possible is 3 * 2.

Now, to four: {1, 2, 3, 4}

1 2(34)

1 2(43)

1 3(14)

1 3(41)

1 4(23)

1 4(32)

I don't need to write them all out to know the answer, because I see a pattern. There are 4 numbers that can occupy the first position, 3 that can take the second, and 2 permutations of the last two digits. This gives us 4 * 3 * 2 = 24 possibilities.

Now I know for sure that the formula for the number of combinations possible with a given number of elements n is n!.

(Skip this if you already know what the "!" means. It means "factorial." To take the factorial of a number, you multiply it by all of the integers smaller than it. So, 4! is 4*3*2*1. 100! is 100*99*98 ... 3*2*1 = a reeeaaalllyyy big number, etc.)

*Last edited by ryos (2005-09-22 15:12:03)*