Permutations and combinations - the product rule, nPr and nCr
· 15 min read
In short
To count choices made one after another, multiply the numbers of options at each step - that is the product rule. Putting r of n different objects in order can be done in nPr = n!/(n − r)! ways. When the order does not matter, each group appears r! times among those orders, so you divide by r! and get nCr = n!/(r!(n − r)!).
Words to know
- Product rule
- If one step can be done in m ways and the next in n ways, whatever the first was, the two can be done in m · n ways.
- Factorial
- n! = 1 · 2 · … · n, the number of ways to put n different objects in a row. By convention 0! = 1.
- Permutation
- An arrangement of objects in which the order matters, like a podium or a code.
- Combination
- A selection of objects in which the order does not matter, like a team or a hand of cards.
- Binomial coefficient
- nCr, also written as n over r in brackets and read "n choose r". It counts the ways to choose r of n objects.
- Tree diagram
- A picture of a choice made in steps, with one branch for each option and one path for each result.
What do you think?
Five people meet, and each of them shakes hands once with each of the others. How many handshakes are there?
Each of the 5 people shakes 4 hands, which gives . But that counts every handshake twice: once as A shaking hands with B, and once as B shaking hands with A. So there are handshakes. 25 would let everyone shake their own hand too, and is the number of ways to put the five people in a row.
The idea: count in steps, then multiply
You could list every possibility, but lists get long very fast. Combinatorics counts the possibilities without writing them all down.
The main tool is the product rule. Split the choice into steps. If the first step can be done in ways and the second in ways, whatever happened in the first, then the two steps together can be done in ways. Three shirts and four pairs of trousers give outfits.
Then two questions tell you what to count:
- Does the order matter? A podium with gold, silver and bronze is ordered. A team of three is not: the same three people make the same team in any order.
- Can something be chosen again? The digits of a PIN can repeat. One runner cannot win gold and silver.
Drawing balls, step by step
Go through the animation with the buttons or the arrow keys. A bag holds four balls, A, B, C and D. Each branch of the tree is one ball drawn, and each path down from the bag is one result.
first draw: 4 options
ball drawn
The bag holds four balls: A, B, C and D. The first draw has 4 options, so the tree starts with 4 branches.
The last two steps are the whole idea of combinations. First count the results in order, using the product rule. Then divide by the number of orders in which each group appears.
Try it yourself: draw from the bag
Choose how you draw, then set the number of balls in the bag, , and the number you take out, . The boxes show how many options each draw has, and the list shows every result when there are not too many of them.
One ball at a time, and no ball goes back: order matters, but no ball comes twice.
The bag
- A
- B
- C
- D
Options for each draw
- draw 1: 4
- draw 2: 3
- Number of ways
- 4 · 3 = 12
All 12 results
- AB
- AC
- AD
- BA
- BC
- BD
- CA
- CB
- CD
- DA
- DB
- DC
What to notice:
- a code made of draws from balls has results, because every box holds ,
- on a podium each box holds one less than the box before it, because a ball cannot come back,
- with the podium puts every ball in order, so there are ways,
- a team is the podium divided by , and taking balls gives as many teams as taking balls: the balls you leave behind make a team too.
Definitions and formulas
The product rule. A choice is made in steps, and step has options whatever happened before it. Then the whole choice can be made in
ways. A tree diagram shows the same thing: one branch for each option, and one path for each result.
The sum rule. If the results split into cases that do not overlap, count each case and add the numbers. Example 1 uses both rules.
Factorial. For a whole number
and by convention . For example , and .
Permutations. You can put different objects in a row in ways. There are options for the first place, for the second, and so on down to 1 for the last.
Ordered selections without repetition. You can choose of different objects in order (a podium) in
ways. That is factors, each one less than the one before. With factorials it reads
Ordered selections with repetition. If an object can be chosen again (a code), each of the places has options, so there are ways.
Combinations. You can choose of different objects, with the order not mattering (a team), in
ways. This is divided by , because each group of objects appears in orders. The number is also written , read “n choose r”, and called a binomial coefficient.
Properties. and . Choosing the objects you take is the same as choosing the you leave, so
The numbers make up Pascal’s triangle, in which each number is the sum of the two above it:
Which count? Ask the two questions from the start:
- the order matters and objects can repeat (a code): ,
- the order matters and nothing repeats (a podium): ,
- the order does not matter and nothing repeats (a team): .
Example 1: even numbers with different digits
How many three-digit even numbers have three different digits?
Step 1. Split by the last digit
The last digit must be even, and the first digit cannot be 0. Both rules involve 0, so we take two cases: the number ends in 0, or it ends in 2, 4, 6 or 8.
Step 2. Count the numbers ending in 0
With 0 at the end, the first digit can be any of the 9 others, and the middle digit any of the 8 still unused.
Step 3. Count the numbers ending in 2, 4, 6 or 8
We choose the most restricted digits first. The last digit has 4 options. The first digit can be neither 0 nor the last digit, which leaves 8. The middle digit can be any of the 8 digits not used yet, 0 included.
Step 4. Add the two cases
A number ends in 0 or it does not, so the cases do not overlap and we add them.
Answer
There are 328 such numbers. The product rule counts each case, and the sum rule adds the two cases together.
Example 2: officers and a delegation
A club has 10 members. In how many ways can it choose a president, a vice-president and a treasurer? And in how many ways can it choose a delegation of 3 members?
Step 1. Choose the officers one at a time
The roles are different, so the order matters. The president can be any of the 10 members, the vice-president any of the 9 others, and the treasurer any of the 8 left.
Step 2. Count the orders of one delegation
A delegation has no roles. The same three people appear among the 720 lists of officers in every one of their orders.
Step 3. Divide by the number of orders
Each delegation has been counted 6 times, so we divide.
Answer
The officers can be chosen in 720 ways and the delegation in 120 ways. There are fewer delegations, because the order of their members does not matter.
Your turn
A bag holds 5 red balls and 4 blue balls. You take out 3 balls at once. In how many ways can you get exactly 2 red balls?
Hintshow
Choose the red balls and the blue ball separately, then use the product rule.
Solutiontry it on your own first
Step 1. Choose the two red balls
The order does not matter, so we choose 2 of the 5 red balls.
Step 2. Choose the blue ball
The third ball must be blue, so we choose 1 of the 4 blue balls.
Step 3. Multiply the two choices
Every pair of red balls can go with every blue ball, so we multiply.
Answer
There are 40 ways to take out exactly 2 red balls.
Common mistakes
- Adding instead of multiplying. 3 shirts and 4 pairs of trousers give outfits, not . Multiply when the steps come one after another, and add only when the cases exclude each other.
- Ignoring the order, or counting it when it does not matter. A podium of 3 from 10 people can be filled in 720 ways, a team of 3 in 120. Divide by only when the order does not matter.
- Forgetting repetition. The digits of a 4-digit PIN can repeat, so there are PINs, not .
- A zero in front. A three-digit number cannot start with 0, so there are of them, not 1000.
- Cases that overlap. With the sum rule, each result must belong to exactly one case, or it is counted twice.
In exams and at university
In England, GCSE Mathematics asks you to list outcomes systematically, with tables, grids, Venn diagrams and tree diagrams, and to use the product rule for counting. A level Mathematics uses the notations and in the binomial expansion of and in the binomial distribution.
In the United States, the Common Core high-school standards ask students to use permutations and combinations to work out probabilities of compound events. The standard is marked (+), as one for courses that go further.
At university, counting opens discrete mathematics and probability. In the open textbook Discrete Mathematics: An Open Introduction by Oscar Levin, for example, the first chapter covers the additive and multiplicative principles, binomial coefficients, and combinations and permutations.
Check yourself
Test yourself
A café offers 3 starters, 4 main courses and 2 desserts. How many different three-course meals can you order?
A PIN has 4 digits from 0 to 9, and the digits may repeat. How many PINs are there?
In how many orders can 5 different books stand on a shelf?
Two of the 7 students in a group will be on duty this week. How many different pairs are possible?
Why do you divide by when the order does not matter?
Flashcards for review
Flip a card and say whether you knew the answer. The ones you did not know come back at the end of the deck. Why it pays to come back to them in a few days is explained in the guide Spaced repetition.
Flashcards
Question
Answer
What does the product rule say?
If a choice is made in steps, and each step has the same number of options whatever happened before, multiply those numbers. 3 shirts and 4 pairs of trousers give outfits.When do you add the numbers of ways instead of multiplying them?
When the results split into cases that do not overlap (the sum rule). Each result must belong to exactly one case.What is ?
, the number of ways to put different objects in a row. By convention .How many codes of length can you make from symbols, if symbols may repeat?
: each of the places has options. A 4-digit PIN: .In how many ways can you choose of different objects in order, with no repeats?
. A podium of 3 from 10 people: .In how many ways can you choose of different objects when the order does not matter?
. A delegation of 3 from 10 people: 120.Why is equal to divided by ?
Among the ordered selections, each group of objects appears in all its orders. Dividing by counts each group once.Why is ?
Choosing the objects you take is the same as choosing the objects you leave.Which two questions tell you which count to use?
Does the order matter? Can an object be chosen again? A code: order and repeats, . A podium: order, no repeats, . A team: no order, no repeats, .How is Pascal’s triangle built?
Its numbers are the binomial coefficients , and each one is the sum of the two above it: .
Sources
We checked the facts on this page against these sources. All of them may be reused freely: they carry an open licence or are not covered by copyright.
- David Lippman - Math in Society, chapter Probability (the multiplication principle for counting, factorials, permutations nPr = n!/(n − r)!, combinations nCr = nPr/rPr, whether the order matters) (PDF) · CC BY-SA 4.0
- Oscar Levin - Discrete Mathematics: An Open Introduction (2nd edition), 1.1 Additive and Multiplicative Principles (the additive principle needs cases that do not overlap) · CC BY-SA 4.0
- Oscar Levin - Discrete Mathematics: An Open Introduction (2nd edition), 1.2 Binomial Coefficients (n choose k, Pascal's rule and Pascal's triangle, 5 · 4 · 3 = 60 divided by 3! gives 10) · CC BY-SA 4.0
- Oscar Levin - Discrete Mathematics: An Open Introduction (2nd edition), 1.3 Combinations and Permutations (n!, 0! = 1, k-permutations n!/(n − k)!) · CC BY-SA 4.0
- Mitchel T. Keller and William T. Trotter - Applied Combinatorics, 2.3 Combinations (the number of k-element subsets, C(n, k) = P(n, k)/k!) · CC BY-SA 4.0
- Wikipedia - Rule of product (the multiplication principle) · CC BY-SA 4.0
- Wikipedia - Addition principle (the rule of sum for cases that do not overlap) · CC BY-SA 4.0
- Wikipedia - Binomial coefficient (n choose k, nC0 = nCn = 1, the symmetry nCr = nC(n − r)) · CC BY-SA 4.0
- Wikipedia - Pascal's triangle (each entry is the sum of the two above it) · CC BY-SA 4.0