# Puzzle 11 | (1000 Coins and 10 Bags)

A dealer has 1000 coins and 10 bags. He has to divide the coins over the ten bags, so that he can make any number of coins simply by handing over a few bags. How must divide his money into the ten bags?

**Solution:**

We can represent any decimal number as weights of binary system. For example, if we want to measure upto 7, first three bags are sufficient.

1 = 2^0

2 = 2^1

3 = 2^0 + 2^1

4 = 2^2

5 = 2^2 + 2^0

6 = 2^2 + 2^1

7 = 2^2 + 2^1 + 2^0

It can be easily generalized. We can measure upto 2^n – 1.

Fun is, we can also measure the same using powers of 3. For example, we have bags with 1, 3 and 9 coins,

1 = 1

2 = 3-1

3 = 3

4 = 3+1

5 = 9-3-1

6 = 9-3

7 = 9+1-3

8 = 9 -1

9 = 9

10 = 9+1

11 = 9+3-1

12 = 9+3

13 = 9+3+1

From 14 onwards next bag comes into picture.

Factorization algorithms other than powers of 2 are costly on computer systems. Please share any other information. Any person working on cryptography can share more details.

Source: https://www.geeksforgeeks.org/forums/topic/1000-coins-and-10-bags/

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

## Recommended Posts:

- Puzzle 1 | (How to Measure 45 minutes using two identical wires?)
- Puzzle 2 | (Find ages of daughters)
- Puzzle 3 | (Calculate total distance travelled by bee)
- Puzzle 4 | (Pay an employee using a 7 units gold rod?)
- Puzzle 13 | (100 Prisoners with Red/Black Hats)
- Puzzle 5 | (Finding the poisoned wine)
- Puzzle 6 | (Monty Hall problem)
- Puzzle 7 | (3 Bulbs and 3 Switches)
- Puzzle 8 | (Find the Jar with contaminated pills)
- Puzzle 9 | (Find the fastest 3 horses)
- Puzzle 10 | (A Man with Medical Condition and 2 Pills)
- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle 14 | (Strategy for a 2 Player Coin Game)
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle 17 | (Ratio of Boys and Girls in a Country where people want only boys)