English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

place 2^^8 dollars in one bag 2^^7 in the next 2^^6 in the next etc. This gives you 9 bags that can be taken to give any amount up to 2^^9 -1 dollars = 511 dollars place the other 489 dollars in the tenth bag. To get the amount if under $512, simply convert the number to binary and select bags corresponding to Ones. For amounts over $512, use the tenth bag, subtract 489 from the number, and proceed as with the under $512 case

2007-02-08 12:58:38 · answer #1 · answered by walter_b_marvin 5 · 0 0

That doesn't make any sense. The bag has to be open if you're to get any money out! Do you mean the classic problem of dividing $1000 by whole dollars into 10 bags so that you can get any exact dollar amount of money between 1 and 1000 by picking a certain combination of bags?

I think if you just fill each bag with a binary base number until you have to dump the rest in bag 10, that should give you all combinations:

1, 2, 4, 8, 16, 32, 64, 128, 256, 489

The first 9 bags give you all combinations from 1 to 511. You can get from 489 to 1000 by taking the last bag plus some combination of the first 9 bags so that they add up 1000.

2007-02-08 21:09:11 · answer #2 · answered by Anonymous · 0 0

1 in the first bag (1 is available)
2 in the second bag (2 and 3 are available: 2, 1+2)
4 in the third bag (4, 5, 6, and 7 are available: 4, 4 + 1, 4 + 2, 4 + 3)
8 in the fourth bag (8, 9, 10, 11, 12, 13, 14, and 15 are available: 8, 8 + 1, 8 + 2, 8 + 1 + 2, 8 + 4, 8 + 4 + 1, 8 + 4 + 2, 8 + 4 + 1 + 2)
16 in the fifth bag (etc)
32 in the sixth bag
64 in the seventh bag
128 in the eighth bag
256 in the ninth bag
remainder (480) in the last bag

2007-02-08 21:04:07 · answer #3 · answered by J 2 · 0 0

You have to be more specific, but I think this is the answer you are looking for:
$1 in the first bag
$2 in the second
$4 in the third
$8 in the fourth
$16 in the fifth
$32 in the sixth
$64 in the seventh
$128 in the eight
$256 in the ninth
$489 in the tenth

Suppose you want $783, how will you get it?
Well, you take the tenth bag, the ninth, sixth, third and second.
489+256+32+4+2 = 783

2007-02-08 21:00:14 · answer #4 · answered by Anonymous · 0 0

1
2
4
8
16
32
64
128
256
489

Let's say someone wants 100 dollars. You give the bags that hold 64, 32, and 4 dollars.

2007-02-08 20:59:45 · answer #5 · answered by TychaBrahe 7 · 0 0

fedest.com, questions and answers