There is a king. He visits 4 temples one after another in his kingdom along with some of his followers. Each temple has 100 stairs. Upon reaching the gate of the first temple, he says, "Keep one coin on each stair as you move upwards. Give half of the remaining coins to the head of the temple. Repeat the same process as you come down and when you reach the point where you started off, give half of the remaining coins to the temple officials there." This whole process is followed for all temples. But his followers say that when they came down from the last temple and gave half of the remaining coins to the officials, they were left with nothing.
Calculate the original number of coins the king had.
Hint- Read the Title (Carefully) if you think that the problem is wrong!
This problem is a part of my set Different!
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
i had the same solution. but i stopped at (x-300)/4 = 0 then multiplied x by 4. i thought the process for all temples occurred simultaneously!
Let him start with x coins.
at the top of the first step, he will have (x-100)/2 coins.
now remove 100 from this and it becomes (x-100-200)/4 coins.
Now the denominator is not of any use as the final amount is zero.
now x would be 100+200+400+800+1600+3200+6400+12800=25500
The reason is that at each temple he loses coins twice and as he has to give half of it to the pundit and the officials.
so,at each temple the lost coins is 2 times i.e. 2 powers of 2 .
so we have 100(2^0+2^1+2^3+2^4+2^5+2^6+2^7)=25500
follow me for more solutions.
Bhai ye India hai, yahan paise lane se pehle chori ho jaate hain XD
BTW, You could do this by Reverse Engineering. Since any number when divided by 2 couldn't give 0, thus we can assume that when they came down from the stairs at the last temple, they already had nothing. Retracing their route by adding hundred and multiplying by 2 a couple of times, will give you the answer = 25500
Fml. First off who is a Pundit, I misunderstood it as a guy who travels with the group and takes money after every stairs! This would result in approximately around 2^800 coins, which is insane. Bad wording imo, then again I did get warned... then again you could just reword the problem instead of just typing a warning. It is not that hard... Since I gave up and couldn't post a solution, the answer is (2^(2x) - 1)*100 for x temples. The reverse engineering formula is *2 + 100, similar to the *2+1 which result in 2^x-1, only 100 times greater.
Log in to reply
Sorry for the 'Pundit' thing friend.Just rephrased it.
I think if anyone could explain it in a theoretical way, that would be great.
This is a very easy problem if you do it backwards. No algebra is required. Just basic addition and multiplication.
We see that the king exhausts his last coin coming down the stairs of the last temple. So run the videotape backwards: he finishes with 0 coins. That means he had 100 coins at the top of the last temple after he gave half away. Which means he 200 coins when he reached the top, before giving half away. Which means he had 300 before climbing the stairs. Which means he had 600 before giving half to the followers of the third temple, etc.
Simplifying: Let f ( x ) = x + 1 0 0 , and g ( x ) = 2 x . Each temple requires two alternating applications of g and f. Thus, we are looking for f ( g ( f ( g ( f ( g ( f ( g ( f ( g ( f ( g ( f ( g ( f ( g ( 0 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) Or, if that's too much of a mouthful, let h ( x ) = f ( g ( x ) ) = 2 x + 1 0 0 . We're looking for h 8 ( 0 ) .
Problem Loading...
Note Loading...
Set Loading...