Practice Discrete Math

Algorithms / Greedy Counterexamples

Least You Need to Know: Counterexamples to Tempting Greedy Rules

Many plausible greedy rules fail. The fastest way to disprove one is to build a small instance where the local rule makes an attractive first move but the final answer is worse than another feasible solution. Counterexamples are part of greedy mastery because they separate real proof from plausible storytelling.

The least you need to know

Key notation

counterexample one specific input where the claimed rule fails
feasible satisfies the constraints even if not optimal
tempting greedy rule a locally sensible but unproved choice rule

Tiny worked example

  • Consider coin systems where 'take the largest coin first' seems natural.
  • In a noncanonical system, that greedy rule may use more coins than another combination.
  • Listing both outcomes on one tiny amount is enough to disprove the rule.
  • No theorem can survive a single valid counterexample.

Common mistakes

How to recognize this kind of problem

Start practice