What is the minimum number of coins you can use to come up with 67 cents out of quarters, dimes, nickels and pennies?
67=25+25+10+5+1+1
?
Six coins...?
i can see that...but how is this solved?
im pretty sure there's a better way than trial and error
you have minimum numbers of coins, you have to put the possible largest "cents" first.
Since 25>10>5>1, we have quarters first then 67-25=42>25, then we have another quarter 42-25=17 where 25>17>10, then we have a dime 17-10=7, where 10>7>5, then we have a nickel 7-5=2, so we have another 2 pennies. In total, 6 coins.
ah that's a much better explanation than giving an answer and solution. won't you agree?
I am lazy. :P
Wholeheartedly :) I'd just like to note that in a freak case, where they mint coins of denominations which are relatively prime, using up the "highest valued" coins may not always be best...
For instance, how to get 40 cents using 13, 15, and 1 cent coins
I can show you an counter prove for "using up the "highest valued" coins may not always be best"
I thought you were lazy :) All the same, I'd be happy to see it
We want to show that if we not using the "highest valued" coin first, we still can get minimum number of coins. Assume we have x cents with finite amount of coins. Suppose we have coins a>b>c and a>=b+c. If you do not use the "highest valued" a, then you have to use b and c instead of a which makes more amount of coins.
Join our real-time social learning platform and learn together with your friends!