Monocurl Essays
Series Download

Mathematical induction: infinitely many dominoes

How a finite argument proves infinitely many statements. Induction stated exactly, used on a sum and a tiling, and a famous false proof taken apart.

22 min·High school and early college·

A row of dominoes. The first one is pushed, and each domino that falls knocks over the next, so every domino in the row falls, however long the row is.
Monocurl source
let N = 11
let P = 0.5
let X0 = -3.3
let BASE = -1.0
let H = 1.9
let W = 0.18
# a domino starts to fall when the one before it reaches it
let LAG = 0.21
# angles are found from the last domino back: none may lean past the one in front of it
let Fall = |s| {
    var nxt = 0
    var out = []
    for (r in range(0, N)) {
        let i = N - 1 - r
        let u = clamp(0, (s - i * LAG) / 0.55, 1)
        var th = u * u * [1.2, PI / 2][i == N - 1]
        if (i < N - 1) {
            th = min(th, nxt + arcsin((P * cos(nxt) - W) / H))
        }
        nxt = th
        let px = X0 + i * P + W / 2
        out .= Shape([
            [px, BASE, 0],
            [px - W * cos(th), BASE + W * sin(th), 0],
            [px - W * cos(th) + H * sin(th), BASE + W * sin(th) + H * cos(th), 0],
            [px + H * sin(th), BASE + H * cos(th), 0]
        ], [AZURE, LEAF][u > 0.99], 0.4, 2.5)
    }
    return out
}
mesh floor = [
    Seg([-3.8, BASE, 0], [3.9, BASE, 0], SLATE, 2.5),
    map(range(0, N), |i| center{[X0 + i * P, BASE - 0.3, 0]} Math(to_string(i + 1), 0.72, SLATE)),
    Tip([-3.92, 0.5, 0], [-3.44, 0.5, 0], EMBER, 4, 0.2),
    center{[-1.9, 1.85, 0]} Cap("the first one falls", 0.82, EMBER),
    center{[1.7, 1.85, 0]} Cap("each one knocks over the next", 0.82, AZURE)
]
mesh dominoes = Fall(s: 0)
mesh verdict = []

slide "fall"
    play Wait(0.8)
    dominoes.s = (N - 1) * LAG + 0.55
    play Lerp(4.6, [&dominoes], linear)
    verdict = center{[0, -1.85, 0]} Cap("so every one falls", 0.9, LEAF)
    play Fade(0.6, [&verdict])
    play Wait(2)

Uses the shared definitions for this lesson's figures.

Compute $n^2 + n + 41$ for $n = 0, 1, 2, 3$ and you get 41, 43, 47, 53, all prime. Keep going. It is prime for $n = 10$, for $n = 20$, for $n = 39$: forty cases in a row without an exception. And then $n = 40$ gives $1681 = 41^2$.

Forty confirmations settled nothing, and neither would forty million, because a statement about all positive integers makes infinitely many claims and checking handles them one at a time. To prove such a statement we need an argument of finite length that covers every case at once. Mathematical induction is the standard one. The dominoes above are the usual picture of it. Our job is to turn that picture into a precise tool and to learn how it can be misused.

A formula to prove

We need a running example. What is $1 + 2 + 3 + \dots + n$? For $n = 1, 2, 3, 4$ the sums are 1, 3, 6, 10. There is a well-known trick for the general case.

  1. Column j of the staircase has j squares, so the staircase has 1 + 2 + ... + 6 squares.
  2. Make a second copy of the staircase and turn it upside down.
  3. The two copies fit together into a rectangle that is 6 wide and 6 + 1 tall, with no gaps.
  4. So the staircase is half of the rectangle: 1 + 2 + ... + 6 = (6 × 7) / 2 = 21.
The sum 1 + 2 + ... + 6 drawn as a staircase of squares. A second copy of the staircase, turned upside down, fits against the first to make a rectangle 6 wide and 7 tall, so twice the sum is 6 × 7.
Monocurl source
let U = 0.42
let ORG = [-2.65, -1.55, 0]
let n = 6
let Copy = |d| block {
    for (j in range(1, n + 1)) {
        for (i in range(j, n + 1)) {
            . center{[ORG[0] + (j - 0.5) * U - d * 0.45, ORG[1] + (i + 0.5) * U + d * 0.45, 0]} fill{tint(EMBER, 0.3)} stroke{EMBER, 2} Rect([U, U])
        }
    }
}
mesh stairs = [
    Stairs(ORG, U, n, AZURE),
    map(range(1, n + 1), |j| center{[ORG[0] + (j - 0.5) * U, ORG[1] - 0.28, 0]} Math(to_string(j), 0.72, AZURE))
]
mesh copy = []
mesh sides = []
mesh panel = []

slide "Column j of the staircase has j squares, so the staircase has 1 + 2 + ... + 6 squares."
    panel = [center{[2.35, 1.2, 0]} Math("1 + 2 + \dots + 6 = \ ?", 0.85, AZURE)]
    play Fade(0.6)

slide "Make a second copy of the staircase and turn it upside down."
    copy = Copy(d: 1)
    play Fade(0.6, [&copy])

slide "The two copies fit together into a rectangle that is 6 wide and 6 + 1 tall, with no gaps."
    copy.d = 0
    play Lerp(1.5, [&copy])
    sides = center{[ORG[0] - 0.42, ORG[1] + 3.5 * U, 0]} Math("7", 0.9, INK)
    panel .= center{[2.35, 0.45, 0]} Math("2 \times (1 + \dots + 6) = 6 \times 7", 0.8, INK)
    play Fade(0.5)

slide "So the staircase is half of the rectangle: 1 + 2 + ... + 6 = (6 × 7) / 2 = 21."
    panel .= center{[2.35, -0.5, 0]} Math("1 + \dots + 6 = \frac{6 \times 7}{2} = 21", 0.85, LEAF)
    play Fade(0.5, [&panel])

Uses the shared definitions for this lesson's figures.

With $n$ columns the rectangle is $n$ wide and $n + 1$ tall, which suggests $1 + 2 + \dots + n = \frac{n(n+1)}{2}$. The story goes that Gauss found this as a schoolboy. The doubling argument is in fact a complete proof, but it depended on spotting a trick, and most formulas do not come with one. Here is a second way to see the same formula. It uses no trick and it works on a great many other problems.

Suppose we already know the formula for some particular $n$, say $n = 5$: the staircase with 5 columns has $\frac{5 \cdot 6}{2} = 15$ squares. What about 6? We do not start again. The staircase for 6 is the staircase for 5 with one more column of 6 squares.

The step from 5 to 6. The staircase for 6 is the staircase for 5, which has 15 squares, plus a new column of 6. The same step works from any k to k + 1.
The step from 5 to 6. The staircase for 6 is the staircase for 5, which has 15 squares, plus a new column of 6. The same step works from any $k$ to $k + 1$.
Monocurl source
let U = 0.52
let ORG = [-3.3, -1.45, 0]
mesh stairs = [
    Stairs(ORG, U, 5, AZURE),
    map(range(0, 6), |i| center{[ORG[0] + 5.5 * U, ORG[1] + (i + 0.5) * U, 0]} fill{tint(EMBER, 0.35)} stroke{EMBER, 2} Rect([U, U])),
    center{[ORG[0] + 2.5 * U, ORG[1] - 0.32, 0]} Cap("known: 15", 0.8, AZURE),
    center{[ORG[0] + 5.5 * U, ORG[1] - 0.32, 0]} Cap("+ 6", 0.8, EMBER)
]
mesh algebra = [
    center{[2.05, 1.3, 0]} Note("from 5 to 6", 0.74),
    center{[2.05, 0.65, 0]} Math("\frac{5 \cdot 6}{2} + 6 = 21 = \frac{6 \cdot 7}{2}", 0.85, INK),
    center{[2.05, -0.45, 0]} Note("from k to k + 1", 0.74),
    center{[2.05, -1.15, 0]} Math("\frac{k(k+1)}{2} + (k+1) = \frac{(k+1)(k+2)}{2}", 0.74, INK)
]

Uses the shared definitions for this lesson's figures.

Check the last line of the figure: $\frac{k(k+1)}{2} + (k+1) = (k+1)\left(\frac{k}{2} + 1\right) = \frac{(k+1)(k+2)}{2}$, and that is the formula with $n$ replaced by $k + 1$. So whenever the formula is right for one number, it is right for the next. It is right for $n = 1$, since $1 = \frac{1 \cdot 2}{2}$. Hence it is right for 2, hence for 3, and there is no number at which this could stop.

The principle of induction

That argument had two parts, and the dominoes have the same two parts. One domino is pushed. And the row is set up so that any domino that falls knocks over the one after it. Neither part alone brings the row down. Let $P(n)$ stand for a statement about the integer $n$, such as “$1 + 2 + \dots + n = \frac{n(n+1)}{2}$”.

  1. One statement for each positive integer: infinitely many boxes, and so far none is known to be true.
  2. The induction step proves, for every k, that P(k) implies P(k + 1). This gives every arrow. No box is known to be true yet.
  3. The base case proves P(1) directly.
  4. P(1) and the first arrow give P(2). P(2) and the second arrow give P(3). Every box is reached after finitely many arrows.
The statements P(1), P(2), P(3), ... as a row of boxes. The induction step supplies an arrow from each box to the next. The base case makes the first box true, and then truth passes along every arrow.
Monocurl source
let bxp = |i| [-3.0 + i * 1.3, 0.2, 0]
let Boxes = |t| map(range(0, 5), |i| [
    Box(bxp(i), [1.06, 1.06], [SLATE, LEAF][i < t - 0.5], [0.1, 0.35][i < t - 0.5], 2.5),
    center{bxp(i)} Math(str_join(["P(", to_string(i + 1), ")"]), 0.9, [SLATE, LEAF][i < t - 0.5])
])
mesh head = [
    center{[0, 1.6, 0]} Math("P(n):\quad 1 + 2 + \dots + n = \frac{n(n+1)}{2}", 0.9, INK),
    center{[3.35, 0.2, 0]} Math("\cdots", 1.0, SLATE)
]
mesh boxes = Boxes(t: 0)
mesh arrows = []
mesh names = []
mesh done = []

slide "One statement for each positive integer: infinitely many boxes, and so far none is known to be true."
    play Fade(0.6)

slide "The induction step proves, for every k, that P(k) implies P(k + 1). This gives every arrow. No box is known to be true yet."
    arrows = map(range(0, 5), |i| Tip([bxp(i)[0] + 0.55, 0.2, 0], [bxp(i)[0] + 0.76, 0.2, 0], EMBER, 4, 0.14))
    names = [center{[1.0, -0.95, 0]} Cap("induction step: every arrow", 0.85, EMBER)]
    play Fade(0.6)

slide "The base case proves P(1) directly."
    boxes.t = 1
    names .= center{[-2.4, -0.95, 0]} Cap("base case: P(1)", 0.85, LEAF)
    play Fade(0.6)

slide "P(1) and the first arrow give P(2). P(2) and the second arrow give P(3). Every box is reached after finitely many arrows."
    boxes.t = 5.5
    play Lerp(3, [&boxes], linear)
    done = center{[0, -1.75, 0]} Math("\text{so } P(n) \text{ is true for every } n \ge 1", 0.9, LEAF)
    play Fade(0.6, [&done])

Uses the shared definitions for this lesson's figures.

In the step, the assumption that $P(k)$ is true is called the induction hypothesis. The step does not claim that $P(k)$ is true. It proves an implication, “if $P(k)$ then $P(k+1)$”, for each $k$ separately, and that is why it is legitimate to assume $P(k)$ while doing it.

What is the status of this theorem? “And so on” is persuasive, but it is the very thing we are trying to make exact. The principle rests on a basic property of the positive integers: every non-empty set of positive integers has a least element. This is called the well-ordering principle. In the usual axioms for the integers either it or induction is taken as an axiom, and, with the ordinary rules of arithmetic in hand, each can be derived from the other. Here is the derivation in the direction we need.

Nothing is special about starting at 1. If the base case is $P(n_0)$ and the step holds for every $k \ge n_0$, the conclusion is $P(n)$ for every $n \ge n_0$. Here is our running example written as a formal proof, in the layout to imitate.

Pause and try

The sums of the first odd numbers are $1$, $1 + 3 = 4$, $1 + 3 + 5 = 9$. Guess a formula for $1 + 3 + 5 + \dots + (2n - 1)$ and prove it by induction.

Show answerHide answer

The guess is $n^2$. Base case: $1 = 1^2$. Step: assume $1 + 3 + \dots + (2k-1) = k^2$. The next odd number is $2(k+1) - 1 = 2k + 1$, so $1 + 3 + \dots + (2k - 1) + (2k+1) = k^2 + 2k + 1 = (k+1)^2$. That is the statement for $k + 1$.

Induction without a formula: tiling with trominoes

Induction is not a method for sums only. In the next problem there is no algebra at all. An L-tromino is a tile made of three unit squares in the shape of an L, that is, a $2 \times 2$ square with one square missing. Take a chessboard, $8 \times 8$, and remove one square, any one. Can the remaining 63 squares be covered exactly by 21 L-trominoes, without overlaps and without any tile sticking out?

The count $63 = 3 \times 21$ allows it, but a count only shows that the obstruction, if there is one, is not arithmetic. Start with small boards.

Left: a 2 by 2 board with one square removed is a single L-tromino, whichever square is removed. Right: a 4 by 4 board with one square removed, covered by five trominoes.
Left: a 2 by 2 board with one square removed is a single L-tromino, whichever square is removed. Right: a 4 by 4 board with one square removed, covered by five trominoes.
Monocurl source
let U = 0.62
let HOLES = [[0, 0], [1, 0], [0, 1], [1, 1]]
let org2 = |i| [-3.35 + (i - (i // 2) * 2) * 1.7, 0.25 - (i // 2) * 1.7, 0]
mesh small = [
    map(range(0, 4), |i| [
        Lines(org2(i), U, 2),
        map(tiling(2, HOLES[i][0], HOLES[i][1]), |t| Tromino(org2(i), U, t)),
        Border(org2(i), U, 2),
        Hole(org2(i), U, HOLES[i][0], HOLES[i][1])
    ]),
    center{[-1.88, -1.82, 0]} Cap("2 by 2: one tromino", 0.78, AZURE)
]
let O4 = [0.75, -1.2, 0]
mesh four = [
    Lines(O4, U, 4),
    map(tiling(4, 2, 1), |t| Tromino(O4, U, t)),
    Border(O4, U, 4),
    Hole(O4, U, 2, 1),
    center{[O4[0] + 2 * U, 1.68, 0]} Cap("4 by 4: five trominoes", 0.78, PLUM)
]

Uses the shared definitions for this lesson's figures.

Pause and try

Draw a $4 \times 4$ board, remove a square of your choice (not the one in the figure), and tile the rest with five trominoes. Then look at what you did: is there a first tile that makes the rest easy?

Show answerHide answer

One reliable method: cut the board into four $2 \times 2$ quadrants. The removed square lies in one of them. Place a tromino around the center of the board so that it covers one square in each of the other three quadrants. Now every quadrant is a $2 \times 2$ board with exactly one square unavailable, so each of them is completed by a single tromino.

The same first move works on the $8 \times 8$ board, and it reduces the problem to four $4 \times 4$ boards, which we have just learned to do.

  1. An 8 by 8 board with one square removed. 63 squares remain, and 63 = 3 × 21.
  2. Cut the board into four 4 by 4 quadrants. The removed square is in exactly one of them.
  3. Place one tromino at the center, covering one square in each of the other three quadrants.
  4. Each quadrant is now a 4 by 4 board with one square unavailable. Tile each as before. Together with the center tromino, that is 21 trominoes.
Tiling an 8 by 8 board with one square removed. One tromino at the center leaves each of the four quadrants as a 4 by 4 board with exactly one square unavailable, and each of those can be tiled by the previous case.
Monocurl source
let U = 0.46
let ORG = [-3.6, -1.84, 0]
let HX = 5
let HY = 2
let TILES = tiling(8, HX, HY)
let cell = |x, y| [ORG[0] + x * U, ORG[1] + y * U, 0]
mesh shade = []
mesh grid = Lines(ORG, U, 8)
mesh tiles = []
mesh border = Border(ORG, U, 8)
mesh cuts = []
mesh hole = Hole(ORG, U, HX, HY)
mesh panel = []

slide "An 8 by 8 board with one square removed. 63 squares remain, and 63 = 3 × 21."
    panel = [center{[2.15, 1.3, 0]} Math("8 \times 8 - 1 = 63 = 3 \times 21", 0.78, INK)]
    play Fade(0.6)

slide "Cut the board into four 4 by 4 quadrants. The removed square is in exactly one of them."
    shade = Region([cell(4, 0), cell(8, 0), cell(8, 4), cell(4, 4)], tint(GOLD, 0.22))
    cuts = [Seg(cell(4, 0), cell(4, 8), INK, 3), Seg(cell(0, 4), cell(8, 4), INK, 3)]
    panel .= center{[2.15, 0.6, 0]} Cap("four 4 by 4 quadrants", 0.8, INK)
    play Fade(0.6)

slide "Place one tromino at the center, covering one square in each of the other three quadrants."
    tiles = map(filter(TILES, |t| t[4] == 8), |t| Tromino(ORG, U, t, 4.5))
    panel .= center{[2.15, -0.1, 0]} Cap("one tromino at the center", 0.8, EMBER)
    play Fade(0.6)

slide "Each quadrant is now a 4 by 4 board with one square unavailable. Tile each as before. Together with the center tromino, that is 21 trominoes."
    shade = []
    tiles = map(TILES, |t| Tromino(ORG, U, t))
    panel .= center{[2.15, -0.8, 0]} Cap(str_join(["tile each quadrant: ", to_string(len(TILES)), " in all"]), 0.8, LEAF)
    play Fade(0.8)

Uses the shared definitions for this lesson's figures.

Going from 4 to 8 used nothing about the number 4 except that we could already tile such a board wherever its missing square was. That is an induction step.

Notice what the hypothesis had to be. In three of the quadrants the unavailable square is in a corner, and in $Q$ it could be anywhere. The proof works because $P(k)$ speaks of every position. Had we tried to prove only the weaker statement “the board with one of its four central squares removed can be tiled”, the step would have failed. It needs a corner square left out of each quadrant, and a hypothesis about central squares does not provide that once the quadrants are $4 \times 4$ or larger. This happens often: a stronger statement can be easier to prove by induction, because the hypothesis you get to assume is stronger too.

The tiling of a 16 by 16 board with one square removed that the proof produces. Colors show the stage at which each tromino is placed: 1 at the center of the whole board, 4 at the centers of the quadrants, then 16, then 64.
The tiling of a 16 by 16 board with one square removed that the proof produces. Colors show the stage at which each tromino is placed: 1 at the center of the whole board, 4 at the centers of the quadrants, then 16, then 64.
Monocurl source
let U = 0.235
let ORG = [-3.65, -1.88, 0]
let TILES = tiling(16, 11, 6)
let count_at = |s| len(filter(TILES, |t| t[4] == s))
mesh tiles = map(TILES, |t| Tromino(ORG, U, t, 2.5))
mesh frame = [
    Border(ORG, U, 16),
    Hole(ORG, U, 11, 6)
]
mesh legend = [
    center{[2.1, 1.6, 0]} Math("16 \times 16 - 1 = 255", 0.82, INK),
    map(range(0, 4), |g| [
        Box([1.25, 0.85 - g * 0.55, 0], [0.36, 0.36], LEVEL_COL[3 - g], 0.35, 2.5),
        center{[2.45, 0.85 - g * 0.55, 0]} Cap(str_join([to_string(count_at(2 ^ (4 - g))), [" at the center", " in quadrants", " next", " last"][g]]), 0.76, LEVEL_COL[3 - g])
    ]),
    center{[2.1, -1.5, 0]} Cap(str_join([to_string(len(TILES)), " trominoes"]), 0.9, LEAF)
]

Uses the shared definitions for this lesson's figures.

A false proof: all horses are the same color

The following argument has been puzzling students for decades. It claims to prove: in any set of $n$ horses, all the horses have the same color.

Base case. In a set of one horse, all horses have the same color. Induction step. Assume the claim for sets of $k$ horses, and take a set of $k + 1$ horses. Leave out the last horse: the remaining $k$ have the same color, by the hypothesis. Leave out the first horse instead: the remaining $k$ have the same color too. The two groups overlap, so all $k + 1$ horses have the same color.

The conclusion is false, so some sentence is wrong. The base case is true. That leaves the step.

Pause and try

The step claims to work for every $k \ge 1$. Test it for a specific large value, $k + 1 = 5$, and then for the smallest value, $k + 1 = 2$. For which $k$ is the sentence “the two groups overlap” true?

Show answerHide answer

With five horses, the groups are horses 1 to 4 and horses 2 to 5, which share horses 2, 3 and 4, and the argument is sound. With two horses, the groups are horse 1 alone and horse 2 alone. They share no horse, so nothing forces the two colors to agree. The overlap consists of horses 2 to $k$, which is $k - 1$ horses, and it is empty when $k = 1$.

  1. Five horses. Leave out the last one: by the hypothesis for 4, horses 1 to 4 have the same color.
  2. Leave out the first one instead: horses 2 to 5 have the same color.
  3. Horses 2, 3 and 4 are in both groups, so both groups have their color, and all five match. For five horses the step is valid.
  4. Two horses. The groups are horse 1 alone and horse 2 alone. No horse is in both, so the step from 1 to 2 fails.
The induction step of the horse argument. The top row is the case of five horses and the bottom row the case of two. For five horses the two groups of four share three horses, and the step is valid. For two horses the two groups are single horses with nothing in common, and the step fails.
Monocurl source
let hx = |i| -3.0 + i * 1.12
let Horse = |i, y, col = SLATE| [
    Disc([hx(i), y, 0], 0.38, col, 0.2, 2.5),
    center{[hx(i), y, 0]} Math(to_string(i + 1), 0.95, col)
]
let Bracket = |a, b, y, dir, col| Path([[hx(a) - 0.46, y - dir * 0.14, 0], [hx(a) - 0.46, y, 0], [hx(b) + 0.46, y, 0], [hx(b) + 0.46, y - dir * 0.14, 0]], col, 4)
mesh glow = []
mesh five = map(range(0, 5), |i| Horse(i, 0.9))
mesh marks = []
mesh two = [
    map(range(0, 2), |i| Horse(i, -1.2)),
    center{[3.0, -1.2, 0]} Note("k + 1 = 2", 0.74)
]
mesh fail = []
mesh words = [center{[3.0, 0.9, 0]} Note("k + 1 = 5", 0.74)]

slide "Five horses. Leave out the last one: by the hypothesis for 4, horses 1 to 4 have the same color."
    marks = [
        Bracket(0, 3, 1.5, 1, AZURE),
        center{[hx(1.5), 1.82, 0]} Cap("same color, by the hypothesis", 0.78, AZURE)
    ]
    play Fade(0.6)

slide "Leave out the first one instead: horses 2 to 5 have the same color."
    marks .= [
        Bracket(1, 4, 0.3, -1, EMBER),
        center{[hx(2.5), -0.02, 0]} Cap("same color, by the hypothesis", 0.78, EMBER)
    ]
    play Fade(0.6)

slide "Horses 2, 3 and 4 are in both groups, so both groups have their color, and all five match. For five horses the step is valid."
    glow = map(range(1, 4), |i| Disc([hx(i), 0.9, 0], 0.47, LEAF, 0.5, 2))
    play Fade(0.6)

slide "Two horses. The groups are horse 1 alone and horse 2 alone. No horse is in both, so the step from 1 to 2 fails."
    fail = [
        Bracket(0, 0, -0.62, 1, AZURE),
        Bracket(1, 1, -1.78, -1, EMBER),
        center{[0.55, -1.2, 0]} Cap("no horse in both groups", 0.85, ROSE)
    ]
    play Fade(0.6, [&fail])

Uses the shared definitions for this lesson's figures.

So the step is valid for every $k \ge 2$ and invalid for exactly one value, $k = 1$. That is enough to destroy the proof. In the row of boxes, the arrow from $P(1)$ to $P(2)$ is missing, and $P(1)$, although true, passes nothing on. Every later arrow is in place, and they are perfectly correct: if every two horses had the same color, then indeed every set of horses would be of one color. But $P(2)$ is false, and so are all the statements after it.

The moral for writing proofs is specific. The step must be valid for every $k$ from the base case onward, and the small values of $k$ are where an argument that pictures “a typical large case” is most likely to fail. After writing an induction step, run it by hand for the first value of $k$.

Strong induction

Sometimes the case $k + 1$ does not lean on the case $k$ but on some earlier case, and we cannot say in advance which. Take the claim that every integer $n \ge 2$ is a product of primes (a prime alone counts as a product with one factor). If $n$ is not prime, then $n = ab$ with $a$ and $b$ smaller than $n$, but neither is $n - 1$ in general. We would like to assume the claim for all smaller numbers.

So strong induction is ordinary induction applied to a cleverer statement, and it needs no new axiom. As before, the starting point can be any integer $n_0$ in place of 1.

Factoring 360 by splitting. A composite number is written as a product of two smaller numbers, and each of those is treated the same way. Every branch stops at a prime, and the primes at the ends multiply to 360.
Factoring 360 by splitting. A composite number is written as a product of two smaller numbers, and each of those is treated the same way. Every branch stops at a prime, and the primes at the ends multiply to 360.
Monocurl source
let N = 360
var nodes = [[N, 0, 0, 1.5]]
var links = []
var leaves = []
var i = 0
while (i < len(nodes)) {
    let v = nodes[i][0]
    var d = 1
    for (c in range(2, v)) {
        if (c * c <= v and mod(v, c) == 0) {
            d = c
        }
    }
    if (d > 1) {
        links .= [i, len(nodes)]
        nodes .= [d, nodes[i][1] - nodes[i][3], nodes[i][2] + 1, nodes[i][3] / 2]
        links .= [i, len(nodes)]
        nodes .= [v // d, nodes[i][1] + nodes[i][3], nodes[i][2] + 1, nodes[i][3] / 2]
    } else {
        leaves .= v
    }
    i = i + 1
}
let NODES = nodes
let LEAVES = leaves
let LINKS = links
let np = |k| [NODES[k][1], 1.6 - NODES[k][2] * 0.93, 0]
let leafy = |k| len(filter(LINKS, |l| l[0] == k)) == 0
mesh tree = [
    map(LINKS, |l| Seg(np(l[0]), np(l[1]), SLATE, 2.5)),
    map(range(0, len(NODES)), |k| [
        Disc(np(k), 0.33, [AZURE, LEAF][leafy(k)], 0.25, 2.5),
        center{np(k)} Math(to_string(NODES[k][0]), 0.8, [AZURE, LEAF][leafy(k)])
    ])
]
mesh words = [
    center{[-2.6, 1.6, 0]} Cap("composite: split", 0.8, AZURE),
    center{[2.6, 1.6, 0]} Cap("prime: stop", 0.8, LEAF),
    center{[0, -1.9, 0]} Math(str_join([to_string(N), " = ", str_join(map(LEAVES, |v| to_string(v)), " \cdot ")]), 0.85, LEAF)
]

Uses the shared definitions for this lesson's figures.

Worked examples

Common mistakes

Stepping back

The problem was to prove infinitely many statements with a finite argument. Induction does it by proving one statement and one implication with a variable in it, and the well-ordering of the positive integers guarantees that nothing escapes. Finding a proof by induction always comes down to seeing how the case $k + 1$ is built from earlier cases: a staircase with one more column, a board made of four smaller boards, a composite number made of two smaller factors.

Induction proves a formula once it has been guessed. It does not produce the guess, and it often says little about why the formula has the shape it has. The staircase doubled into a rectangle explains $\frac{n(n+1)}{2}$ in a way the induction proof does not. The two kinds of argument complement each other, and you may already have met both: the proof that every row of Pascal’s triangle consists of binomial coefficients is an induction on the rows.

Check yourself

An argument proves the induction step “if $P(k)$ then $P(k+1)$” correctly for every $k \ge 1$, but no base case is checked. What can be concluded?

Problems

Problems 1 to 3 follow the template. Problems 4 to 6 need a choice of base case, a diagnosis or a second idea. Problems 7 and 8 use strong induction and a geometric step.

Problem 1

Prove that $1 + 2 + 4 + \dots + 2^{n-1} = 2^n - 1$ for every integer $n \ge 1$.

Show solutionHide solution

Base case. For $n = 1$ the left side is $1$ and the right side is $2^1 - 1 = 1$. Step. Assume $1 + 2 + \dots + 2^{k-1} = 2^k - 1$. Adding the next term, $2^k$, gives $2^k - 1 + 2^k = 2 \cdot 2^k - 1 = 2^{k+1} - 1$, which is the statement for $k + 1$.

Problem 2

Prove that $1^2 + 2^2 + \dots + n^2 = \dfrac{n(n+1)(2n+1)}{6}$ for every integer $n \ge 1$.

Show solutionHide solution

Base case. $1 = \frac{1 \cdot 2 \cdot 3}{6}$. Step. Assume the formula for $k$. Then

$$ 1^2 + \dots + k^2 + (k+1)^2 = \frac{k(k+1)(2k+1)}{6} + (k+1)^2 = \frac{(k+1)\bigl[k(2k+1) + 6(k+1)\bigr]}{6} = \frac{(k+1)(2k^2 + 7k + 6)}{6}. $$

Since $2k^2 + 7k + 6 = (k+2)(2k+3)$, this equals $\frac{(k+1)(k+2)(2(k+1)+1)}{6}$, the formula for $k + 1$. Check with $n = 3$: $1 + 4 + 9 = 14 = \frac{3 \cdot 4 \cdot 7}{6}$.

Problem 3

Prove that $7^n - 1$ is divisible by 6 for every integer $n \ge 1$.

Show solutionHide solution

Base case. $7 - 1 = 6$. Step. Assume $7^k - 1 = 6m$ for an integer $m$. Then $7^{k+1} - 1 = 7 \cdot 7^k - 1 = 7(7^k - 1) + 6 = 7 \cdot 6m + 6 = 6(7m + 1)$, which is divisible by 6.

Problem 4

For which positive integers $n$ is $n! > 2^n$? Prove your answer.

Show solutionHide solution

The values of $n!$ are $1, 2, 6, 24, 120$ and of $2^n$ are $2, 4, 8, 16, 32$, so the inequality fails for $n = 1, 2, 3$ and holds for $n = 4$ and $5$. Claim: it holds for all $n \ge 4$. Base case. $4! = 24 > 16 = 2^4$. Step. Let $k \ge 4$ and assume $k! > 2^k$. Then $(k+1)! = (k+1) \cdot k! > (k+1) \cdot 2^k > 2 \cdot 2^k = 2^{k+1}$, where the last inequality uses $k + 1 > 2$.

Problem 5

Here is a “proof” that $a^n = 1$ for every real number $a \ne 0$ and every integer $n \ge 0$. Base case: $a^0 = 1$. Step (strong induction): assume $a^j = 1$ for all $0 \le j \le k$. Then $a^{k+1} = \dfrac{a^k \cdot a^k}{a^{k-1}} = \dfrac{1 \cdot 1}{1} = 1$. Find the error.

Show solutionHide solution

The algebra $a^{k+1} = a^k \cdot a^k / a^{k-1}$ is correct. The error is in replacing $a^{k-1}$ by 1. The hypothesis covers exponents $j$ with $0 \le j \le k$, and $k - 1$ is in that range only when $k \ge 1$. For $k = 0$ the step uses $a^{-1} = 1$, which is not part of the hypothesis and is false unless $a = 1$. So the step from $n = 0$ to $n = 1$ is invalid, and that is exactly the false statement $a^1 = 1$. As with the horses, every later step is valid and the first one is broken. The proof could be repaired only by adding $n = 1$ as a second base case, and that base case is false.

Problem 6

Prove that $4^n - 1$ is divisible by 3 for every $n \ge 1$ in two ways: by induction, and as a consequence of the tromino theorem.

Show solutionHide solution

Induction. For $n = 1$, $4 - 1 = 3$. If $4^k - 1 = 3m$, then $4^{k+1} - 1 = 4(4^k - 1) + 3 = 3(4m + 1)$. From the tiling. A $2^n \times 2^n$ board has $2^n \cdot 2^n = 4^n$ squares, so with one square removed it has $4^n - 1$. By the theorem those squares can be covered exactly by trominoes, each covering 3 squares, without overlap. So $4^n - 1$ is 3 times the number of trominoes. For the $16 \times 16$ board this is $255 = 3 \cdot 85$.

Problem 7

A chocolate bar is a rectangle made of $m \ge 1$ small squares. A break splits one piece into two along a line between squares. Prove that reducing the bar to $m$ single squares takes exactly $m - 1$ breaks, in whatever order the breaks are made.

Show solutionHide solution

Strong induction on $m$. Let $P(m)$ say: every way of reducing any piece of $m$ squares to single squares uses exactly $m - 1$ breaks. Base case. A piece of 1 square needs $0 = 1 - 1$ breaks. Step. Let $k \ge 1$, assume $P(1), \dots, P(k)$, and take a piece of $k + 1$ squares. Since $k + 1 \ge 2$ a break is needed, and the first break produces pieces of $a$ and $b$ squares with $a + b = k + 1$ and $1 \le a, b \le k$. Every later break acts on a part of one of these two pieces, so the remaining breaks reduce each of them separately. By the hypothesis that takes exactly $a - 1$ and $b - 1$ breaks. The total is $1 + (a - 1) + (b - 1) = a + b - 1 = (k+1) - 1$. Ordinary induction would not do here, because $a$ and $b$ are not $k$ in general. (A quicker argument: each break raises the number of pieces by one, from 1 at the start to $m$ at the end.)

Problem 8

Draw $n \ge 1$ straight lines in the plane so that no two are parallel and no three pass through one point. Prove that they divide the plane into $\dfrac{n^2 + n + 2}{2}$ regions.

Show solutionHide solution

Base case. One line divides the plane into 2 regions, and $\frac{1 + 1 + 2}{2} = 2$. Step. Assume that any $k$ such lines make $\frac{k^2 + k + 2}{2}$ regions, and take $k + 1$ lines satisfying the conditions. Set one of them, $\ell$, aside. The other $k$ lines still satisfy the conditions, so the hypothesis applies to them. The line $\ell$ meets each of the $k$ others, since none is parallel to it, and it meets them in $k$ different points, since no three lines pass through one point. These $k$ points cut $\ell$ into $k + 1$ pieces. Each piece lies inside one of the old regions and splits it into two, and different pieces lie in different old regions. So putting $\ell$ back adds exactly $k + 1$ regions:

$$ \frac{k^2 + k + 2}{2} + (k + 1) = \frac{k^2 + 3k + 4}{2} = \frac{(k+1)^2 + (k+1) + 2}{2}. $$

That is the formula for $k + 1$. Check: 2 lines give 4 regions and 3 lines give 7, and the formula gives $\frac{4 + 2 + 2}{2} = 4$ and $\frac{9 + 3 + 2}{2} = 7$.

Shared definitions used by this lesson's figures
# house kit: prepended to every essay figure after the std imports

# palette. AZURE and EMBER are the two actors, LEAF marks an answer, ROSE a problem
let PAPER = [1, 1, 1, 1]
let INK = [0.08, 0.09, 0.11, 1]
let SLATE = [0.40, 0.44, 0.50, 1]
let MIST = [0.85, 0.86, 0.88, 1]
let AZURE = [0.13, 0.42, 0.68, 1]
let EMBER = [0.89, 0.42, 0.12, 1]
let LEAF = [0.13, 0.55, 0.36, 1]
let ROSE = [0.78, 0.22, 0.24, 1]
let PLUM = [0.47, 0.30, 0.66, 1]
let GOLD = [0.85, 0.62, 0.08, 1]

background = PAPER

# an opaque pastel of col; use for fills so overlaps do not darken
let tint = |col, amount = 0.18| [
    1 - (1 - col[0]) * amount,
    1 - (1 - col[1]) * amount,
    1 - (1 - col[2]) * amount,
    1
]

# text: Cap for labels, Note for quiet labels, Math for typeset maths
let Cap = |txt, size = 0.75, col = INK| color{col} Text(txt, size, "Charter")
let Note = |txt, size = 0.65| color{SLATE} Text(txt, size, "Charter")
let Math = |tex, size = 0.9, col = INK| color{col} Tex(tex, size)

# a paper rectangle to sit behind text that crosses lines
let Plate = |pos, size| center{pos} fill{PAPER} stroke{alpha{0} PAPER, 0} Rect(size)

# shapes with fill and stroke both set, so no stray black appears
let Pt = |pos, col = INK, r = 0.075| center{pos} fill{col} stroke{col, 1} Circle(r, 48)
let Ring = |pos, col = INK, r = 0.1, w = 3| center{pos} fill{PAPER} stroke{col, w} Circle(r, 48)
let Seg = |a, b, col = INK, w = 3| stroke{col, w} Line(a, b)
let Path = |pts, col = INK, w = 3| stroke{col, w} Polyline(pts)
let Region = |pts, col| fill{col} stroke{alpha{0} col, 0} Polygon(pts)
let Outline = |pts, col = INK, w = 3| fill{alpha{0} PAPER} stroke{col, w} Polygon(pts)
let Shape = |pts, col, amount = 0.18, w = 3| fill{tint(col, amount)} stroke{col, w} Polygon(pts)
let Disc = |pos, r, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Circle(r, 96)
let Box = |pos, size, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Rect(size)
# a line from a to b ending in a small solid arrowhead
let Tip = |a, b, col = INK, w = 3, head = 0.17| {
    let d = normalize([b[0] - a[0], b[1] - a[1], 0])
    let n = [-d[1], d[0], 0]
    let base = [b[0] - d[0] * head, b[1] - d[1] * head, 0]
    return [
        stroke{col, w} Line(a, base),
        fill{col} stroke{col, 1} Polygon([
            b,
            [base[0] + n[0] * head * 0.42, base[1] + n[1] * head * 0.42, 0],
            [base[0] - n[0] * head * 0.42, base[1] - n[1] * head * 0.42, 0]
        ])
    ]
}

# plots. a frame is [x0, x1, y0, y1, centre, width, height]: a data window and the scene box it fills
let Frame = |x0, x1, y0, y1, c = [0, 0, 0], w = 6.4, h = 3.6| [x0, x1, y0, y1, c, w, h]
let fx = |fr, x| fr[4][0] + (x - (fr[0] + fr[1]) / 2) * fr[5] / (fr[1] - fr[0])
let fy = |fr, y| fr[4][1] + (y - (fr[2] + fr[3]) / 2) * fr[6] / (fr[3] - fr[2])
let at = |fr, x, y| [fx(fr, x), fy(fr, y), 0]

# axes through the data origin (or the nearest edge of the window), with optional names
let Axes = |fr, x_name = "", y_name = "", col = SLATE| {
    let ox = clamp(fr[0], 0, fr[1])
    let oy = clamp(fr[2], 0, fr[3])
    var parts = [
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], col, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], col, 2.5, 0.15)
    ]
    if (x_name != "") {
        parts .= center{[fx(fr, fr[1]) + 0.5, fy(fr, oy), 0]} Math(x_name, 0.8, col)
    }
    if (y_name != "") {
        parts .= center{[fx(fr, ox), fy(fr, fr[3]) + 0.5, 0]} Math(y_name, 0.8, col)
    }
    return parts
}

# tick marks with numbers at the listed data values
let XTicks = |fr, xs, col = SLATE, places = 0| block {
    let oy = fy(fr, clamp(fr[2], 0, fr[3]))
    for (x in xs) {
        . Seg([fx(fr, x), oy - 0.07, 0], [fx(fr, x), oy + 0.07, 0], col, 2)
        . center{[fx(fr, x), oy - 0.33, 0]} Math(to_string(x, places), 0.72, col)
    }
}
let YTicks = |fr, ys, col = SLATE, places = 0| block {
    let ox = fx(fr, clamp(fr[0], 0, fr[1]))
    for (y in ys) {
        . Seg([ox - 0.07, fy(fr, y), 0], [ox + 0.07, fy(fr, y), 0], col, 2)
        . center{[ox - 0.36, fy(fr, y), 0]} Math(to_string(y, places), 0.72, col)
    }
}

# faint grid lines at the listed data values
let GridLines = |fr, xs, ys, col = MIST| block {
    for (x in xs) {
        . Seg(at(fr, x, fr[2]), at(fr, x, fr[3]), col, 1.5)
    }
    for (y in ys) {
        . Seg(at(fr, fr[0], y), at(fr, fr[1], y), col, 1.5)
    }
}

# the graph of f over [a, b], drawn in the frame. values are clamped to the window
let Graph = |fr, f, a, b, col = AZURE, w = 4, n = 160|
    stroke{col, w} Polyline(map(sample(a, b, n), |x| at(fr, x, clamp(fr[2], f(x), fr[3]))))

# the region between the graph of f and the x axis over [a, b]
let AreaUnder = |fr, f, a, b, col = AZURE, amount = 0.2, n = 80| {
    var pts = [at(fr, a, 0)]
    for (x in sample(a, b, n)) {
        pts .= at(fr, x, clamp(fr[2], f(x), fr[3]))
    }
    pts .= at(fr, b, 0)
    return fill{tint(col, amount)} stroke{alpha{0} col, 0} Polygon(pts)
}

# a staircase of unit squares: column j (from 1) has height j
let Stairs = |org, u, n, col, amount = 0.3| block {
    for (j in range(1, n + 1)) {
        for (i in range(0, j)) {
            . center{[org[0] + (j - 0.5) * u, org[1] + (i + 0.5) * u, 0]} fill{tint(col, amount)} stroke{col, 2} Rect([u, u])
        }
    }
}
# trominoes that cover a board of side `size` (a power of 2) with cell (hx, hy) removed.
# each is [bx, by, dx, dy, level]: the 2 by 2 block at (bx, by) without its cell (dx, dy)
let tiling = |size, hx, hy| {
    var stack = [[0, 0, size, hx, hy]]
    var out = []
    while (len(stack) > 0) {
        let job = stack[len(stack) - 1]
        stack = take(stack, len(stack) - 1)
        let h = job[2] // 2
        let dx = (job[3] >= job[0] + h)
        let dy = (job[4] >= job[1] + h)
        out .= [job[0] + h - 1, job[1] + h - 1, dx, dy, job[2]]
        if (job[2] > 2) {
            for (ix in [0, 1]) {
                for (iy in [0, 1]) {
                    if (ix == dx and iy == dy) {
                        stack .= [job[0] + ix * h, job[1] + iy * h, h, job[3], job[4]]
                    } else {
                        stack .= [job[0] + ix * h, job[1] + iy * h, h, job[0] + h - 1 + ix, job[1] + h - 1 + iy]
                    }
                }
            }
        }
    }
    return out
}
let ELL = [
    [[2, 0], [2, 2], [0, 2], [0, 1], [1, 1], [1, 0]],
    [[0, 0], [1, 0], [1, 1], [2, 1], [2, 2], [0, 2]],
    [[0, 0], [2, 0], [2, 2], [1, 2], [1, 1], [0, 1]],
    [[0, 0], [2, 0], [2, 1], [1, 1], [1, 2], [0, 2]]
]
let LEVEL_COL = [AZURE, PLUM, EMBER, GOLD]
let Tromino = |org, u, t, w = 3.5| Shape(
    map(ELL[to_int(t[2] + 2 * t[3])], |p| [org[0] + (t[0] + p[0]) * u, org[1] + (t[1] + p[1]) * u, 0]),
    LEVEL_COL[to_int(round(log2(t[4]))) - 1], 0.35, w
)
let Hole = |org, u, hx, hy| center{[org[0] + (hx + 0.5) * u, org[1] + (hy + 0.5) * u, 0]} fill{INK} stroke{INK, 1} Rect([u * 0.8, u * 0.8])
let Lines = |org, u, size| block {
    for (i in range(1, size)) {
        . Seg([org[0] + i * u, org[1], 0], [org[0] + i * u, org[1] + size * u, 0], MIST, 1.5)
        . Seg([org[0], org[1] + i * u, 0], [org[0] + size * u, org[1] + i * u, 0], MIST, 1.5)
    }
}
let Border = |org, u, size| Outline([org, [org[0] + size * u, org[1], 0], [org[0] + size * u, org[1] + size * u, 0], [org[0], org[1] + size * u, 0]], INK, 3.5)