Every time a cashier hands you change, they solve a small puzzle: which coins add up to the amount owed, using as few coins as possible?
For the everyday euro or dollar, this feels effortless â you just grab the biggest coin that fits, then the next, and so on. But that easy feeling is misleading. The "fewest coins" question is a genuine optimization problem, and once the coin denominations stop being friendly, the obvious strategy can quietly give you the wrong answer.
In this article we'll start with the intuitive method, watch it fail on a simple example, and discover that the general version of "make change with the fewest coins" is one of those deceptively simple problems that sit right at the edge of what computers can solve efficiently.
Comments
Loading comments...