Puzzle visualization

5 bags, 3 possible coin weights, and a digital scale

Each bag contains 100 coins, and every coin in a bag weighs either 9 g, 10 g, or 11 g. We want to determine the weight of every bag using as few weighings as possible.

Bag weights ∈ {9, 10, 11} 5 bags ⇒ 3⁵ = 243 possibilities Minimum weighings = 1
Key idea
Balanced ternary

Take 1, 3, 9, 27, 81 coins from the five bags. If we treat 9 g = −1, 10 g = 0, and 11 g = +1 relative to 10 g, then the weight deviation becomes a unique 5-digit balanced-ternary number.

Interactive one-weighing experiment

Choose a hidden weight for each bag, then perform the single weighing.

Bag A · take
1 coin
Bag B · take
3 coins
Bag C · take
9 coins
Bag D · take
27 coins
Bag E · take
81 coins
Digital scale reading
1210 g
Baseline if every sampled coin were 10 g:
10 × (1 + 3 + 9 + 27 + 81) = 1210 g
Δ = 0 g

How to set up the weighing

Take 1 coin from Bag A, 3 from Bag B, 9 from Bag C, 27 from Bag D, and 81 from Bag E.

These are powers of 3, so each possible deviation can be decoded uniquely.

Decode the result

Write the deviation from 1210 g in balanced ternary, using digits −1, 0, +1.

Bag Coins taken Digit Meaning Contribution

Why one weighing is enough

Let each bag’s deviation from 10 g be:

d₀, d₁, d₂, d₃, d₄ ∈ {−1, 0, +1}

Then the total deviation from the baseline 1210 g is

Δ = d₀·1 + d₁·3 + d₂·9 + d₃·27 + d₄·81

This is exactly a balanced-ternary representation. Since every 5-digit balanced-ternary value is unique, all 3⁵ = 243 bag assignments produce different scale readings. So one weighing determines all five bag weights.

Also, zero weighings are impossible because there are 243 possible worlds and no information is obtained. Therefore, the minimum number of weighings is 1.

Possible assignments
243
Largest sample from one bag
81
Optimal number of weighings
1
Method used: balanced ternary with sample sizes 1, 3, 9, 27, 81.