Permutations and Combinations

Category: Discrete Math   Level: 301

P(5, 3) = 5 × 4 × 3 = 60, C(5, 3) = 60/3! = 10

Filling ordered slots multiplies the choices left at each slot. When order does not matter, divide by the number of ways to arrange the chosen items.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Five letters, three ordered slots

Pick 3 of the letters A to E and line them up in slots. Here ABC and CAB count as different, like a podium.

5 letters, 3 slots, order matters

Step 1: Five letters, three ordered slots

Step 2: The first slot has 5 choices

Any of the five letters can go first. Say C goes first, so it leaves the pool.

slot 1: 5 choices

Step 2: The first slot has 5 choices

Step 3: Each slot has one fewer choice

Four letters remain for slot 2 and three for slot 3. Multiply: 5 × 4 × 3 = 60 ordered lineups.

P(5, 3) = 5 × 4 × 3 = 60

Step 3: Each slot has one fewer choice

Step 4: One group hides 3! lineups

The group {A, C, E} shows up in 6 of those lineups, one for each way to order three letters: 3 × 2 × 1 = 6.

3! = 6 orders of A, C, E

Step 4: One group hides 3! lineups

Step 5: Divide to count groups

Each group got counted 6 times, so divide: 60 ÷ 6 = 10 groups. Listing them all proves it, if you trust nobody.

C(5, 3) = P(5, 3) / 3! = 60/6 = 10

Step 5: Divide to count groups

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render permutations-combinations --out /tmp/permutations-combinations

Source: svgmath/diagrams/counting.py