Making Change 1129
Roland Piquepaille writes "There are mostly four kinds of coins in circulation in the U.S: 1 cent, 5 cents, 10 cents, and 25 cents. But is it the most efficient way to give back change? This Science News article says that a computer scientist has found an answer. "For the current four-denomination system, [Jeffrey Shallit of the University of Waterloo] found that, on average, a change-maker must return 4.70 coins with every transaction. He discovered two sets of four denominations that minimize the transaction cost. The combination of 1 cent, 5 cents, 18 cents, and 25 cents requires only 3.89 coins in change per transaction, as does the combination of 1 cent, 5 cents, 18 cents, and 29 cents." He also found that change could be done more efficiently in Canada with the introduction of an 83-cent coin and in Europe with the addition of a 1.33- or 1.37-Euro coin. Check this column for more details and references." The paper (postscript) is online.
Or, even better ... (Score:3, Informative)
Re:Instead... (Score:5, Informative)
Re:Instead... (Score:4, Informative)
Its not up to the store, but the law. You must show the PST and GST on every sale in Canada. There was some debate a couple years ago about changing it to hidden costs, but that seems to have been quelled with recent wars and weed laws.
Re:I hate math... (Score:3, Informative)
I can't think of an example where that doesn't work in a 1,5,10,25 system, but it is definitely not a valid rule in general. For example in a 1,40,41 system you can give 80 cents change with two coins, but your method would use fourty coins.
-
18-cent is really a red herring - 2-cent works too (Score:5, Informative)
The article also assumes a uniform distribution of change between 1 and 99 - not likely, given how things work.
Just get rid of the pennies (Score:5, Informative)
The ticket price still reflects
.08,
.03,
It averages out over time, especially when you buy more than one item.
Re:Forget it. (Score:5, Informative)
Re:Canadiana (Score:3, Informative)
> In Canada, it's illegal to pay for any good or service, with more than 25 of any given denomination.
What he's talking about can be found in Section 8 of the Currency Act [justice.gc.ca].
Basically it is a no-nuisance law to stop people from doing things like pay fines using pennies. It doesn't say the money can be confiscated...
Many businesses will still except coins if they have been rolled. I know I have paid for movie tickes and extra value meals with rolls of nickles and dimes.
From the statute:
(2) A payment in coins referred to in subsection (1) is a legal tender for no more than the following amounts for the following denominations of coins:
-
Rod (Canadian)
Re:This is why Human Interface Design is important (Score:4, Informative)
No no no. Academia don't have to think about definitions. We just define it that way.
Be seriously, RTFA, people. The important part of this result is not that 18 or 83 cent recommendations. The author did it in jest in reference to the phrase "What this country needs is a good five cent cigar". (cited in the footnote of the paper). Just wait for
The important part of this paper is the second half, the general analysis of methods for finding "optimal" denominations or "optimal" change returns (the first defined to minimize the number of coins returned on average, the second defined as given a set denomination, finding the best way to represent a given amount). It gives asymtotic results. It is more of a computer science excercise then anything else.
W
Re:I hate math... (Score:3, Informative)
The reason you can't think of any examples in the 1,5,10,25 system is because 10 and 25 are both multiples of five. Therefore whatever you could make with a 25, you could also make with five 5s. So if you would ever have five 5s or two 5s, just use a 25 or a 10, respectively. In 1,40,41 system, 41 is not a multiple of 40 (or vice versa), so it makes finding the optimal number of coins a bit more difficult, since you have to find the optimal number of factors for your change given the different coins. In a 1,5,10,25 system, 5 is already a factor of the other important coins, so you can just count up how many 5s you'd need and then reduce that into 25s and 10s. (Of course the mind usually does it the other way round.)
I agree (Score:5, Informative)
Re:Instead... (Score:2, Informative)
Don't you think that the addition of sales tax already solves this problem?
On untaxed items (e.g. Groceries here in New York State) your explanation makes sense, but on most items we pay a sales tax somewhere between 4 and 9 percent, depending on the county and item. It almost always requires change.
Further, if your explanation were the correct one, then gasoline would not be priced such that it is always something and 9 mils (e.g. $1.529).
5?! -Interesting +Utter Crap (Score:5, Informative)
Re:Instead... (Score:3, Informative)
Re:Instead... (Score:5, Informative)
For cash transactions:
1 & 2 cents -- rounded DOWN to the nearest 10 cents
3 & 4 cents -- rounded UP to the nearest 5 cents
6 & 7 cents -- rounded DOWN to the nearest 5 cents
8 & 9 cents -- rounded UP to the nearest 10 cents
Rounding is on the total value of the bill. Individual items should never be rounded.
And where a consumer pays by cheque, credit card or EFTPOS (electronic transaction) there is no need to round at all.
So basically you win some and you lose some, but it evens out in the end. If you're really diligent, yes you can use it to your advantage, but most people have a life instead.
Re:Or, even better ... (Score:4, Informative)
optimization is no non-trivial (Score:2, Informative)
whereas with the US denomination (and most denominations are designed for this reason) you can use a greedy algorithm to give back change (always choose the largest coin possible, repeat) and you are guaranteed to be giving back the fewest coins.
you can prove that a greedy algorithm provides an optimal solution if the problem has optimal substructure and the greedy choice property.
To prove optimal substructure consider a collection of coins for an optimal solution, $c_1,
To prove the greedy choice property we must show that a globally optimal solution can be arrived at by making a locally optimal, this is, greedy, choice.
For this particular set of American denominations we can prove the greedy property with a proof by contradiction. If the greedy choice were not optimal there would be an optimal collection such that:
1. some set of dimes, nickels, pennies added to more than 25 cents or
2. some set of nickels, pennies added to more than 10 cents or
3. some set of pennies added to more than 5 cents
However, all of these situations are impossible. If some set of pennies add to more than 5 cents, simply replace 5 pennies with a nickel (the greedy algorithm is better). If some set of nickel and pennies add to more than 10 cents and if there are two nickels, replace them with a dime; If there are a nickel and the rest pennies,
replace a nickel and 5 pennies with a dime. The same holds for a quarter. If three dimes, replace it with a quarter and a nickel. If it's two dimes and nickel/pennies, replace it with a quarter. And so on... The property of the coins that results in the greedy property is that each coin denomination divides evenly into the next larger coin denomination. Therefore each larger coin denomination that is removed must be replaced by at least two additional coins.
With non-even denominations you are required to actually search an n^2 space for the correct set of denominations. in fact, the algorithm is:
$C(n) = 1 + min \{C(n-d_1), C(n-d_2),
Additionally, $C(n) = 0$ for $n = 0$. We can ignore $n 0$ are we just define $C(n 0) = \infty$. By building the array in time/size $\Theta(nk)$, and keeping track at each step which value of was chosen for the minimum, then we can list the coins by tracing backwards through these recorded values. This augmentation takes no additional time since it can be done during building the array in time $\Theta(1)$.
So, basically you've changed the problem from a linear time algorithm in the amount of change to a quadratic time algorithm in the amount of change...
GOOD LUCK WALMART EMPLOYEES!
Re:Pirates (Score:5, Informative)
And now you know.
Re:Minimize coins in pocket (Score:3, Informative)
Just as a note here, its probably not in their best interest to get back as many coins as possible.
I used to admin at a bank, and you are charged for "coin." This means the more you bring in which is unsorted, the more you are charged.
Of course, if they roll their coin then this is not a problem.
However, it would cost them more if they try to maximize their coin input without rolling.
Also, this is probably the most nit-picky post in my history of posting. God help us all.
Re:Pirates (Score:3, Informative)
Re:$0.99? (Score:5, Informative)
The origins of the pricing structure used date back to when the first cash registers were invented, that could print receipts for the company's own records (this was before the policy of giving a customer a receipt as well had been adopted). By using this sort of pricing, it was anticipated that the customer would probably be expecting change, and so the person operating the till would have to enter the transaction into the cash register in order to get the till drawer to open to collect the change. With a record of the transaction stored on a roll of paper inside the machine, the person operating the register could not simply pocket the money without being caught by the owner when the till contents was counted. By having the large, easily read numerals on the pop-up tabs on the register in plain view of the customer, a customer with nothing more than basic ciphering skills could easily and independantly calculate whether or not they would be getting back the correct amount of change, and could often be trusted to complain quite loudly if the person using the till did not give them back what they expected.
Re: Penny minting - Inflation? (Score:3, Informative)
Re:18, it's a magic number. (Score:3, Informative)