There are a lot of things wrong with self-checkout machines. They are every bit as unpleasant as a vending machine. They are confrontational (“Item removed from bagging area!“). The speed and volume of the recorded speech is calibrated for the mildly retarded and partially deaf. Feeding them bills and coins is a frustratingly slow process. They don’t offer advice or tell you what’s on sale. They deprive you of a reasonable and pleasant human interaction that might ordinarily benefit both parties.

By far the most annoying feature of self-checkout machines is the change mechanism. I would like to meet the engineers who designed these things. Almost all human cashiers will dispense change in a way that maximizes the coins of highest value and thereby minimizes the total number of coins. This is called a “greedy algorithm” and it works because the denominations of US currency were well-chosen.1

The machine at CVS was dispensing 2–3 nickels at a time, which will never result in a minimum coin count. Perhaps, I figured, the machine was using a different but still customer-friendly algorithm: minimizing the total weight of the change. How would that work? Using weights published on the US Mint Web site, I wrote a couple of quick Python scripts to help me understand the difference between the minimized-count and minimized-weight approaches. It turns out that for values between 30–34, 40–44, 55–70, 80–84, and 90–94 cents, they do differ. But the improvement comes from higher numbers of dimes, which are the lightest of the coins. In neither case will an optimum coin distribution contain more than 1 nickel.

This self-checkout change dispenser is controlled by some other approach. But what? Maximizing the time between refilling the machine with coins? Further study is required. But it’s clear to me that these machines are not working with my interests in mind. When you relinquish a perfectly reasonable job to a computer, I suppose one should expect no sympathy from the machine.


  1. A 2003 paper by Jeffrey Shallit points out that Americans could make change with, on average, 17% fewer coins by replacing the dime with a 18-cent coin.