 ## Permutations

The number of ways you can change the order of a set of things is called the number of PERMUTATIONS of that set of things.
 For example, how many different ways can you arrange the letters in the word "WHO" ```Answer: WHO WOH HWO HOW OHW OWH = 6 ways 1 2 3 4 5 6 ``` Each different letter arrangement is called a permutation of the word "WHO". How about the word "STOP"? Well, here they are: ``` STOP STPO SOTP SOPT SPTO SPOT <- starts with "S" TSOP TSPO TOSP TOPS TPSO TPOS <- starts with "T" OSTP OSPT OTSP OTPS OPST OPTS <- starts with "O" PSTO PSOT PTSO PTOS POST POTS <- starts with "P" ``` There are 24 ways to order the letters in "STOP".

Is there a general rule here? Fortunately, yes.
Here's the rule for "STOP":
1. There are 4 ways to pick the first letter.
2. After you pick the first letter there are
3 ways to pick the second letter.
3. After you pick the first 2 letters, there are
2 ways to pick the third letter.
4. After picking the first 3 letters, there
is only 1 letter left to pick.
So the number of ways to order the letters in
"STOP" is: 4 x 3 x 2 x 1 = 24 ways!
Do you see the pattern here? Here's the pattern:
 WORDLENGTH EXAMPLE PERMUTATIONS RESULT 1 A 1 = 1 2 AM 2x1 = 2 3 BOY 3x2x1 = 6 4 GIRL 4x3x2x1 = 24 5 TABLE 5x4x3x2x1 = 120 6 PIANOS 6x5x4x3x2x1 = 720 7 PICTURE 7x6x5x4x3x2x1 = 5040 8 PURCHASE 8x7x6x5x4x3x2x1 = 40320

Now, let's suppose you only want to choose a few
letters out of your word. For example, you only
want to choose 2 letters out of the word "TABLE".
Here are all the ways to pick them:
```TA   TB   TL   TE   AT   AB   AL   AE   BT   BA
BL   BE   LT   LA   LB   LE   ET   EA   EB   EL```
There are 20 pairs.
Is there a rule here too? Of course there is:
1. There are 5 ways to choose the first letter.
2. After you choose the first letter,
there are 4 ways to choose the second letter.
So, the number of 2 letter permutations
of the 5 letter word "TABLE" is 5 x 4 = 20
How about a general rule? Here it is:
If you have a word with "N" letters in it,
and you only want to pick a few letters from it, then:

 Number of lettersyou want Calculate: Example: TABLE N = 5 letters 2 N x (N-1) 5 x 4 = 20 3 N x (N-1) x (N-2) 5 x 4 x 3 = 60 4 N x (N-1) x (N-2) x (N-3) 5 x 4 x 3 x 2 = 120

Using factorials, this is:
P = N! / (N - M)!

where M is the number of letters you are selecting.
For our example of 3 letters out of the word TABLE, this becomes:
P = 5! / (5-3)! = 120 / 2! = 120 / 2 = 60 ways.