JOMO 6, Short 1

Sam has 143 diamonds. They are to be arranged into different boxes such that if Adi asks for any number of diamonds from 1 to 143, then Sam must be able to give them without opening any box (directly giving specific boxes). What is the minimum number of boxes Sam will need so that any number of diamonds can be given?


The answer is 8.

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.

4 solutions

Aditya Raut
Jul 11, 2014

We know that every number has a specific representation in Binary form.

For example, 14 14 in base 10 is 1110 1110 in base 2.

Thus we can write 14 14 as 2 3 + 2 2 + 2 1 2^3+2^2+2^1 . Like this , because each number has it's S p e c i f i c \color{#D61F06}{Specific} R e p r e s e n t a t i o n \color{#3D99F6}{Representation} and thus each number \color{#20A900}{\text{each number}} can be written as sum of powers of two.

Thus if you want all the numbers till 143 143 to be written as sum of boxes' numbers, then you must get the boxes as 2 0 , 2 1 , 2 3 , 2 4 , . . . 2^0 , 2^1,2^3,2^4,... until the sum doesn't exceed 143, i.e. you will have to take the powers of 2 till 2 6 = 64 2^6 =64 .

Here we use the result k = 0 n = 2 n + 1 1 \displaystyle \sum _{k=0} ^n = 2^{n+1}-1

Thus the sum of diamonds in the boxes till 64 is 127 127 .

Hence there are 143 127 = 16 143-127=16

Thus the boxes will have 1 , 2 , 4 , 8 , 16 , 32 , 64 and 16 1,2,4,8,16,32,64 \text{ and } 16 diamonds hence there will be 8 \boxed{8} boxes needed if you are to minimize the number of boxes.

Akhilesh Agrawal
Jul 11, 2014

By simple logic we can say that the first box must have 1 diamond and the second should have 2. now in such a way Aditya can give 1 or 2 or 3 diamonds to Sam.therefore the third box should have 4 diamonds.the fourth box should have 8 diamonds and so on.. The total number of boxes required is 8. So the number of diamonds in the boxes will be 1 , 2 , 4 , 8 , 16 , 32 , 64 , 16 1,2,4,8,16,32,64,16 ... note that 128 won't be there because then the sum of numbers exceeds 143.

Thus , the answer is number of boxes and it is 8 \boxed{8} .

How can you represent 140?

Nanayaranaraknas Vahdam - 6 years, 11 months ago

Log in to reply

Hello @Nanayaranaraknas Vahdam , note that because 140 > 127 140>127 , you have to use the last box which has 16 diamonds. So use it first, so your problem reduces to representing 124, and that is possible by 64 , 32 , 16 , 8 , 4 64,32,16,8,4 Thus you use all boxes e x c e p t \color{#D61F06}{except} the 1st and 2nd for representing 140. That's how the method works, a better explanation is given in my solution that will use Binary representation.

Aditya Raut - 6 years, 11 months ago
Venu Gopal
Jul 10, 2014

The general solution for N number of diamonds is

x such that 2 x 2^{x} -1 >=N

Explanation pls

Udit Murthy - 6 years, 11 months ago

Log in to reply

@Udit Murthy , see my solution up there for the explanation, it is explaining the concept...

Aditya Raut - 6 years, 11 months ago
Sajjan Barnwal
Jul 10, 2014

use binary

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...