5 Jun
2003
5 Jun
'03
8:43 a.m.
Three integer coin values 1 < a < b will make optimal (smallest number of coins) change for all amounts using the greedy ("pick the largest possible coin first") algorithm if and only if there is an integer m so that Floor[b/m] = a. For example: A) The penny=1, nickel=a=5, dime=b=10 has m=2; but B) If the coin set 1, 3, 4 the greedy algorithm uses three coins to make change for 6 = 4 + 1+ 1 cents using the greedy algorithm, while the non-greedy choice 3+3 uses fewer coins. There is no integer m such that Floor[4/m] = 3. Is there a similar criterion for four coins 1 < a < b < c? Thane Plambeck 650 321 4884 office 650 323 4928 fax http://www.qxmail.com/home.htm