Skip to content
EN - Language: English
MathematicsHigh school

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?

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 mm ways and the second in nn ways, whatever happened in the first, then the two steps together can be done in m⋅nm \cdot n ways. Three shirts and four pairs of trousers give 3⋅4=123 \cdot 4 = 12 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.

ABCD

first draw: 4 options

ball drawn

Step 1 of 6
Steps of the animation. Arrow keys move between steps.

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, nn, and the number you take out, rr. The boxes show how many options each draw has, and the list shows every result when there are not too many of them.

How you draw

One ball at a time, and no ball goes back: order matters, but no ball comes twice.

n = 4
r = 2

The bag

  • A
  • B
  • C
  • D

Options for each draw

  1. draw 1: 4
  2. 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 rr draws from nn balls has nrn^r results, because every box holds nn,
  • on a podium each box holds one less than the box before it, because a ball cannot come back,
  • with r=nr = n the podium puts every ball in order, so there are n!n! ways,
  • a team is the podium divided by r!r!, and taking rr balls gives as many teams as taking n−rn - r balls: the balls you leave behind make a team too.

Definitions and formulas

The product rule. A choice is made in kk steps, and step ii has mim_i options whatever happened before it. Then the whole choice can be made in

m1⋅m2⋅…⋅mkm_1 \cdot m_2 \cdot \ldots \cdot m_k

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 n≥1n \geq 1

n!=1⋅2⋅…⋅nn! = 1 \cdot 2 \cdot \ldots \cdot n

and by convention 0!=10! = 1. For example 3!=63! = 6, 4!=244! = 24 and 5!=1205! = 120.

Permutations. You can put nn different objects in a row in n!n! ways. There are nn options for the first place, n−1n - 1 for the second, and so on down to 1 for the last.

Ordered selections without repetition. You can choose rr of nn different objects in order (a podium) in

nPr=n(n−1)⋯(n−r+1){}^nP_r = n(n - 1) \cdots (n - r + 1)

ways. That is rr factors, each one less than the one before. With factorials it reads

nPr=n!(n−r)!{}^nP_r = \frac{n!}{(n - r)!}

Ordered selections with repetition. If an object can be chosen again (a code), each of the rr places has nn options, so there are nrn^r ways.

Combinations. You can choose rr of nn different objects, with the order not mattering (a team), in

nCr=n!r! (n−r)!{}^nC_r = \frac{n!}{r!\,(n - r)!}

ways. This is nPr{}^nP_r divided by r!r!, because each group of rr objects appears in r!r! orders. The number nCr{}^nC_r is also written (nr)\binom{n}{r}, read “n choose r”, and called a binomial coefficient.

Properties. nC0=nCn=1{}^nC_0 = {}^nC_n = 1 and nC1=n{}^nC_1 = n. Choosing the rr objects you take is the same as choosing the n−rn - r you leave, so

(nr)=(nn−r)\binom{n}{r} = \binom{n}{n - r}

The numbers (nr)\binom{n}{r} make up Pascal’s triangle, in which each number is the sum of the two above it:

(nr)=(n−1r−1)+(n−1r)\binom{n}{r} = \binom{n - 1}{r - 1} + \binom{n - 1}{r}

Which count? Ask the two questions from the start:

  • the order matters and objects can repeat (a code): nrn^r,
  • the order matters and nothing repeats (a podium): nPr{}^nP_r,
  • the order does not matter and nothing repeats (a team): nCr{}^nC_r.

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.

ends in 0ends in 2,4,6,8\begin{aligned} &\text{ends in } 0 \\ &\text{ends in } 2, 4, 6, 8 \end{aligned}

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.

9⋅8=729 \cdot 8 = \boxed{72}

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.

4⋅8⋅8=2564 \cdot 8 \cdot 8 = \boxed{256}

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.

72+256=32872 + 256 = 328

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.

10P3=10⋅9⋅8=720\begin{aligned} {}^{10}P_3 &= 10 \cdot 9 \cdot 8 \\ &= \boxed{720} \end{aligned}

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.

3!=3⋅2⋅1=63! = 3 \cdot 2 \cdot 1 = \boxed{6}

Step 3. Divide by the number of orders

Each delegation has been counted 6 times, so we divide.

10C3=7206=120\begin{aligned} {}^{10}C_3 &= \frac{720}{6} \\ &= 120 \end{aligned}

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.

(52)=5⋅42=10\binom{5}{2} = \frac{5 \cdot 4}{2} = \boxed{10}

Step 2. Choose the blue ball

The third ball must be blue, so we choose 1 of the 4 blue balls.

(41)=4\binom{4}{1} = \boxed{4}

Step 3. Multiply the two choices

Every pair of red balls can go with every blue ball, so we multiply.

10⋅4=4010 \cdot 4 = 40

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 3⋅4=123 \cdot 4 = 12 outfits, not 3+4=73 + 4 = 7. 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 r!r! only when the order does not matter.
  • Forgetting repetition. The digits of a 4-digit PIN can repeat, so there are 104=10,00010^4 = 10{,}000 PINs, not 10⋅9⋅8⋅7=504010 \cdot 9 \cdot 8 \cdot 7 = 5040.
  • A zero in front. A three-digit number cannot start with 0, so there are 9⋅10⋅10=9009 \cdot 10 \cdot 10 = 900 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 n!n! and nCr{}^nC_r in the binomial expansion of (a+bx)n(a + bx)^n 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 r!r! 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

  1. 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 3⋅4=123 \cdot 4 = 12 outfits.
  2. 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.
  3. What is n!n!?

    n!=1⋅2⋅…⋅nn! = 1 \cdot 2 \cdot \ldots \cdot n, the number of ways to put nn different objects in a row. By convention 0!=10! = 1.
  4. How many codes of length rr can you make from nn symbols, if symbols may repeat?

    nrn^r: each of the rr places has nn options. A 4-digit PIN: 104=10,00010^4 = 10{,}000.
  5. In how many ways can you choose rr of nn different objects in order, with no repeats?

    nPr=n(n−1)⋯(n−r+1)=n!(n−r)!{}^nP_r = n(n - 1) \cdots (n - r + 1) = \frac{n!}{(n - r)!}. A podium of 3 from 10 people: 10⋅9⋅8=72010 \cdot 9 \cdot 8 = 720.
  6. In how many ways can you choose rr of nn different objects when the order does not matter?

    nCr=(nr)=n!r! (n−r)!{}^nC_r = \binom{n}{r} = \frac{n!}{r!\,(n - r)!}. A delegation of 3 from 10 people: 120.
  7. Why is nCr{}^nC_r equal to nPr{}^nP_r divided by r!r!?

    Among the ordered selections, each group of rr objects appears in all its r!r! orders. Dividing by r!r! counts each group once.
  8. Why is (nr)=(nn−r)\binom{n}{r} = \binom{n}{n - r}?

    Choosing the rr objects you take is the same as choosing the n−rn - r objects you leave.
  9. Which two questions tell you which count to use?

    Does the order matter? Can an object be chosen again? A code: order and repeats, nrn^r. A podium: order, no repeats, nPr{}^nP_r. A team: no order, no repeats, nCr{}^nC_r.
  10. How is Pascal’s triangle built?

    Its numbers are the binomial coefficients (nr)\binom{n}{r}, and each one is the sum of the two above it: (nr)=(n−1r−1)+(n−1r)\binom{n}{r} = \binom{n - 1}{r - 1} + \binom{n - 1}{r}.

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.

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. Wikipedia - Rule of product (the multiplication principle) · CC BY-SA 4.0
  7. Wikipedia - Addition principle (the rule of sum for cases that do not overlap) · CC BY-SA 4.0
  8. Wikipedia - Binomial coefficient (n choose k, nC0 = nCn = 1, the symmetry nCr = nC(n − r)) · CC BY-SA 4.0
  9. Wikipedia - Pascal's triangle (each entry is the sum of the two above it) · CC BY-SA 4.0

More explainers