Working Backward as a Problem-Solving Strategy
Learn to start from the goal and undo each step, with worked puzzles, a winning game strategy and the logical trap to avoid in proofs.
Key takeaways
- Working backward asks what the previous state must have been, repeating until you reach the known start.
- To undo a chain of operations, apply the inverse operations in reverse order.
- In games, labeling final positions first reveals which earlier positions are winning.
- In a proof, backward work finds the route, but the written argument must show that each step is valid going forward.
- The strategy is weaker when a step cannot be undone or the goal is vaguely described.
Working backward means starting from the result you want and asking what must have come just before it, then what came before that, until you reach something you already know. Often the path that is hidden from the start is obvious from the finish.
The method suits problems where the end state is clearly described, where each step can be undone, or where many choices open up at the beginning but only a few lead into the goal.
When to turn around
Picture a maze with one entrance fan of branching paths and a single narrow corridor into the treasure room. Tracing from the room outward is far quicker. Problems often have that shape.
Signs that backward work may help include:
- the final amount or position is given and the starting one is unknown;
- the steps are reversible operations such as adding, doubling or moving;
- the question asks how to reach a specific target;
- the thing to be proved can be rewritten into simpler and simpler statements.
George Pólya listed this idea among the classic tools for devising a plan, one of the stages in his four steps. The ancient Greek geometers used a related method called analysis: assume the thing sought, derive consequences until reaching something known and then reverse the reasoning.
Undoing a chain of operations
"I think of a number, multiply it by 3, add 5 and halve the result. I get 16. What was the number?"
Going forward you would need the unknown. Going backward, you undo each operation, last one first.
end: 16
undo halving: 16 × 2 = 32
undo adding 5: 32 − 5 = 27
undo tripling: 27 ÷ 3 = 9
check: 9 → 27 → 32 → 16 The order matters for the same reason you take off shoes before socks. If you did A, then B, then C, you must undo C, then B, then A.
This is exactly what solving a linear equation does. The line (3x + 5)/2 = 16 is the puzzle in symbols. In the language of functions, you are applying the inverse of a composition, which runs the individual inverses in reverse order.
The three gates
A traveler carries some apples through three gates. At each gate she must give the keeper half of her apples and then one more. After the third gate she has exactly 1 apple. How many did she start with?
At a gate, if she arrives with a apples, she leaves with a/2 − 1. To reverse this, if she leaves with b, she arrived with 2(b + 1).
| Point in the journey | Apples |
|---|---|
| After gate 3 | 1 |
| Before gate 3 | 2 × (1 + 1) = 4 |
| Before gate 2 | 2 × (4 + 1) = 10 |
| Before gate 1 | 2 × (10 + 1) = 22 |
Now run it forward as a check. From 22 she gives 11 and 1, leaving 10. From 10 she gives 5 and 1, leaving 4. From 4 she gives 2 and 1, leaving 1.
Notice that the reverse of "halve, then subtract 1" is "add 1, then double". Swapping the order of those two undoing steps gives wrong answers, and the forward check would catch it.
Percentages in reverse
A price was raised by 20%, then the new price was cut by 25%. The final price is $90. What was the original?
Each percentage change is a multiplication: a 20% rise multiplies by 1.2, and a 25% cut multiplies by 0.75. Undo them by dividing, in reverse order.
before the cut: 90 ÷ 0.75 = 120
before the rise: 120 ÷ 1.2 = 100
check: 100 × 1.2 = 120, and 120 × 0.75 = 90 The tempting error is to undo a 25% cut by adding 25%: 90 × 1.25 = 112.50, which is not 120. A percentage is always taken of some base amount, and the base for the cut was the larger price. This slip is common in real-life calculations, so it is worth checking forward every time.
Measuring with two jugs
You have a 3-liter jug, a 5-liter jug and a water tap. Neither jug has markings. Measure exactly 4 liters.
Start at the goal. The 4 liters must sit in the 5-liter jug. How could that happen in a single pour? One way is to begin with a full 5-liter jug and pour off exactly 1 liter. You can pour off exactly 1 liter if the small jug has room for exactly 1, which means it already holds 2.
So the new goal is 2 liters in the small jug. That can come from 2 liters left in the large jug and moved across. And 2 liters remain in the large jug when you fill it and pour 3 into the empty small jug. We have reached the starting position, so read the chain forward.
| Action | 3-liter jug | 5-liter jug |
|---|---|---|
| Fill the large jug | 0 | 5 |
| Pour large into small | 3 | 2 |
| Empty the small jug | 0 | 2 |
| Pour large into small | 2 | 0 |
| Fill the large jug | 2 | 5 |
| Pour large into small until full | 3 | 4 |
Each backward question had a short list of sensible answers, while a forward search offers many pointless moves, such as filling a jug and emptying it again. Where one backward answer leads nowhere, return and try another. The number theory behind which amounts are possible is explained in water jug puzzles.
Winning a counting game
Two players take turns removing 1, 2 or 3 counters from a pile of 21. Whoever takes the last counter wins. Should you go first, and what should you take?
The beginning offers a thicket of possibilities. The end is simple, so start there. Call a pile size winning if the player about to move can force a win, and losing otherwise.
- 0 counters: losing for the player to move, since the opponent just took the last one.
- 1, 2, 3: winning, because you can take them all.
- 4: losing, because every move leaves 1, 2 or 3 for your opponent.
- 5, 6, 7: winning, because you can leave 4.
- 8: losing, because every move leaves 5, 6 or 7.
The losing sizes are the multiples of 4. Since 21 is not one, go first, take 1 and leave 20. Afterward, whatever your opponent takes, take enough to make the two moves total 4. This method of reasoning from final positions is called backward induction, and it extends to the game of Nim and much of game theory.
Rule: remove 1, 2 or 3 counters; taking the last one wins.
The fewest steps to a target
Starting at 1, you may either add 1 or double. What is the fewest number of moves to reach 100?
Forward, the choices multiply rapidly. Backward from 100, the moves become "subtract 1" or "halve", and halving is possible only for even numbers.
100 → 50 → 25 → 24 → 12 → 6 → 3 → 2 → 1 That is 8 moves. Halving whenever the number is even turns out to be the best policy here. One way to confirm it is to write 100 in binary, 1100100: doubling appends a 0, and adding 1 turns a final 0 into a 1. Building this string from "1" takes 6 doublings and 2 additions.
A word of caution: grabbing the biggest backward step is not automatically optimal in other puzzles. With different allowed moves, a greedy choice can fail, so a claim of "fewest" needs its own argument.
Backward in proofs
Suppose you want to prove that for all numbers a ≥ 0 and b ≥ 0, (a + b)/2 ≥ √(ab). It is not clear where to start, so start at the goal.
want: (a + b)/2 ≥ √(ab)
⇔ a + b ≥ 2√(ab)
⇔ a − 2√(ab) + b ≥ 0
⇔ (√a − √b)² ≥ 0 true: a square is never negative Every line is connected by "if and only if", given a, b ≥ 0. So you can present the proof forward: begin with the square, expand it and rearrange.
Reversibility is essential. Reasoning from a goal to a true statement proves nothing if a step only goes one way. From the false claim 1 = −1, squaring gives the true statement 1 = 1, and squaring cannot be undone. This trap is examined in assuming what you want to prove.
The same pattern guides limit proofs. To make |(3x + 1) − 7| smaller than a positive number ε, note that it equals 3|x − 2|. So it suffices that |x − 2| < ε/3. You found the required closeness by working backward, and the proof then states it first.
Limits and combinations
Backward work stalls when a step destroys information. If a process rounds a number, or squares it without remembering the sign, several earlier states may lead to the same result. Then you must track all the possibilities or use another method.
It also pairs well with forward work. Push from the start as far as is easy, push from the goal as far as is easy and look for a meeting point. When you can state the gap precisely, for instance "I would be done if I knew this angle was 90°", you have replaced one hard problem with a smaller one.
For a practice habit, take any solved problem and ask what the final step was and what it needed. Then repeat the question. You are rehearsing the very move you will want the next time the start looks hopeless, alongside the other approaches in facing a problem you have never seen.