Skill stop · How is this move done?

Counting

In the Chinese book: 计数

Steps multiply, cases add; divide out repeats, subtract overlaps.

WorkbenchDon't calculate yet. Press “Grow the next level” and watch. Each time the tree grows a level, how many times as many leaves are there? Then change the number of options at each step with − and +.

Loading figure…

What this move does

Counting has just one rule: count every object exactly once. Miss nothing, and count nothing twice. Four tools are enough:

  1. If a job is done in steps, one after another, multiply the numbers of choices at each step (the multiplication principle). In the tree above, each new level multiplies the number of leaves.
  2. If a job splits into cases that do not overlap, add the counts of the cases (the addition principle).
  3. If every object has been counted times, divide the total by .
  4. If the cases overlap, subtract what was counted too often (inclusion–exclusion).

Predict first

To get to the museum you can take a bus (any of routes) or the metro (any of lines). When you arrive, you go in through one of entrances. How many ways are there in all?

Choose an answer first; then you can see the result.

Work through one: standing in line

Choose of the people A, B, C, D and line them up for a photo. How many different lineups are there?

Example: choose 3 of 4 people and line them up

Step 1 / 5
Loading figure…
  1. Break the job into steps

    The line has three places. First decide who stands on the left, then in the middle, finally on the right. These are steps, so we multiply. Right now the tree is just a root.

Look again at the reason for step 2. Which people you can choose depends on step 1 (if A is on the left, the middle is B, C or D), but how many you can choose is always . The multiplication principle only needs the number to stay the same.

(The Chinese book writes the number of permutations of out of as ; many English books write or .)

Counted too often: divide

What if you just choose people for cleaning duty, and order does not matter? “A, B” and “B, A” are the same pair.

Below, the left side shows every ordered lineup and the right side shows the truly different groups. Tap any card to see how many “twins” it has on the left.

Loading figure…
Every group appears exactly times on the left, so the number of groups is . Change “Choose” to : how many times does each group appear now?

Predict first

Choose of people to form a group (order does not matter). There are ordered lineups. How many groups are there?

groups
Choose an answer first; then you can see the result.

The same idea handles people “sitting in a circle”. people sit around a round table, and rotating everyone counts as the same seating:

Loading figure…
With numbered seats there are seatings. Rotating a round-table seating times gives different cards, so there are seatings.

Counting routes through the streets

Walk from A to B, moving only right or up. A route to any crossing makes its last step either from the left or from below. The two cases do not overlap, so

Predict first

Start with a small one: a block of streets squares wide and squares high. Going from the bottom-left corner to the top-right corner (only right or up), how many routes are there?

routes
Choose an answer first; then you can see the result.

Here is another way to see it. On a grid squares wide and high, every route takes exactly steps, and of them go up. Once you choose which steps go up, the route is fixed, so the number of routes is : the same answer as adding square by square.

Example: one crossing in the middle is closed for roadwork

Step 1 / 5
Loading figure…
  1. Write 0 at the roadblock

    Crossing is closed: no route through it counts, so its number is . The bottom row and the left column are still all .

Counted too much: subtract

How many numbers from to are a multiple of or a multiple of ? The two cases overlap, and adding them directly counts the overlap twice.

In the picture below, choose “add” or “subtract” for each term. The small tag next to a number tells you how many times it is counted right now. The goal: every number inside the circles is counted exactly once.

Loading figure…
Start by adding just and , and see which numbers get counted times.

With three sets there is one more layer. Try it yourself first:

Predict first

How many numbers from to are a multiple of at least one of , , ?

Choose an answer first; then you can see the result.

When it fails

“Counted too often, so divide” needs one thing: every object must be counted the same number of times.

Break it

Counterexample lab: remove one condition

Conclusion: total ÷ number of repeats = the true count

Make three-letter “words” from the letters A, A, B. First treat the two A's as different, A₁ and A₂: there are orders. Each word is counted times, so there are words.

Loading figure…

Practice

Exercise 1Basic

A school lunch combo is one of main dishes, one of soups and one of fruits. How many different combos are there?

Exercise 2Basic

teams play a round robin (every two teams play each other exactly once). How many games are played in all?

Exercise 3Advanced

On a grid of streets squares wide and high, walk from the bottom-left corner A to the top-right corner B, moving only right or up. Crossing is closed for roadwork and cannot be used. How many routes are there?

Exercise 4Advanced

How many numbers from to are neither a multiple of nor a multiple of ?

Exercise 5Challenge

Using the digits without repeating any digit, how many three-digit even numbers can you make?

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Adding when you should multiply

The wrong step: tops and pairs of pants; you pick one of each, so there are outfits.
What went wrong? Think first, then open

Diagnosis Choosing a top and choosing pants are things you do one after the other: every top can go with each of the pairs of pants. You only add when the cases are “either this or that”.

The right step: Draw a tree: branches on the first level, each splitting into more, so there are leaves.

“Steps multiply, cases add. First ask yourself: “and then” or “or”?”

Exhibit

Counting every handshake twice

The wrong step: people each shake hands once with everyone else. Each person shakes hands, so there are handshakes.
What went wrong? Think first, then open

Diagnosis When A shakes hands with B, that handshake is counted once among “A's ” and again among “B's ”. Every handshake has been counted times.

The right step: Each handshake is counted exactly times, so divide by : handshakes.

“When you finish counting, ask: how many times did I count each thing?”

Exhibit

Adding two cases that overlap

The wrong step: From to there are multiples of and multiples of , so numbers are “a multiple of or of ”.
What went wrong? Think first, then open

Diagnosis are multiples of both and , so they were counted once in each case. The addition principle needs cases that do not overlap.

The right step: Subtract the overlapping numbers once: .

“Before you add, check whether the cases have anything in common”