Skip to content
Combinatorics · Chapter 1

Permutations

How many ways can you line things up? Fill the slots one at a time and multiply the choices.

You'll need

Nothing! This is where it all starts. If you can multiply, you're ready.

open on YouTube
1.10%

Permutations Definition

In this section you will be able to count arrangements by filling slots one at a time and multiplying the choices.

Your bike lock has 3 dials, and each dial shows a digit from 0 to 9. How many codes would a thief have to try? Guess first: is it 30? 100? 1000?

When the order of things matters, we call each arrangement a permutation. The big idea of this chapter is simple: fill the slots one at a time, and multiply the number of choices for each slot.

Exploreplay first, formulas later

3 slots: 10 × 10 × 10 = 1,000 passwords

1st digit
?
choices for 1st digit10
choices
2nd digit
?
choices for 2nd digit10
choices
3rd digit
?
choices for 3rd digit10
choices
10 × 10 × 10 = 1,000 passwords
Tree diagram: every path is one of the 1,000 passwords
01+8 more001+8 more1+8 more001+8 more001+8 more1+8 more1+8 more

Each level is one slot. For each branch, the next slot has the same number of choices, so the leaves multiply: 10×10×10=1,00010 \times 10 \times 10 = 1{,}000.

10 × 10 × 10 = 1,000 passwords

Name it

Definition 1.1.1

A permutation is a possible arrangement of objects in a set where the order of the objects matters.

Watch itpredict, then reveal

Example 1.1

How many 3-digit passwords are possible where each digit is a number from 0 to 9?

1 slot: 10 = 10 passwords

1st digit
?
choices for 1st digit10
choices
10 = 10 passwords
Tree diagram: every path is one of the 10 passwords
01+8 more

Each level is one slot. For each branch, the next slot has the same number of choices, so the leaves multiply: 10=1010 = 10.

10 = 10 passwords

  1. 1

    First, how many 1-digit passwords are there?

    Predict first:

Try it

Problem 1.6.2

How many 3-digit numbers exist with all odd digits?

Problem 1.6.3

How many 3-digit numbers exist with all even digits?

Contest cornerreal contest problems

Problem 1.6.12

AMC 8

A special type of license plate includes 3 distinct letters at the beginning and 4 single-digit numbers after. How many such license plates exist?

Checkpoint for section 1.1

Get 2 of 3 right to master this section. One try each, no hints.
1

A lock has 4 dials, each with the digits 0 to 9. How many different codes are possible?

2

Mia has 3 shirts, 4 pairs of shorts and 2 hats. How many outfits of one shirt, one pair of shorts and one hat can she make?

3

A coin is flipped 5 times and each result (H or T) is written down in order. How many different lists are possible?

1.20%

Factorials

In this section you will be able to count the ways to line up n different things with n!, and know 0! to 6! by heart.

Sohil has 4 different wrapping papers and must use all of them, one layer on top of another. Unlike passwords, he can’t use the same paper twice. What changes?

Each time you use something up, the next slot has one fewer choice. Multiplying 4×3×2×14 \times 3 \times 2 \times 1 comes up so often that it gets its own name and symbol: 4!4!, said “4 factorial”.

Exploreplay first, formulas later

4 books: 4 × 3 × 2 × 1 = 24 orders

books4
Pile: click a book to put it in the next spot
Shelf
4
3
2
1

The number under each spot is how many choices it had.

Place the first book…
Memorise these: 0! to 6!

Why is 0! = 1? There is exactly one way to arrange nothing: do nothing.

0 of 4 placed. Next spot has 4 choices.

Name it

Definition 1.2.1 · Factorials

A factorial is the product of all positive integers less than or equal to a given positive integer. In other words,

n!=n×(n−1)×(n−2)×⋯×1.n! = n \times (n-1) \times (n-2) \times \cdots \times 1.

Remark 1.2.2

For math competitions, memorise these factorials. It will save you a lot of time:

0!0! 1!1! 2!2! 3!3! 4!4! 5!5! 6!6!
11 11 22 66 2424 120120 720720

Use the flash-card mode in the widget above to practise them.

Definition 1.2.3

Reminder: a permutation is a possible arrangement of objects in a set where the order of the objects matters. Lining up all nn objects is the biggest permutation of all.

Theorem 1.2.4

The number of ways of arranging nn distinct objects is just

n!=n×(n−1)×(n−2)×⋯×1.n! = n \times (n-1) \times (n-2) \times \cdots \times 1.

Watch itpredict, then reveal

Example 1.2

Sohil has 1 wrapping paper in each of 4 different colours: red, orange, green and blue. He needs to wrap all of them around a box in any order. How many ways are there for him to do this?

4 wrapping papers: 4 × 3 × 2 × 1 = 24 orders

wrapping papers4
Pile: click a wrapping paper to put it in the next layer
Shelf
4
3
2
1

The number under each layer is how many choices it had.

Place the first wrapping paper…
Memorise these: 0! to 6!

Why is 0! = 1? There is exactly one way to arrange nothing: do nothing.

0 of 4 placed. Next layer has 4 choices.

  1. 1

    Start with the innermost layer. How many ways are there to choose a colour for this layer?

    Predict first:

Example 1.3

Find the number of ways to arrange 4 different books on a bookshelf.

4 books: 4 × 3 × 2 × 1 = 24 orders

books4
Pile: click a book to put it in the next spot
Shelf
4
3
2
1

The number under each spot is how many choices it had.

Place the first book…
Memorise these: 0! to 6!

Why is 0! = 1? There is exactly one way to arrange nothing: do nothing.

0 of 4 placed. Next spot has 4 choices.

  1. 1

    How many choices are there for the first book on the shelf?

    Predict first:

Example 1.4

There are 4 different AMC 8 videos. Every student in the class watches the videos in a different order. What is the maximum number of students in the class?

4 videos: 4 × 3 × 2 × 1 = 24 orders

videos4
Pile: click a video to put it in the next watch
Shelf
4
3
2
1

The number under each watch is how many choices it had.

Place the first video…
Memorise these: 0! to 6!

Why is 0! = 1? There is exactly one way to arrange nothing: do nothing.

0 of 4 placed. Next watch has 4 choices.

  1. 1

    Every student watches all 4 videos. What are we really counting?

    Predict first:
open on YouTube

Try it

Problem 1.6.8

Find the number of ways to arrange 5 different books on a bookshelf.

Contest cornerreal contest problems

Problem 1.6.15

AMC 8

The Dragonvale Middle School chess team consists of two boys and three girls. A photographer wants to take a picture of the team to appear in the local newspaper. She decides to have them sit in a row with a boy at each end and the three girls in the middle. How many such arrangements are possible?

Problem 1.6.16

AMC 8

Professor Chang has nine different language books lined up on a bookshelf: two Arabic, three German, and four Spanish. How many ways are there to arrange the nine books on the shelf keeping the Arabic books together and keeping the Spanish books together?

Checkpoint for section 1.2

Get 2 of 3 right to master this section. One try each, no hints.
1

What is 5!5!?

2

In how many different orders can 6 runners finish a race if there are no ties?

3

What is 8!6!\dfrac{8!}{6!}?

1.30%

Permutations Fundamentals

In this section you will be able to count ordered choices of k things out of n with the permutations formula.

A club of 7 people needs a president, a vice president and a secretary. Being president is not the same job as being secretary, so the order of picking matters. How many ways can the club fill the jobs?

This time we stop early: we only fill 3 positions, not all 7. So we multiply just the first 3 numbers of the countdown.

Exploreplay first, formulas later

Choose 3 of 7 in order: 7 × 6 × 5 = 210

people n7
places k3
?
7choices
President
?
6choices
Vice president
?
5choices
Secretary
7 × 6 × 5 = 210 ways

President: 7 people to choose from

Name it

Theorem 1.3.1 · Permutations Formula

The number of ways to order kk objects out of nn total objects is

nPk=n!(n−k)!=n×(n−1)×(n−2)×⋯×(n−(k−1)).{}^{n}P_{k} = \frac{n!}{(n-k)!} = n \times (n-1) \times (n-2) \times \cdots \times (n-(k-1)).

Watch itpredict, then reveal

Example 1.5

Sam has 5 different stamps and is making a Christmas card where he puts 3 different stamps in a line. How many different Christmas card designs can he make?

Choose 3 of 5 in order: 5 × 4 × 3 = 60

people n5
places k3
?
5choices
Stamp 1
?
4choices
Stamp 2
?
3choices
Stamp 3
5 × 4 × 3 = 60 ways

Stamp 1: 5 people to choose from

  1. 1

    How many choices are there for the first stamp in the line?

    Predict first:
open on YouTube

Example 1.6

Evaluate 7P3{}^{7}P_{3}.

Choose 3 of 7 in order: 7 × 6 × 5 = 210

people n7
places k3
?
7choices
President
?
6choices
Vice president
?
5choices
Secretary
7 × 6 × 5 = 210 ways
7P3=7!(7−3)!=7!4!{}^{7}P_{3} = \dfrac{7!}{(7-3)!} = \dfrac{7!}{4!}
7654321
4321

President: 7 people to choose from

  1. 1

    Compare 7P3{}^{7}P_{3} with the formula nPk{}^{n}P_{k}. What are nn and kk?

    Predict first:

Example 1.7

Find the number of ways of selecting a president, vice president, and secretary from a group of 7 people.

Choose 3 of 7 in order: 7 × 6 × 5 = 210

people n7
places k3
?
7choices
President
?
6choices
Vice president
?
5choices
Secretary
7 × 6 × 5 = 210 ways

President: 7 people to choose from

  1. 1

    How can we approach the problem?

Try it

Problem 1.6.1

Evaluate 6P3{}^{6}P_{3} and 7P2{}^{7}P_{2}.

Problem 1.6.5

If you have Alice, Betty, and Chase and you need to choose two of them to be the president and vice president of the math club, how many ways are there to do this?

Problem 1.6.6

Find the number of ways of selecting a president, vice president, and secretary from a group of 8 people.

Problem 1.6.9

How many ways are there to pick your favorite and second favorite book amongst 5 books?

Problem 1.6.10

There are 10 students at a math contest. How many ways are there to select the first, second, and third place winners?

Problem 1.6.13

There is a school race with 12 students. How many different ways are there to award the gold, silver, and bronze medals if no ties are possible?

Checkpoint for section 1.3

Get 2 of 3 right to master this section. One try each, no hints.
1

Evaluate 6P2{}^{6}P_{2}.

2

A club of 9 students picks a captain and a co-captain. How many ways can it do this?

3

How many 3-letter "words" with all different letters can be made from A, B, C, D, E? (They don't have to be real words.)

1.40%

Digit Permutations

In this section you will be able to count numbers with digit rules, starting with the most restrictive digit.

Passwords, licence plates, phone numbers: all “fill in the slots” problems. But numbers have a trap: the first digit can’t be 0.

Digit problems come with rules: odd, even, all different, no leading zero. The trick is to fill the pickiest slot first, so every slot’s number of choices stays fixed.

Look:if a slot’s number of choices depends on what you picked earlier, change the order you fill the slots in.

Exploreplay first, formulas later

4-digit numbers, distinct digits: 9 × 9 × 8 × 7 = 4,536

digits4
1st digit
9
choices
2nd digit
9
choices
3rd digit
8
choices
4th digit
7
choices
9 × 9 × 8 × 7 = 4,536
Computer check (listing every one): 4,536e.g. 4136

9 × 9 × 8 × 7 = 4,536

Name it

Remark 1.4.1

Generally, in these problems we want to handle the most restrictive conditions first. In Example 1.8, if we started at the units digit, we would have trouble counting the options for the thousands digit (is 0 already used or not?). Then we would need casework, a more advanced technique that comes in a later chapter.

Watch itpredict, then reveal

Example 1.8

How many 4-digit numbers have all digits distinct?

4-digit numbers, distinct digits: 9 × 9 × 8 × 7 = 4,536

digits4
1st digit
9
choices
2nd digit
9
choices
3rd digit
8
choices
4th digit
7
choices
9 × 9 × 8 × 7 = 4,536
Computer check (listing every one): 4,536e.g. 6705

9 × 9 × 8 × 7 = 4,536

  1. 1

    For the first digit, how many choices do we have?

    Predict first:

Example 1.9

How many 4-digit numbers exist such that the first digit is odd and the other 3 digits are even and all digits distinct?

4-digit numbers, distinct digits: 5 × 5 × 4 × 3 = 300

digits4
1st digit
5
choices
2nd digit
5
choices
3rd digit
4
choices
4th digit
3
choices
5 × 5 × 4 × 3 = 300
Computer check (listing every one): 300e.g. 9260

5 × 5 × 4 × 3 = 300

  1. 1

    How many choices are there for the first digit? For the 2nd digit?

    Predict first:

Example 1.10

How many 5-digit palindromes are there? A palindrome is a number that reads the same forward and backward.

5-digit numbers, palindromes: 9 × 10 × 10 × 1 × 1 = 900

digits5
1st digit
9
choices
2nd digit
10
choices
3rd digit
10
choices
4th digit
1
copy of 2nd
5th digit
1
copy of 1st
9 × 10 × 10 × 1 × 1 = 900
Computer check (listing every one): 900e.g. 16561

9 × 10 × 10 × 1 × 1 = 900

  1. 1

    A 5-digit palindrome looks like ABCBAABCBA. Which digits can you choose freely?

    Predict first:
open on YouTube

Example 1.11

Omega Learn

How many 6-digit numbers exist such that all the digits are distinct, the first 2 digits are 6 or more, the last 2 digits are 5 or less, and the 3rd digit is a nonzero multiple of 7?

6-digit numbers, distinct digits: choices depend on earlier digits; listing them all gives 900

digits6
1st digit
4
choices
2nd digit
3
choices
3rd digit
?
it depends (0–1)
4th digit
7
choices
5th digit
?
it depends (5–6)
6th digit
?
it depends (4–5)
It depends! Some slots change with earlier picks.
Computer check (listing every one): 900e.g. 687301

Look: when you fill the slots in this order, the number of choices for some slot changes depending on what you picked before. Try filling the most restrictive slot first.

It depends: some slots' choices change with earlier digits. Listing all gives 900.

  1. 1

    Which digit is the most restrictive? How many choices does it have?

    Predict first:
open on YouTube

Try it

Problem 1.6.4

How many 3-digit odd numbers are there with distinct digits?

Problem 1.6.7

Find the number of 3-digit numbers with all of its digits distinct.

Problem 1.6.11

How many 4-digit numbers are not palindromes? A palindrome is a number that reads the same forward and backward.

Contest cornerreal contest problems

Problem 1.6.14

AMC 8

How many integers between 1000 and 9999 have four distinct digits?

Checkpoint for section 1.4

Get 2 of 3 right to master this section. One try each, no hints.
1

How many 2-digit numbers have two different digits?

2

How many 3-digit numbers have all odd digits, all different?

3

How many 3-digit palindromes are there?

1.50%

Circular Arrangements

In this section you will be able to count seatings around a round table, where turning the table doesn't make a new seating.

Five friends sit around a round pizza table. If everyone shifts one seat to the left, is that a new seating? Everyone still has the same neighbours, so no!

At a round table, only who sits next to whom matters. The trick: fix one person in place and arrange everyone else around them.

Exploreplay first, formulas later

5 people around a table, rotations the same: (5−1)! = 24

people5
Alex seat 1Bob seat 2Cara seat 3Dev seat 4Eli seat 5
120 ÷ 5 = 24

120 ways to line 5 people up in seats 1–5, but each table is counted 5 times (once per rotation).

Press Rotate. Does anyone get a new left or right neighbour?

Tip: click (or press Enter on) one seat, then another, to swap the two people.

120 line-ups ÷ 5 rotations = 24 seatings

Name it

Theorem 1.5.1 · Circular Arrangements

The number of ways of arranging nn objects in a circle, where rotations of the same arrangement aren't considered distinct, is

(n−1)!(n-1)!

If reflections (mirror images) of the same arrangement aren't considered distinct either, it is

(n−1)!2.\frac{(n-1)!}{2}.

Watch itpredict, then reveal

Example 1.12

How many ways are there to arrange 5 people in a circle if rotations are not counted as distinct orientations?

5 people around a table, rotations the same: (5−1)! = 24

people5
Alex seat 1Bob seat 2Cara seat 3Dev seat 4Eli seat 5
120 ÷ 5 = 24

120 ways to line 5 people up in seats 1–5, but each table is counted 5 times (once per rotation).

Press Rotate. Does anyone get a new left or right neighbour?

Tip: click (or press Enter on) one seat, then another, to swap the two people.

120 line-ups ÷ 5 rotations = 24 seatings

  1. 1

    When people sit in a circle, what trick takes care of rotations?

Example 1.13

Omega Learn

How many ways are there to arrange 5 people around a circle such that 2 of the people, Alex and Bob, must sit next to each other? Note that rotations are not counted as distinct orientations.

5 people around a table with rules (rotations the same): 12 seatings out of 24

people5
Alex seat 1Bob seat 2Cara seat 3Dev seat 4Eli seat 5
This seating follows the rules.
12 good seatings

Counted by listing every seating with Alex pinned to the top. Must sit together: Alex & Bob.

Tip: click (or press Enter on) one seat, then another, to swap the two people.

This seating follows the rules. 12 valid seatings.

  1. 1

    Glue Alex and Bob together into one block. How many "units" sit around the table now?

    Predict first:
open on YouTube

Example 1.14

Omega Learn

Gauss, Pauli, Einstein, Newton, Edison, and Faraday are sitting at a circular table. Einstein, Newton, and Faraday are enemies, so they refuse to sit next to each other. With this condition, how many ways are there for the 6 physicists to sit at the table if rotations are not counted as distinct orientations?

6 people around a table with rules (rotations the same): 12 seatings out of 120

people6
Gauss seat 1Pauli seat 2Einst enemyNewto enemyEdiso seat 5Farad enemy
Uh-oh: two enemies are sitting side by side.
12 good seatings

Counted by listing every seating with Gauss pinned to the top. Enemies: Einstein, Newton, Faraday.

Neighbours now: some enemies touch.

Tip: click (or press Enter on) one seat, then another, to swap the two people.

This seating breaks a rule. 12 valid seatings.

The enemies are Einstein, Newton and Faraday. Swap seats to find a seating where no two enemies touch.
  1. 1

    Without the enemy rule, how many seatings are there?

    Predict first:

Contest cornerreal contest problems

Problem 1.6.19

Omega Learn Math Competition

Alice, Bob, Claire, Dave, and Emma are sitting around a round table. Alice refuses to sit next to Bob. How many different ways can they sit around the table? (Rotations of the same arrangement are not considered different.)

Checkpoint for section 1.5

Get 2 of 3 right to master this section. One try each, no hints.
1

In how many ways can 6 friends sit around a round table if rotations count as the same?

2

In how many ways can 5 different beads be put on a bracelet, if turning or flipping the bracelet does not make a new bracelet?

3

In how many ways can 4 people sit around a round table if rotations count as the same?

1.6

Practice Problems

In this section you will be able to mix every trick from this chapter on contest problems.

Time to mix it all up! These problems use slots, factorials, the permutations formula, digit rules and round tables, sometimes all at once. Every problem has three hints if you get stuck.

Want every problem from this chapter on one page? Open the problem set.

Mixed practice

Problem 1.6.20(additional)

Omega Learn

7 people are lining up for a photograph. If the 2 tallest people must be at the 1st and 7th positions in any order and the shortest person must be in the center, how many ways are there for them to line up?

Contest cornerreal contest problems

Problem 1.6.17

MATHCOUNTS

How many permutations of the digits 1, 2, 3, 4 have 1 before 3 and 2 before 4? One such permutation is 2134.

Problem 1.6.18

AMC 10

Alice refuses to sit next to either Bob or Carla. Derek refuses to sit next to Eric. How many ways are there for the five of them to sit in a row of 5 chairs under these conditions?

Problem 1.6.21(additional)

EMCC 2014

Five distinct boys and four distinct girls are going to have lunch together around a table. They decide to sit down one by one under the following conditions: no boy will sit down when more boys than girls are already seated, and no girl will sit down when more girls than boys are already seated. How many possible sequences of taking seats exist?