Money Lender
Jack and Johnny are sitting alone at a table. Johnny is broke. Jack aggrees to lend Johnny $186 consisting one each of $100, $50, $20, $10, $5 and $1 doller bills, if Johnny can determine how the money is passed to him given the following rules:
1. Only 1 bill may be passed at a time.
2. A bill may be passed from passed from Jack to Johnny, from Johnny to Jack, or placed on or taken from the table by either Jack or Johnny.
3. 0nly the smallest bill held can be passed or taken. (ie jack cannot get rid of the $5 if he has the $1 also. Johnny cannot take the $10 from the table if the table also has the $5 or the $1)
4. Jack, Johnny and the table can only receive a bill if they do not have a smaller bill already. (ie. if Johnny has the $10, he can only receive the $5 or the $1.)
-Euclid's Brother
1. Only 1 bill may be passed at a time.
2. A bill may be passed from passed from Jack to Johnny, from Johnny to Jack, or placed on or taken from the table by either Jack or Johnny.
3. 0nly the smallest bill held can be passed or taken. (ie jack cannot get rid of the $5 if he has the $1 also. Johnny cannot take the $10 from the table if the table also has the $5 or the $1)
4. Jack, Johnny and the table can only receive a bill if they do not have a smaller bill already. (ie. if Johnny has the $10, he can only receive the $5 or the $1.)
-Euclid's Brother
Labels: logic





16 Comments:
Jack gives Johnny $1, then $5, then $10, then $20, then $50, and finally, $100.
jack uses the table and johnny each on his turn as receptors of the others money. Nice!
Brinder, that breaks rule #4. Johnny wouldn't be able to receive anything after the $1.
Anon, you have to list all the steps. like
$1 from jack to ___-
$5 from ___ to ___
etc.. until Johnny holds all the money.
Jack gives johnny 1, then 5 then ten ect..
E
omg! he just said that that strategy doesnt work!
anyway, heres what i have so far:
1 from jack to table,
5 from jack to johnny,
1 from table to jack
5 from johnny to table
1 from jack to table,
10 from jack to johnny
1 from table to jack,
5 from table to johnny
thats all i have so far. ill keep trying.
~ghostrider655
thats all i have so far.
omg! he just said that that strategy doesnt work!
anyway, heres what i have so far:
1 from jack to table,
5 from jack to johnny,
1 from table to jack
5 from johnny to table
1 from jack to table,
10 from jack to johnny
1 from table to jack,
5 from table to johnny
thats all i have so far. ill keep trying.
~ghostrider655
thats all i have so far.
srry for the double post.
1 from jack to table,
5 from jack to johnny,
1 from table to jack
5 from johnny to table
1 from jack to table,
10 from jack to johnny
1 from table to jack
5 from table to johnny
1 from jack to table,
5 from johnny to jack,
1 from table to jack,
10 from johnny to table,
1 from jack to johnny,
5 from jack to table,
1 from johnny to table
20 from jack to johnny,
1 from table to jack,
5 from table to johnny,
1 from jack to table,
5 from johnny to jack,
i will keep at it tomorrow.
~ghostrider655
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to table
5 from johnny to jack
1 from table to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
20 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
20 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to table
5 from johnny to jack
1 from table to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
50 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
20 from johnny to table
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table100 from jack to johnny
1 from table to johnny
5 from table to jack
1 from johnny to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
20 from table to jack
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
50 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
20 from jack to johnny
1 from table to johnny
5 from table to jack
1 from johnny to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
Johnny now has everything!
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to table
5 from johnny to jack
1 from table to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
20 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
20 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to table
5 from johnny to jack
1 from table to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
50 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
20 from johnny to table
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
100 from jack to johnny
1 from table to johnny
5 from table to jack
1 from johnny to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
20 from table to jack
1 from johnny to jack
5 from johnny to table
1 from jack to table
10 from johnny to jack
1 from table to johnny
5 from table to jack
1 from johnny to jack
50 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
10 from jack to table
1 from johnny to jack
5 from johnny to table
1 from jack to table
20 from jack to johnny
1 from table to johnny
5 from table to jack
1 from johnny to jack
10 from table to johnny
1 from jack to table
5 from jack to johnny
1 from table to johnny
Johnny now has everything!
Last Anon..
Yep, your solution does indeed work within the rules.. Congratulations, your the official winner of this puzzle.
However, your 79 steps can be reduced to 63 steps. Your steps 4 thru 27 could be shorter. Your 1st 3 steps match mine and your step 28 to the end match mine.
I'll give time for you or someone else to figure out the shorter version, then I'll post mine.
It's the Towers of Hanoi problem with 6 disks, slightly disguised.
> perl -le "@n=qw(Jack Table Johnny); @d=(1, 5, 10, 20, 50, 100);$s = 0; sub solv {my ($n, $from, $to, $use) = @_; return if $n < 0;solv($n-1, $from, $use, $to);$s++; print qq<$s: move \$$d[$n] from $n[$from] to $n[$to]>; solv($n-1, $use, $to, $from)}; solv(5, 0, 2, 1)"
1: move $1 from Jack to Table
2: move $5 from Jack to Johnny
3: move $1 from Table to Johnny
4: move $10 from Jack to Table
5: move $1 from Johnny to Jack
6: move $5 from Johnny to Table
7: move $1 from Jack to Table
8: move $20 from Jack to Johnny
9: move $1 from Table to Johnny
10: move $5 from Table to Jack
11: move $1 from Johnny to Jack
12: move $10 from Table to Johnny
13: move $1 from Jack to Table
14: move $5 from Jack to Johnny
15: move $1 from Table to Johnny
16: move $50 from Jack to Table
17: move $1 from Johnny to Jack
18: move $5 from Johnny to Table
19: move $1 from Jack to Table
20: move $10 from Johnny to Jack
21: move $1 from Table to Johnny
22: move $5 from Table to Jack
23: move $1 from Johnny to Jack
24: move $20 from Johnny to Table
25: move $1 from Jack to Table
26: move $5 from Jack to Johnny
27: move $1 from Table to Johnny
28: move $10 from Jack to Table
29: move $1 from Johnny to Jack
30: move $5 from Johnny to Table
31: move $1 from Jack to Table
32: move $100 from Jack to Johnny
33: move $1 from Table to Johnny
34: move $5 from Table to Jack
35: move $1 from Johnny to Jack
36: move $10 from Table to Johnny
37: move $1 from Jack to Table
38: move $5 from Jack to Johnny
39: move $1 from Table to Johnny
40: move $20 from Table to Jack
41: move $1 from Johnny to Jack
42: move $5 from Johnny to Table
43: move $1 from Jack to Table
44: move $10 from Johnny to Jack
45: move $1 from Table to Johnny
46: move $5 from Table to Jack
47: move $1 from Johnny to Jack
48: move $50 from Table to Johnny
49: move $1 from Jack to Table
50: move $5 from Jack to Johnny
51: move $1 from Table to Johnny
52: move $10 from Jack to Table
53: move $1 from Johnny to Jack
54: move $5 from Johnny to Table
55: move $1 from Jack to Table
56: move $20 from Jack to Johnny
57: move $1 from Table to Johnny
58: move $5 from Table to Jack
59: move $1 from Johnny to Jack
60: move $10 from Table to Johnny
61: move $1 from Jack to Table
62: move $5 from Jack to Johnny
63: move $1 from Table to Johnny
Can't these posts be moderated to keep people from posting programs that find solutions? I even worked this out myself w/o the help of a computer... sheesh...
Kudo's to anyone who actually tried to work out the steps on there own..
Sorry, E.B. - no offense was intended.
I rather think that working out the algorithm and letting the comp do the tedious work is more valuable, since it can be used to solve a similar problem of any size - but it's your show.
Sorry, E.B. - no offense was intended.
I rather think that working out the algorithm and letting the comp do the tedious work is more valuable, since it can be used to solve a similar problem of any size - but it's your show.
well, you know i didnt get mine off the internet... because i didnt finish mine
=)
~ghostrider655
(if you want to know why i use this name, its because i use it for x-box live and a bunch of other stuff so its just easier this way.)
Computers were invented for a reason. So use em if it makes it easier. But make sure it list where u got ur work from. like if u did us a computer to make it easier be like YO, i use my computer to get the answer, cause if u dont say ne thing we assume u used ur brain with no help.
Post a Comment
Links to this post:
Create a Link
<< Home