Comments on: Divide one dollar into 14 coins.
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins/
Comments on Ask MetaFilter post Divide one dollar into 14 coins.Tue, 14 Mar 2006 17:50:28 -0800Tue, 14 Mar 2006 17:50:28 -0800en-ushttp://blogs.law.harvard.edu/tech/rss60Question: Divide one dollar into 14 coins.
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins
What's the easiest way to figure out this fourth-grade math question? Divide one dollar into 14 U.S. coins. post:ask.metafilter.com,2006:site.34351Tue, 14 Mar 2006 17:47:38 -0800soiled cowboymathBy: deadfather
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535775
Get a handful of change?<br>
<br>
Or did you want the answer?comment:ask.metafilter.com,2006:site.34351-535775Tue, 14 Mar 2006 17:50:28 -0800deadfatherBy: billysumday
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535776
Trial and error would seem to be the fastest way. Configuring an equation would take much longer.comment:ask.metafilter.com,2006:site.34351-535776Tue, 14 Mar 2006 17:51:39 -0800billysumdayBy: keep it tight
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535778
10 pennies, 1 nickel, 1 dime, 1 quarter, and 1 half dollar = $1comment:ask.metafilter.com,2006:site.34351-535778Tue, 14 Mar 2006 17:54:11 -0800keep it tightBy: deadfather
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535780
I just figured it out by working backwards, starting with the smallest denomination. Figure out if using one particular coin won't work no matter what. Then do trial and error, converging on the answer.comment:ask.metafilter.com,2006:site.34351-535780Tue, 14 Mar 2006 17:54:22 -0800deadfatherBy: deadfather
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535782
There's another answer besides keep it tight's.comment:ask.metafilter.com,2006:site.34351-535782Tue, 14 Mar 2006 17:55:21 -0800deadfatherBy: meerkatty
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535785
I did it in 10 seconds just by dividing the dollar into dimes, then replacing as many dimes as needed with nickels to make the number 14 instead of 10 coins.<br>
So 6 dimes and 8 nickels.<br>
But if you want an equation, no idea.comment:ask.metafilter.com,2006:site.34351-535785Tue, 14 Mar 2006 17:55:54 -0800meerkattyBy: jozxyqk
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535786
I don't think this sort of problem is presented so that you can come up with some sort of complex equation. I think, rather, it's to teach you to think quickly about how to make change, to prepare you for your thankless minimum-wage cashier job when you're in high school. :)comment:ask.metafilter.com,2006:site.34351-535786Tue, 14 Mar 2006 17:57:53 -0800jozxyqkBy: soiled cowboy
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535787
I was wondering if there was an equation to do this, but I guess, as billysumday said, trial and error is the easiest way.comment:ask.metafilter.com,2006:site.34351-535787Tue, 14 Mar 2006 17:58:02 -0800soiled cowboyBy: knave
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535788
One obvious rule is you are either going to use 0, 5, or 10 pennies.<br>
<br>
I came up with:<br>
5 pennies, 2 nickes, 6 dimes, 1 quarter<br>
<br>
Basically trial and error.comment:ask.metafilter.com,2006:site.34351-535788Tue, 14 Mar 2006 17:58:24 -0800knaveBy: jellicle
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535789
Well, the easiest way is probably to start trying plausible combinations. I see three answers above already.<br>
<br>
A more sophisticated way would be to write out the equations and solve them:<br>
<br>
50a + 25b + 10c + 5d + 1e = 100<br>
a+ b + c + d + e = 14<br>
<br>
Two equations, five variables = multiple solutions.comment:ask.metafilter.com,2006:site.34351-535789Tue, 14 Mar 2006 18:01:43 -0800jellicleBy: soiled cowboy
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535790
<em>One obvious rule is you are either going to use 0, 5, or 10 pennies.</em><br>
<br>
Unless, as meerkatty pointed out, you don't use pennies. So that's not really a rule, but another way to go about it.comment:ask.metafilter.com,2006:site.34351-535790Tue, 14 Mar 2006 18:01:55 -0800soiled cowboyBy: mto
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535795
2 dimes 11 nickels, 1 quarter<br>
6 dimes 8 nickels<br>
5 pennies, 2 dimes, 5 nickels, 2 quarters<br>
5 pennies, 6 dimes, 2 nickels, 1 quartercomment:ask.metafilter.com,2006:site.34351-535795Tue, 14 Mar 2006 18:08:45 -0800mtoBy: andrew cooke
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535797
this is very similar to a <a href="http://en.wikipedia.org/wiki/Packing_problem">packing problem</a>. in general, these tend to be "hard" (more exactly, there's no simple formula for finding the answer, but once you have the answer it's easy to check). the most famous is probably the <a href="http://en.wikipedia.org/wiki/Knapsack_problem">knapsack problem</a>.<br>
<br>
however, having said that, it's not exactly the same as the packing problems i know - it has a fixed number of components for example - so it may be that in this case there is a simple solution.comment:ask.metafilter.com,2006:site.34351-535797Tue, 14 Mar 2006 18:10:22 -0800andrew cookeBy: knave
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535798
<i>Unless, as meerkatty pointed out, you don't use pennies. So that's not really a rule, but another way to go about it.</i><br>
<br>
0, 5, or 10.comment:ask.metafilter.com,2006:site.34351-535798Tue, 14 Mar 2006 18:11:11 -0800knaveBy: mto
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535801
oh, I forgot to post my "solution". I just cheated and used code, which I knew would be possible because the values involved were tiny. Even the dumb algorithm I used only loops 537824 times, which is nothing for a modern computer.<br>
<br>
Ruby:<br>
for p in 0..14<br>
for n in 0..14<br>
for d in 0..14<br>
for q in 0..14<br>
next unless p+n+d+q == 14<br>
next unless p+5*n+10*d+25*q == 100<br>
puts "#{p} pennies, #{n} nickels, #{d} dimes, #{q} quarters\n"<br>
end<br>
end<br>
end<br>
endcomment:ask.metafilter.com,2006:site.34351-535801Tue, 14 Mar 2006 18:16:22 -0800mtoBy: soiled cowboy
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535804
<em>0, 5, or 10.</em><br>
<br>
Oh. uh... Right.comment:ask.metafilter.com,2006:site.34351-535804Tue, 14 Mar 2006 18:18:57 -0800soiled cowboyBy: neda
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535806
<a href="http://mathforum.org/library/drmath/view/57992.html">Mathforum </a>addressed this problem, except it was dividing the dollar into 25 coins.comment:ask.metafilter.com,2006:site.34351-535806Tue, 14 Mar 2006 18:22:27 -0800nedaBy: weapons-grade pandemonium
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535808
Five pennies and nine nickels make one Barbados dollar.<br>
<small><small>Didn't say the <em>dollar </em>had to be American.</small></small>comment:ask.metafilter.com,2006:site.34351-535808Tue, 14 Mar 2006 18:25:05 -0800weapons-grade pandemoniumBy: flod
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535828
It would appear that the easiest way to figure it out is to post it to AskMefi.comment:ask.metafilter.com,2006:site.34351-535828Tue, 14 Mar 2006 19:00:56 -0800flodBy: forrest
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535887
Start with jellicle's equations:<br>
50H + 25Q + 10D + 5N + P = 100, H + Q + D + N + P = 14<br>
<br>
List all possible values of each coin:<br>
H: 0 1<br>
Q: 0 1 2 3<br>
D: 0 1 2 3 4 5 6 7 8 9<br>
N: 0 1 2 3 4 5 6 7 8 9 10 11 12 13<br>
P: 0 5 10<br>
<br>
Since the nickel, quarter and penny represent odd values, the sum of the nickels, quarters and pennies must be even.<br>
<br>
The trick is to choose values, either arbitrarily or by elimination, and to reduce the number of unknowns in jellicle's equations to 2 unknowns.<br>
<br>
A quick look at the table above eliminates several values (e.g., 13 nickels is 65 cents and there's no such thing as a 35 cent coin, so 13 nickels is impossible), and the new table is:<br>
<br>
H: 0 1<br>
Q: 0 1 2<br>
D: 0 1 2 3 4 5 6<br>
N: 0 1 2 3 4 5 6 7 8 9 10 11<br>
P: 0 5 10<br>
<br>
There are only two cases for H: none or one. If we choose the case where H=1, jellicle's equations become: <br>
25Q + 10D + 5N + P = 50, Q + D + N + P = 13<br>
<br>
and the table becomes:<br>
H=1:<br>
Q: 0 1<br>
D: 0 1 2 3 4<br>
N: 0 1 2 3 4 5 6 7 8 9<br>
P: 0 5 10<br>
<br>
On this branch, the choices for Q are none or one. In the case where Q = 1, the equations reduce to:<br>
10D + 5N + P = 25, D + N + P = 12 and the sum of N + P must now be odd. The new table is:<br>
<br>
H=1, Q=1:<br>
D: 0 1 2<br>
N: 0 1 2 3 4 5<br>
P: 0 5 10<br>
<br>
The solutions can now be found by inspection. With zero dimes, there is only one combination of nickels (2) and pennies (10) that adds to 12 coins, but that doesn't add up to 25 cents. With two diimes, there are no combinations of nickels and pennies that produce 10 coins adding up to 5 cents. With one dime, there is only one combination of nickels (1) and pennies (10) that produce 12 coins that add up to 25 cents. From this branch, we get one solution of one half-dollar, one quarter, one dime, one nickel, and 10 pennies, which time is tight has already found.<br>
<br>
Repeated traverses down the branches of the tree, eliminating possible choices and using jellicle's equations should produce all the solutions for this problem. Not as elegant as a set of equations, but not quite brute force, either.comment:ask.metafilter.com,2006:site.34351-535887Tue, 14 Mar 2006 20:06:17 -0800forrestBy: middleclasstool
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535903
forrest may very well have been my data structures professor. His tree-structured algorithm's the best way to hit all possible combinations in the most efficient manner.comment:ask.metafilter.com,2006:site.34351-535903Tue, 14 Mar 2006 20:22:36 -0800middleclasstoolBy: user92371
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535925
I did it the way a fourth-grader would do it -- I went to the drug store and asked change for a dollar while picking my nose.<br>
<br>
"Here you go."<br>
"NOOOOO! FOURTEEN!"<br>
<br>
So the cashier took it back and gave me a quarter and started putting nickels on the conveyor belt and I counted them as I picked them up. <br>
<br>
"twelve, thirteen, fourteen, fiveteen, sixteen ..."<br>
<br>
So I gave back the last four nickels and got two dimes instead. Then I stopped picking my nose and left.comment:ask.metafilter.com,2006:site.34351-535925Tue, 14 Mar 2006 20:52:08 -0800user92371By: blenderfish
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#535990
> this is very similar to a packing problem. in general, these <br>
> tend to be "hard" (more exactly, there's no simple formula <br>
> for finding the answer, but once you have the answer it's <br>
> easy to check). the most famous is probably the<br>
> knapsack problem.<br>
<br>
Yep, I'd call this a packing problem. However, since, in this particular problem, each element in the set is larger than the sum of all smaller items in the set, this becomes a "superincreasing" packing problem. These tend to be much easier to solve. (google for "superincreasing knapsack problem")<br>
<br>
If the nickel were, say 7 cents, the dime 11, and the quarter 15, this could be a lot more challenging!comment:ask.metafilter.com,2006:site.34351-535990Tue, 14 Mar 2006 23:09:40 -0800blenderfishBy: faceonmars
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#536002
eight nickels and six dimes. fourteen coins. The average coin is seven cents. Try to deviate from that as little as possible.comment:ask.metafilter.com,2006:site.34351-536002Tue, 14 Mar 2006 23:46:07 -0800faceonmarsBy: pracowity
http://ask.metafilter.com/34351/Divide-one-dollar-into-14-coins#536028
I see <a href="http://www.coinpeople.com/index.php?s=f86edf6005ce40fbfa287038c4df22af&showforum=86">a few more options</a>.comment:ask.metafilter.com,2006:site.34351-536028Wed, 15 Mar 2006 00:39:37 -0800pracowity