Hacker News new | ask | show | jobs
by maweaver 920 days ago
One issue they mention is that you lose the simple greedy algorithm for making change. For example, for $0.38 it's better to give 2x$0.18 plus 2 pennies (4 coins), but many might intuitively give back a quarter, a dime, and 3 pennies (5 coins). Besides the added complexity, introducing a new coin solely to reduce the amount of change given is not effective if it is not used optimally.
2 comments

0.38 should actually just be 0.40, possibly 0.35 if the seller's generous. in physical transactions nobody pays 3.1415926 dollars for anything, even if the pricing algorithm says that's what you should charge. you just round to the nearest available coinage.
2x$0.10 + 1x$0.18 is the preferred change.
And what algorithm did you use to find that? As per the comment you replied to, the greedy algorithm no longer works, and you have to exhaustively search through all possibilities of coins.
Not the OP, but they appear to use the classic change-making algorithm "Dimes are Best".

It works like this: give dimes for change, they're the best coin (highest value density).

Not in the system where the 10c is replaced by the 18c.