Combinations and Permutations

What's the Difference?

In English we use the word "combination" loosely, without mentation if the order of things is important. In another wrangle:

in speech

"My yield salad is a combination of apples, grapes and bananas" We Don't care what order the fruits are in, they could too be "bananas, grapes and apples" or "grapes, apples and bananas", its the same fruit salad.

in speech

"The compounding to the innocuous is 472" . Straight off we do wish about the order. "724" won't work, nor bequeath "247". It has to be incisively 4-7-2.

Indeed, in Mathematics we use more precise language:

  • When the govern doesn't substance, it is a Combination.
  • When the order does matter it is a Substitution.

permutation lock

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

Put differently:

A Permutation is an ordered Combination.


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

Permutations

At that place are basically two types of permutation:

  1. Repetition is Allowed: such as the lock above. It could be "333".
  2. No Repetition: e.g. the first trine masses in a running race. You hind end't be premier and second.

1. Permutations with Repetition

These are the easiest to calculate.

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

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

n × n × n
(n multiplied 3 multiplication)

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

n × n × ... (r times)

(Put differently, there are n possibilities for the first choice, THEN there are n possibilites for the secondment choice, and so on, multplying each time.)

Which is easier to put down exploitation an power of r:

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

Example: in the ignition lock preceding, there are 10 Numbers to pick out 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 prefer r of them,
repetition is allowed,
and order matters.

2. Permutations without Repeat

In this case, we have to reduce the number of available choices each time.

pool balls

Example: what order could 16 pool balls be in?

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

So, our first choice has 16 possibilites, and our next choice has 15 possibilities, so 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 prefer them all, fair-and-square 3 of them, and that is and so:

16 × 15 × 14 = 3,360

Put differently, there are 3,360 diverse slipway that 3 pool balls could be unreal out of 16 balls.

Without repetition our choices get reduced each metre.

Simply how do we write that mathematically? Answer: we use the "factorial function"

!

The factorial function (symbol: ! ) just means to multiply a serial of declivitous natural numbers. Examples:

  • 4! = 4 × 3 × 2 × 1 = 24
  • 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040
  • 1! = 1
Annotation: it is generally agreed that 0! = 1. It English hawthorn seem funny that multiplying no numbers together gets us 1, but IT helps simplify a lot of equations.

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

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

Only when we want to prize merely 3 we don't want to reproduce after 14. How do we practise that? There is a not bad trick: we split by 13!

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

That was not bad: the 13 × 12 × ... etc gets "cancelled out", leaving 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,
no repetitions,
order matters.

Example Our "order of 3 out of 16 puddle balls example" is:

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

(which is upright the same as: 16 × 15 × 14 = 3,360)

Example: How many ways fire first and second place be awarded to 10 populate?

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

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

Notation

Instead of writing the full-length pattern, people use unusual notations such as these:

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

Examples:

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

Combinations

There are also ii types of combinations (remember the order does not matter now):

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

1. Combinations with Repetition

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

2. Combinations without Repetition

This is how lotteries crop. The numbers are tired one after another, and if we deliver the lucky numbers (no matter what order) we win!

The easiest way to explain it is to:

  • assume that the order does matter (ie permutations),
  • then alter information technology and so the order does not matter.

Going back to our pool testicle case, LET's say we just want to know which 3 consortium balls are chosen, not the gild.

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

Simply numerous of those are the same to us now, because we wear't maintenance what prescribe!

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

And then, the permutations have 6 times as galore possibilites.

In fact there is an easy way to compute how many ways "1 2 3" could be placed in parliamentary procedure, and we have already talked about it. The resolve is:

3! = 3 × 2 × 1 = 6

(Another instance: 4 things can be placed in 4! = 4 × 3 × 2 × 1 = 24 polar ways, sample it for yourself!)

So we adjust our permutations formula to reduce information technology by how numerous shipway the objects could be in order (because we aren't fascinated in their order any more):

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

That formula is thus world-shattering information technology is often just written in big parentheses like this:

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

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

It is much called "n choose r" (such as "16 choose 3")

And is also known as the Quantity Coefficient.

Note

All these notations stand for "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 order)

So, our pool ball example (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 knocked out of 16, or choosing 13 balls dead of 16, ingest the same turn of combinations:

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

In point of fact the formula is prissy and symmetrical:

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

Also, knowing that 16!/13! reduces to 16×15×14, we can save lots of calculation past doing it this means:

16×15×14 3×2×1

= 3360 6

= 560

Pascal's Triangulum

We rear end also use Pascal's Triangle to find the values. Crash to row "n" (the top row is 0), and then along "r" places and the value there is our answer. Present is an extract viewing row 16:

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

1. Combinations with Repetition

Hunky-dory, now we can harness this one ...

ice cream

Let us say in that respect are five flavors of icecream: banana, hot chocolate, lemon tree, strawberry and vanilla.

We can have three scoops. How many variations will in that location follow?

Rent out's use letters for the flavors: {b, c, l, s, v}. Example selections include

  • {c, c, c} (3 scoops of chocolate)
  • {b, l, v} (unmatchable each of banana, lemon and vanilla)
  • {b, v, v} (one of banana, 2 of vanilla)

(And just to be clear: There are n=5 things to choose from, we opt r=3 of them,
order does not topic, and we dismiss reiterate!)

Now, I can't describe flat to you how to calculate this, but I can show you a special technique that lets you work it out.

bclsv

Think about the ice cream being in boxes, we could say "move past the first box, past take aim 3 scoops, then move on 3 much boxes to the end" and we will accept 3 scoops of burnt umber!

So IT is like we are order a golem to get our icecream, but it doesn't change anything, we still let what we want.

We can drop a line this down as acccaaa (arrow means move, rope means scoop).

As a matter of fact the three examples above give the sack be written like this:

So alternatively of worrying about antithetic flavors, we birth a simpler question: "how many unusual ways can we arrange arrows and circles?"

Notice that there are always 3 circles (3 scoops of icecream) and 4 arrows (we need to move 4 times to go from the 1st to 5th container).

So (being general here) there are r + (n−1) positions, and we want to choose r of them to rich person circles.

This is like locution "we have r + (n−1) pool balls and want to choose r of them". In other words IT is immediately like the pocket billiards balls question, but with slightly changed numbers. And we can pen it like this:

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

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

Interestingly, we can look at the arrows instead of the circles, and say "we have r + (n−1) positions and want to choose (n−1) of them to have arrows", and the answer is the one:

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

So, what about our model, what is the response?

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

There are 35 shipway of having 3 scoops from five flavors of icecream.

In Close

Phew, that was a peck to take over, indeed maybe you could read it again to be sure!

Merely well-educated how these formulas work is only half the battle. Computation out how to understand a real world situation can be quite ticklish.

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


Repeats allowed No Repeats
Permutations (order matters): nr n! (n − r)!
Combinations (order doesn't matter): (r + n − 1)! r!(n − 1)! n! r!(n − r)!

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