December 15, 2008

302 dollar problem



You are having $302 with you. Divide $302 (in whole $ increments)
into a number of bags so that I can ask for any amount between
$1 and $302, and you can give me the proper amount by giving me
a certain number of these bags without opening them. What is the
minimum number of bags you will require?

7 comments:

  1. 10....very easy question

    ReplyDelete
  2. Er...no.

    8 bags is sufficient to measure out any amount up to $255 in $1 increments. The 8 bags contain $1, 2, 4, 8, 16, 32, 64, & 128. The remaining $47 simply goes in a 9th bag.

    So 9 bags is the answer.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. 9 bag is sufficient
    we see the bag contains no of amount is:$1,$2,$4,$8,$16,$32,$64,$125,$256

    ReplyDelete
  5. @Imran

    Your bags add to more than $302.

    ReplyDelete
  6. it's nine! just do the math yourself.

    ReplyDelete
  7. Total 18 bags required.

    1+2+4+8+16+32+64+128 = 255 (8 bags)
    1+2+4+8+16 = 31 (5 bags)
    1+2+4+8 = 15 (4 bags)
    1 = 1 (1 bag)
    ----- ---
    302 coins 18 bags

    ReplyDelete