Who loves chocolates?

Logic Level 2

A young boy enters a shop to buy 200 chocolates. When the shopkeeper saw the young boy, he made a deal with the boy that for every "2 empty chocolate covers" he brings back, the shopkeeper said he will take the covers and give 1 chocolate in return. Now what is the maximum number chocolates the boy can get ?

Example if the boy buys 4 chocolates -> 4 covers -> 2 chocolates-> 2 covers-> 1 chocolate, therefore with 4 chocolates he can buy a maximum of 7 chocolates.


The answer is 399.

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.

1 solution

Chris Lewis
Mar 15, 2021

The boy starts with 200 chocolates, from which he gets 200 wrappers. These are swapped for 100 chocolates, then the same for 50 then 25 .

At this point, he can trade in 24 wrappers to get 12 new chocolates. The trick is that he keeps the extra wrapper here.

As before, now, he gets 6 then 3 chocolates. After eating these 3, he has their wrappers plus the spare one from before, so he can get another 2 and finally 1 chocolate.

The total of these is 200 + 100 + 50 + 25 + 12 + 6 + 3 + 2 + 1 = 399 200+100+50+25+12+6+3+2+1=\boxed{399} chocolates.

Bonus: if the boy initially buys n n chocolates, is there a simple formula for the maximum number of chocolates he can get? Can you prove it?

Chris Lewis - 2 months, 4 weeks ago

Log in to reply

Yea , it will be 2n-1 by simple induction

Omek K - 2 months, 4 weeks ago

ans: n+n-1

Elijah Frank - 2 months, 4 weeks ago

Log in to reply

sorry, I didn't notice Omek answer (the same)

Elijah Frank - 2 months, 4 weeks ago

to overcomplicated the situation: if n is even then f(n) = n+ if the next is odd when n is divisible by 2 -> ((n/2)-1) otherwise -> ((n/2)) +...+ = max chocolates. if n is odd then f(n) = n + if the next is odd when n isn't divisible by 2 -> ((n-1)/2) otherwise -> ((n/2)) +...+ = max chocolates.

Elijah Frank - 2 months, 4 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...