↑ ↓ to move · enter to open

007 · Puzzle · Number bases, counting

bachet's weights

What is the smallest set of weights that can measure every whole-pound load from 1 to 40 on a balance? Claude-Gaspard Bachet de Méziriac posed it in 1612. The answer is four weights, 1, 3, 9 and 27, and the reason is a number system where every digit is −1, 0 or +1.

LAB 1

the balance

The load sits on the left pan. Click a weight to move it: onto the right pan (against the load), onto the left pan (alongside the load), or back off the scale. A weight beside the load counts as negative, and that one trick is what makes four weights enough.

load 22 lb
22 lb
  • the thing being weighed
  • the weights (number = pounds)
  • green beam: balanced

Try this: drag Load to any value, then press Show the answer.

22
Left pan
0
Right pan
−22
Right − left

Now

The equation

LAB 2

balanced ternary

Write a number in base 3 using the digits −1, 0 and +1 instead of 0, 1 and 2. That is balanced ternary, and each digit tells you exactly where one weight goes: +1 on the right pan, −1 on the left pan, 0 off the scale.

22

Every load from 1 to 40click one to weigh it

Each cell lists the weights 27 · 9 · 3 · 1 as + right pan, − left pan, 0 off.

Converting, step by step22

The rule

n = 3q + r · r = 2 ⇒ digit −1, carry 1

Divide by 3 and keep the remainder as the next digit, like ordinary base 3. A remainder of 2 is the same as 3 − 1, so write −1 and add 1 to the quotient. In weights: instead of using the 1 twice, put the 3 on the right and the 1 next to the load.

The Setun computer, built at Moscow State University in 1958, did its arithmetic in balanced ternary. A nice feature: negating a number just flips every digit.

LAB 3

can you beat 1, 3, 9, 27?

Pick any four weights and the page checks every load from 1 up to their total. Try to cover more than 40 with no gaps. The counting argument below shows why nobody can.

Your weights
Try

How to read this: each box is one load, from 1 lb up to the total of your weights.

  • your four weights can measure it
  • they can't: a gap

Largest load reachable with k weightsno gaps from 1

How to read this: every load up to a bar's height can be weighed with no gaps; each grid line is 10 times the one below. The bright bar is the puzzle's four weights.

—
Loads you can weigh
—
Covers 1 to …

Why 40 is the ceiling

4 weights × 3 places = 3⁴ = 81 arrangements

Each weight goes right, left or off, giving 81 arrangements. One of them is "all off", which weighs 0. The other 80 come in mirror pairs, since swapping every weight's side flips the sign. That leaves at most 40 different positive loads. The weights 1, 3, 9, 27 hit all 40 with no repeats, so they are perfect.

With one pan only, each weight is simply on or off: 2⁴ − 1 = 15 loads at most, reached by 1, 2, 4, 8. That's binary.

The general formula

one pan: 2ᵏ − 1 two pans: (3ᵏ − 1) / 2

The weights are powers of 2 for one pan and powers of 3 for two. A fifth weight of 81 extends the two-pan range to 121.