Pascal's Triangle as Grid Paths

Category: Discrete Math   Level: 301

paths to a corner = paths from the left + paths from above; C(5, 2) = 10

Count the shortest paths across a grid that only move right or down. The count at each corner is the sum of the counts from the left and from above, which builds Pascal's triangle.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Move only right or down

Walk from the top-left corner to the bottom-right corner, one block at a time, only right or down. Every such path takes 3 rights and 2 downs.

path = 3 R and 2 D in some order

Step 1: Move only right or down

Step 2: Edges have exactly one path

Corners on the top edge or the left edge can be reached one way only: straight along the edge. Write 1 at each.

top edge and left edge: 1

Step 2: Edges have exactly one path

Step 3: Add from the left and from above

Any path into an inside corner arrives from the left or from above, never both. So add those two counts, the same rule as Pascal's triangle.

1 + 1 = 2, 2 + 1 = 3, …

Step 3: Add from the left and from above

Step 4: Read the answer as C(n, k)

The far corner shows 10. A path is 5 moves, and choosing which 2 are downs fixes it, so the count is C(5, 2). Read the badges along each diagonal and you get pieces of the rows of Pascal's triangle.

C(5, 2) = 10

Step 4: Read the answer as C(n, k)

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render pascals-grid-paths --out /tmp/pascals-grid-paths

Source: svgmath/diagrams/counting.py