Log in

View Full Version : Troll and little red riding hood


galactus
Jun 14, 2007, 11:12 AM
Here's a fun little problem if anyine would like to have a go. It's not too bad.

Maybe you've seen it before, if so, maybe those who haven't will find it fun.

"Little Red Riding Hood is walking to her grandmother's house. She crosses a
bridge and a troll tells her to pay 1/2 of all her apples and 1/2 of one
apple. At each bridge there is a troll asking for the same thing. There are
three bridges. When she gets to her grandmother's house, she has no apples
left. How many apples did she start with"

Capuchin
Jun 14, 2007, 11:51 AM
7? Just a first guess.

Lowtax4eva
Jun 14, 2007, 11:59 AM
I figured 5 actually

Edit, nope, it's 7 you were right

galactus
Jun 14, 2007, 12:05 PM
I realize this problem isn't that difficult. I just thought it was cute.

But, why doesn't someone post their solution instead of just the answer? Go ahead. Different methods is what's interesting.

asterisk_man
Jun 14, 2007, 12:08 PM
I cheated with maxima so highlight the text below to see a cheater's answer :)

---start hidden---

at each bridge she will start with a apples and end with 0.5a-0.5 apples so the troll function is:
t(a)=0.5a-0.5=(a-1)/2
so if she starts with a_0 apples she ends with a_3=t(t(t(a_0)))
if you do all the math and set a_3=0 and solve for a_0 you'll find that

a_0=7

in maxima:
t(a):=(a-1)/2
y:t(t(t(a)))
solve(y=0,a)

---end hidden---

Lowtax4eva
Jun 14, 2007, 12:25 PM
Lol

What's maxima? I assume a program that solves math functions?

Lowtax4eva
Jun 14, 2007, 12:27 PM
I just assumed in order to end with zero he has to arrive at the last bridge with one apple (1/2 of all he has plus 1/2 is one apple)

Going backwards I then saw he has to arrive at the second bridge with 3, giving the troll 2 (1/2 of all he has plus a half is 2).

Same for the first, he has to leave with 3 so he has to arrive with 7, (half of all be has plus a half is 4)

asterisk_man
Jun 14, 2007, 12:56 PM
lol

What's maxima? I assume a program that solves math functions?

Maxima is an open source computer algebra system.
Maxima - A GPL CAS based on DOE-MACSYMA (http://maxima.sourceforge.net/)