## 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?

Zoso said...

10....very easy question

Secret SquÃ¯rrel said...

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.

Dhanraj said...
This comment has been removed by the author.
imran said...

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

Anonymous said...

@Imran

Anonymous said...

it's nine! just do the math yourself.

Prabhanjan said...

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