Thursday, 4 December 2014

mathematics - Paying the Troll toll


You are on your way to visit your Grandma, who lives at the end of the valley. It's her birthday, and you want to give her the cakes you've made.


Between your house and her house, you have to cross 7 bridges, and as it goes in the land of make believe, there is a troll under every bridge! Each troll, quite rightly, insists that you pay a troll toll. Before you can cross their bridge, you have to give them half of the cakes you are carrying, but as they are kind trolls, they each give you back a single cake.


How many cakes do you have to leave home with to make sure that you arrive at Grandma's with exactly 2 cakes?


EDIT : If you go to your grandma's with a half eaten cake, she's gonna be pissed. The trolls can't give you half a cake back. It is unhygienic and disgusting.



Answer




If you leave home with



2 cakes, you will never pay the troll toll. You give him half of your cakes (one) and he gives one cake back to you.



So the answer is



2.





The exact solution :



Assume we have $x$ cakes,



- after the 1st bridge, we have $\frac{x}{2}+1 = \frac{x+2}{2}$ cakes
- after the 2nd bridge, we have $\dfrac{\frac{x+2}{2}+2}{2} = \dfrac{x+2+4}{4}$ cakes
- after the 3rd bridge, we have $\dfrac{\frac{x+2+4}{4}+2}{2} = \dfrac{x+2+4+8}{8}$ cakes - ...
- after the nth bridge, we have $\frac{x+2+4+\dots+2^n}{2^n}$ cakes
- So, after the last bridge ($n=7$), we have $\frac{x+2+4+8+16+32+64+128}{128} = \frac{x+254}{128}$ cakes



According to the puzzle, we have




2 cakes at the end,



because:



$$ \frac{x+254}{128} = 2 \\\implies \boxed{x = 2}$$



So:



The answer is 2.




No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...