Fascinating Offer for Greedy Kiddo

A shopkeeper sells 1 toffee for 1 Rs. and gives an amazing exchange offer that you can buy 1 toffee by 3 empty toffee wrappers. If you have 1729 Rs., then at maximum how many toffees can you grab from the shopkeeper?

Note : Rs. represents Rupees (Indian Money Currency).


Join the Brilliant Classes and enjoy the excellence. Also checkout Foundation Assignment #2 for JEE.


The answer is 2593.

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.

3 solutions

Sravanth C.
May 31, 2015

To start with, the kid buy's 1729 1729 chocolates with R s . 1729 Rs.1729 . And hence he will now have 1729 1729 wrappers.

According to the question the kid can buy 1 1 more chocolate with every 3 3 wrappers, so he can now buy 1729 3 \dfrac{1729}{3} chocolates.

But it leaves 1 1 as the remainder, so the kid can buy 576 576 chocolates.

Similarly, the remaining 576 576 wrappers, will get him 576 3 = 192 \dfrac{576}{3}=192 chocolates.

Moving on, he buys 64 64 chocolates, which will get him 64 3 = 21 \dfrac{64}{3}=21 chocolates, with a remainder of 1 1 wrapper.

Next, he can buy 21 7 = 7 \dfrac{21}{7}=7 chocolates with the 21 21 wrappers. Now, he uses the remaining 2 2 wrappers and gets 9 3 = 3 \dfrac{9}{3}=3 more chocolates.

At last, the Greedy Kiddo uses the last 3 3 wrappers to get 1 1 more chocolate.

So the maximum number of chocolates he can buy = 1729 + 576 + 192 + 64 + 21 + 7 + 3 + 1 = 2593 = 1729+576+192+64+21+7+3+1=\boxed{2593}

P.S: Please don't eat those many chocolates it can cause CAVITIES!

Moderator note:

Simple standard approach.

Actually, all this is done for your birthday. On your birthday, you plan to distribute toffees to the whole of your city (let with population 8000 people) , then how will you go for the equal distribution ? :P

Sandeep Bhardwaj - 6 years ago

Log in to reply

And then what's the probability of CAVITIES being caused ? :P

Sandeep Bhardwaj - 6 years ago

Log in to reply

Oh sir! Nice question, but that'll depend upon what type of teeth you will have, well if you want an absolute value here it is 0.061100 0.061100

P.S: Don't tell anyone that the value of probability is my D.O.B!

P.P.S: Sorry for a late reply, I am confined to a small screen, and FYI P.P.S literally means Post post script (said by @Andrei Golovanov in one of Nihar's questions.)

enjoy!

Sravanth C. - 6 years ago

Log in to reply

@Sravanth C. It's cool that your d.o.b. gives very less probability of having CAVITY.

So you were born on 06 November 0000. It's quite interesting. :P

Sandeep Bhardwaj - 6 years ago

Log in to reply

@Sandeep Bhardwaj Oh yes! And a lot more interesting if we place 2 2 in front of all those 0 s 0's :P

Sravanth C. - 6 years ago

Log in to reply

@Sravanth C. hahahaha.. One doing so ,it will become 20000. then I'd ask : do you own a time machine ? :P

Sandeep Bhardwaj - 6 years ago

Log in to reply

@Sandeep Bhardwaj And you might well ask, How can you comment! You must be V A N I S H E D ! ! ! \huge VANISHED!!! Ha ha ha. . .

Sravanth C. - 6 years ago

Nice question sir And 1729 is an amazing number.

Aditya Chauhan - 6 years ago

Log in to reply

yes...reaally...

Alex Koithodan - 5 years, 12 months ago

I think that it is 2592 :(

Vasu Sharma - 6 years ago

Log in to reply

Can you explain your statement sir? ¨ \huge\ddot\smile

Sravanth C. - 6 years ago

Log in to reply

1729 Toffees in 1729 Rs. then 576 toffees from 1728 wrappers .... 1 wrapper left then 192 toffees from 576 wrappers.... then 64 toffees from 192 wrappers then 21 toffees from 63 wrappers... 1 wrapper left then 7 toffees from 21 wrappers. Then 2 toffees from 6 wrappers ..... 1 wrapper left 1 toffee from 3 wrapper left... 1729+576+192+64+21+7+2+1=2592

Vasu Sharma - 6 years ago

Log in to reply

@Vasu Sharma Ah! I see that you've committed a small mistake, can you correct yourself? ¨ \huge\ddot\smile

Sravanth C. - 6 years ago

Log in to reply

@Sravanth C. What? I cant understand your's?

Vasu Sharma - 6 years ago

Log in to reply

@Vasu Sharma See that the question has asked "maximum number of chocolates the kid can buy". Your approach is absolutely fine, but there is another method to get more chocolates than yours(see my solution), I hope your doubt is clarified? ¨ \huge \ddot\smile

Sravanth C. - 6 years ago
Patrick Heebels
Jun 5, 2015

The answer is that with the given restrictions and the given exchange offer one can get 2593 sweets if one spends 1729 Rupees.

I was interested in generalizing the problem to any integral amount of Rupees 1 \geq 1 to start with.

For the first couple of integral Rupees we can easily figure out the maximum number of sweets that can be "bought" by hand and then seek the pattern. The first few ordered pairs (Rupees , Sweets) are:

( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 4 ) , ( 4 , 5 ) , ( 5 , 7 ) , ( 6 , 8 ) , ( 7 , 10 ) , ( 8 , 11 ) , ( 9 , 13 ) , ( 10 , 14 ) (1,1), (2,2), (3,4), (4,5), (5,7), (6,8), (7,10), (8,11), (9,13), (10,14)

The pattern is easily figured out and understood. The increase in the number of sweets is alternating 1 and 2 as the amount of Rupees steadily increases with 1.

If we only look at even Rupees amounts the sequence starts with 2 and increases with 1 + 2 = 3. As this series is a arithmetic sequence we therefore denote:

N = Rupees 2 with R = Rupees 2 N N = \lfloor \frac{ \text{Rupees} }{2} \rfloor \qquad \text{ with } \qquad R = \text{Rupees} - 2 \cdot N

This basically means that R is the remainder after division by 2.

Now the maximum number of sweets that can be bought with any integral amount of Rupees 1 \geq 1 is:

Sweets = 3 ( N 1 ) + 2 ( R + 1 ) \text{Sweets} = 3 \cdot (N - 1) + 2 \cdot (R + 1)

So if one spends 1729 Rupees on sweets then N = 1729 2 = 864 N = \lfloor \frac{1729}{2} \rfloor = 864 , R = 1729 2 864 = 1 R = 1729 - 2 \cdot 864 = 1 and therefore the maximum number of sweets that can be "bought" is:

Sweets = 3 ( 864 1 ) + 2 ( 1 + 1 ) = 3 863 + 2 2 = 2593 \text{Sweets} = 3 \cdot (864 - 1) + 2 \cdot (1 + 1) = 3 \cdot 863 + 2 \cdot 2 = 2593

ooh..sir....thts really cool and new way.thank you

Alex Koithodan - 5 years, 12 months ago
Falak Dhruve
Jun 3, 2015

1729 Rs. = 1729 toffees

1729 toffees = 1729 wrappers = 576 toffees + 1 ex1 wrapper

576 toffees = 576 wrappers = 192 toffees

192 toffees = 192 wrappers = 64 toffees

64 toffees = 64 wrappers = 21 toffees + 1 ex2 wrapper

21 toffees = 21 wrappers = 7 toffees

7 toffees = 7 wrappers = 2 penultimate toffees + 1 ex3 wrapper

1 ex1 wrapper + 1 ex2 wrapper + 1 ex3 wrapper = 3 wrappers = 1 ex toffee

1 ex toffee + 2 penultimate toffees = 3 toffees

3 toffees = 3 wrappers = 1 last toffee

Total toffees (sum of all the toffees in bold):

1729 + 576 + 192 + 64 + 21 + 7 + 3 + 1 = 2593 toffees

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...