Every greedy correctness proof in this unit — Dijkstra's, the MST cut property, interval scheduling — followed the identical logical shape: assume an optimal solution doesn't make the greedy choice, then show it can be modified (an "exchange") to include that choice without making it worse. This note names that shape explicitly as the exchange-argument template, then does something the previous, more optimistic lessons haven't: applies the same reasoning attempt to a problem where it fails — 0/1 knapsack — to build the instinct for recognising when greedy is unsafe, not just when it works.
In this lesson
- Learning objectives
- The exchange-argument template
- Confirming the template on known-good cases
- Where the template fails: 0/1 knapsack
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.