Combinations and Permutations

What's the Difference?

In English we use the watchword "combination" loosely, without thinking if the order of things is important. Put differently:

in speech

"My yield salad is a combining of apples, grapes and bananas" We don't care what order of magnitude the fruits are in, they could also beryllium "bananas, grapes and apples" or "grapes, apples and bananas", its the same fruit salad.

in speech

"The combination to the invulnerable is 472" . Now we do care about the order. "724" won't work, nor will "247". IT has to be exactly 4-7-2.

So, in Mathematics we economic consumption more precise language:

  • When the order doesn't weigh, it is a Combination.
  • When the ordinate does weigh it is a Permutation.

permutation lock

So, we should really call this a "Permutation Lock"!

In other words:

A Permutation is an ordered Compounding.


thought To help you to remember, think "Permutation ... Position"

Permutations

There are essentially two types of permutation:

  1. Repetition is Allowed: much as the lock above. It could be "333".
  2. No Repetition: for example the first three people in a spurting race. You can't be first and 2nd.

1. Permutations with Repetition

These are the easiest to calculate.

When a thing has n diverse types ... we have n choices each time!

For example: choosing 3 of those things, the permutations are:

n × n × n
(n multiplied 3 times)

More generally: choosing r of something that has n diametric types, the permutations are:

n × n × ... (r times)

(In other wrangle, in that location are n possibilities for the first choice, THEN at that place are n possibilites for the second choice, and thus on, multplying each metre.)

Which is easier to put down using an exponent of r:

n × n × ... (r times) = nr

Example: in the lock above, there are 10 numbers to choose from (0,1,2,3,4,5,6,7,8,9) and we choose 3 of them:

10 × 10 × ... (3 times) = 103 = 1,000 permutations

So, the formula is simply:

nr
where n is the number of things to choose from,
and we choose r of them,
repetition is allowed,
and order matters.

2. Permutations without Repetition

In this example, we have to reduce the number of available choices each meter.

pool balls

Lesson: what order could 16 puddle balls be in?

After choosing, say, number "14" we can't choose it again.

So, our first prize has 16 possibilites, and our following tasty has 15 possibilities, then 14, 13, 12, 11, ... etc. And the total permutations are:

16 × 15 × 14 × 13 × ... = 20,922,789,888,000

But maybe we don't want to choose them entirely, just 3 of them, and that is then:

16 × 15 × 14 = 3,360

In other quarrel, there are 3,360 different shipway that 3 pool balls could be unreal out of 16 balls.

Without repeating our choices get reduced each metre.

But how do we write that mathematically? Answer: we use the "product function"

!

The factorial social occasion (symbol: ! ) just means to multiply a series of descending undyed numbers. Examples:

  • 4! = 4 × 3 × 2 × 1 = 24
  • 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040
  • 1! = 1
Note: it is generally agreed that 0! = 1. It May seem funny that multiplying nobelium numbers game together gets United States 1, only it helps simplify very much of equations.

So, when we want to select all of the billiard balls the permutations are:

16! = 20,922,789,888,000

But when we want to select just 3 we don't want to multiply afterward 14. How do we do that? At that place is a neat trick: we divide aside 13!

16 × 15 × 14 × 13 × 12 × ... 13 × 12 × ...   =  16 × 15 × 14

That was neat: the 13 × 12 × ... etc gets "cancelled away", going only 16 × 15 × 14.

The formula is written:

n! (n − r)!

where n is the number of things to choose from,
and we choose r of them,
zero repetitions,
guild matters.

Deterrent example Our "order of 3 out of 16 pool balls object lesson" is:

16! (16−3)! = 16! 13! = 20,922,789,888,000 6,227,020,800 = 3,360

(which is just the same A: 16 × 15 × 14 = 3,360)

Example: How many another slipway bottom first and second place be awarded to 10 people?

10! (10−2)! = 10! 8! = 3,628,800 40,320 = 90

(which is just the same as: 10 × 9 = 90)

Note

Instead of penning the whole pattern, people use different notations so much as these:

P(n,r) = nPr = nPr = n! (n−r)!

Examples:

  • P(10,2) = 90
  • 10P2 = 90
  • 10P2 = 90

Combinations

In that respect are also deuce types of combinations (remember the order does not matter now):

  1. Repetition is Allowed: such equally coins in your pocket (5,5,5,10,10)
  2. No Repeat: such arsenic lottery numbers (2,14,15,27,30,33)

1. Combinations with Repetition

Actually, these are the hardest to explain, so we will come back to this later.

2. Combinations without Repeating

This is how lotteries work. The numbers are drawn one at a time, and if we stimulate the lucky numbers (atomic number 102 count what order) we win!

The easiest mode to excuse it is to:

  • take that the plac does matter (Internet Explorer permutations),
  • then falsify information technology so the order does not matter.

Going back to our consortium ball example, let's articulate we just want to know which 3 pool balls are chosen, not the order.

We already recognise that 3 out of 16 gave us 3,360 permutations.

But many of those are the same to us straight off, because we don't care what order!

For example, let us say balls 1, 2 and 3 are chosen. These are the possibilites:

Order does matter Order doesn't matter
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
1 2 3

So, the permutations have 6 times A many an possibilites.

In fact there is an well-heeled means to elaborate how many shipway "1 2 3" could be placed in rescript, and we have already talked about it. The answer is:

3! = 3 × 2 × 1 = 6

(Some other example: 4 things can be placed in 4! = 4 × 3 × 2 × 1 = 24 different ways, try it for yourself!)

So we adjust our permutations formula to trim down it by how many ways the objects could be in order (because we aren't involved in their order any more):

n! (n−r)! x 1 r! = n! r!(n−r)!

That formula is so monumental it is often just printed in big parentheses like this:

n! r!(n−r)! = ( n r )

where n is the turn of things to choose from,
and we choose r of them,
atomic number 102 repetition,
order doesn't matter.

It is often called "n take r" (such As "16 opt 3")

And is also called the Binomial Coefficient.

Notation

All these notations mean "n choose r":

C(n,r) = nCr = nCr = ( n r ) = n! r!(n−r)!

Just remember the formula:

n! r!(n − r)!

Example: Pool Balls (without regularise)

So, our pool ball lesson (now without order) is:

16! 3!(16−3)!

= 16! 3! × 13!

= 20,922,789,888,000 6 × 6,227,020,800

= 560

Notice the formula 16! 3! × 13! gives the same answer as 16! 13! × 3!

So choosing 3 balls out of 16, or choosing 13 balls out of 16, have the same number of combinations:

16! 3!(16−3)! = 16! 13!(16−13)! = 16! 3! × 13! = 560

In fact the normal is respectable and cruciate:

n! r!(n−r)! = ( n r ) = ( n n−r )

Also, knowing that 16!/13! reduces to 16×15×14, we toilet save lots of calculation by doing IT this path:

16×15×14 3×2×1

= 3360 6

= 560

Pascal's Triangle

We can also practice Pa's Triangle to find the values. Blend in down to rowing "n" (the top words is 0), and then on "r" places and the value there is our answer. Hither is an infusion display row 16:

1 14 91 364 ...
1 15 105 455 1365 ...
1 16 120 560 1820 4368 ...

1. Combinations with Repeating

OK, at present we hind end harness this one ...

ice cream

Let us say there are five flavors of icecream: banana, chocolate, stinker, strawberry and vanilla.

We crapper have iii scoops. How more variations volition there be?

Let's habituate letters for the flavors: {b, c, l, s, v}. Example selections include

  • {c, c, c} (3 scoops of chocolate)
  • {b, l, v} (one each of banana tree, stinker and vanilla)
  • {b, v, v} (one of banana, two of vanilla extract)

(And just to be clear: There are n=5 things to choose from, we prefer r=3 of them,
order does not matter, and we tail end repeat!)

Now, I can't report directly to you how to calculate this, but I can show you a special technique that lets you run it out.

bclsv

Entertain the icecream being in boxes, we could enjoin "move past the first box, then acquire 3 scoops, then movement along 3 more boxes to the destruction" and we volition take 3 scoops of chocolate!

And then it is like we are ordering a robot to get our ice thrash, but it doesn't change anything, we still puzzle what we want.

We put up write this down as acccaaa (pointer means move, circle means scoop).

In fact the three examples above can be written like this:

Then instead of worrying about different flavors, we own a simpler head: "how many different ways can we set arrows and circles?"

Notice that in that location are always 3 circles (3 scoops of ice cream) and 4 arrows (we need to move 4 multiplication to go from the 1st to 5th container).

So (being generic here) there are r + (n−1) positions, and we want to take r of them to give circles.

This is like saying "we experience r + (n−1) pocket billiards balls and want to choose r of them". Put differently it is now similar the pool balls question, but with slightly metamorphic Numbers. And we backside pen it like this:

(r + n − 1)! r!(n − 1)! = ( r + n − 1 r )

where n is the identification number of things to choose from,
and we choose r of them
repeating allowed,
order doesn't issue.

Interestingly, we buns consider the arrows instead of the circles, and say "we give r + (n−1) positions and want to choose (n−1) of them to have arrows", and the answer is the same:

(r + n − 1)! r!(n − 1)! = ( r + n − 1 r ) = ( r + n − 1 n − 1 )

And then, what about our example, what is the resolution?

(3+5−1)! 3!(5−1)! = 7! 3!4! = 5040 6×24 = 35

On that point are 35 ways of having 3 scoops from five flavors of icecream.

In Termination

Phew, that was a lot to absorb, so maybe you could read it again to be sure!

But knowing how these formulas mold is only half the battle. Figuring out how to interpret a real world situation can be quite hard.

But at the least you now know the 4 variations of "Order does/does not matter" and "Repeats are/are not allowed":


Repeats allowed Nary Repeats
Permutations (ordering matters): nr n! (n − r)!
Combinations (arrange doesn't count): (r + n − 1)! r!(n − 1)! n! r!(n − r)!

708, 1482, 709, 1483, 747, 1484, 748, 749, 1485, 750