Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

Charlie and the Chocolate Factory

Charlie once visited chocolate factory to buy some chocolates.Chocolate cost Rs. 3 each and he had only Rs. 45.He was disappointed. He wanted more. But when he reached the factory he was amazed. There was a scheme on that special day. If you return 3 wrappers of the chocolate you will get one chocolate for free. So how many chocolates can he buy?

Charlie has Rs. 45 and each chocolate cost Rs. 3. So he buys only 15. But there is a scheme. He will return 15 wrappers and get 5 chocolates free. Then he will return 3 out of 5 and get one free. And he will again use one wrapper with the remaining 2 to get one more.

So 15+5+1+1 = 22.

Comments


KUNWAR UTKARSH

22


RAMS

ju


Mahmoud El-Banna

22


Urvesh Devani

22 and 1 wrapper left

15 chocolates from 45 Rs. generates 15 wrappers => 5 more chocolates generates 5wrappers => 1 more chocolate + 2 wrappers generates 1 more wrapper => 3 wrappers=> 1 more chocolate 1 wrapper left

  

Ravi

Urvesh, there's a Show Solution button to check if your solution is correct!

  

Urvesh Devani

yep! forgot to see that. . . :P


blingo

Nice to find a formula for the general case whereas there's 'n' instead of '45'...

  

Alexander Bjørndal

Sum of (n/3^i) from i = 0 to i = ∞ But it gives 22.5 for 45

  

Alexander Bjørndal

The formula is incorrect ... It assumes that money and wrappers can be used together to buy new chocolate


Ligin Vellakkad

22


Mudaser Ali
  • 15 ( 45 / 3) remainder = 0
  • 5 (15 / 3) remainder = 0
  • 1 ( 5 / 3) remainder 2
  • 1 (1 + 2 from above)

Total: 22


Srikanth Ayalasomayajulu

22


hardikasawa

21

  

hardikasawa

22 actually.. didn't realize in end he will have 2 wrappers + 1 chocolate => 3 chocolates..


Ashutosh

its -: 15+5+1+1


Sukesh Pabba

22 Chocolates And 1 wrapper is left


Sourabh

22


Tarun245

22 chocolates and 1 wrapper left


Alexander Bjørndal

How about this?

<span class="spoiler"><sup class="spoiler_label"> spoiler</sup>\sum_{i \mathop =0}^{∞}n/3^i</span>

Vishal barot

good one just needs patience.


Adrean Palma

Actually, he can only buy 15 chocolates...the others are free.


Yoshi Gillaspie

A ruby solution. You could also build in different wrapper trade in ratios or different costs of chocolate bars.

class Buyer attrreader :chocbars def initialize(cash = 45, choc_bars = 0)

@cash = cash
@choc_bars = choc_bars

end

def getdatchocolate

spend_monies
trade_in_wrappers

end

private def tradeinwrappers

wrappers = @choc_bars
until wrappers <= 2
  # 3 for 1 more bar w/wrapper: 3 - 1 = 2
  wrappers -= 2
  @choc_bars += 1
end
@choc_bars

end

def spend_monies

@choc_bars += (@cash / 3)
@cash -= (@cash % 3)

end end

x = Buyer.new x.getdatchocolate


Justyn Feeney

The real answer should be 15... He can only BUY 15.. the last 7 he got free for trading in wrappers.


ashutosh aggarwal

22


Josh Homer

He can only BUY 15. The other 7 he gets are free as per the parameters of the question.


Sarath Varun

Rs. 45 = Rs.3 * 15 Chocolates 15 Chocolates = 15 Wrappers 3 Wrappers = 1 Chocolate 15 Wrappers = 5 Chocolates.. so totally 20 CHOCOLATES...!!!


Sarath Varun

Rs. 45 = Rs.3 * 15 Chocolates 15 Chocolates = 15 Wrappers 3 Wrappers = 1 Chocolate 15 Wrappers = 5 Chocolate(3 Wrappers = 1 Chocolates.)..

15+5+1+1=22 so totally 22 CHOCOLATES...!!!


Vivek Agarwal

22


Sankhadeep

22


Anutharsha

22

Check out other puzzles:
Random  

Like this? You might also like:
Survivor
Mutilated Chessboard Problem
How many?2
Submitted by
Mikit Kanakia
almost 4 years ago
Likes
Difficulty 2.4 ?

Tags
logic Maths Puzzle


Back