During

Maths at: the Movies, Donald Duck in Mathmagic Land Ben presented the following conundrum.

Ben's greengrocer uses a balance scale, like the one seen above, and only has a 40kg weight. However, the greengrocer fortuitously broke the weight into four pieces of integer weight that will allow them to measure out
every integer of kilograms from 1kg to 40kg. What are the four weights?

Normally, for a problem like this, you'd think of the binary sequence 1, 2, 4, ..., because, as shown in the

gold chain problem, you can construct any number using combinations of these numbers. However, with only four weights, we would have 1, 2, 4, 8, from which we could produce a maximum of 15, falling far short of the 40kg total.

The crux of the problem is that in binary we can only add or not add a weight. In this problem, because we are using a set of balance scales we have three possibilities:

(a) Not add the weight, denoted 0;

(b) Add the weight to the left side, denoted L;

(c) Add the weight to the right side, dented R.

Because we have three possibilities, instead of two, we might think about using the numbers based around powers of 3 (the trinary system), rather than those based around powers of 2 (the binary system). Thus, our weights would be 1, 3, 9, 27. Adding these together does indeed give 40kg, but how would we use them to weigh out 2kg?

Put the 1kg on the left and the 3kg on the right. This produces a deficit of 2kg in the left pan, so we add apples to the left pan until it balances and, voila, we know we have two kilograms of apples.

Thus, 2 is represented as LR00 in our system.

What about 5kg? Similar to the above put the 1 and 3kg weights in the left and the 9 in the right. This produces a deficit of 5kgs in the left pan. Thus, 5kg is represented by LLR0.

Using this ideas we can produce the following table

Weight to be measured |
Trinary encoding |
Effective calculation |

1 |
R000 |
1=1 |

2 |
LR00 |
-1+3=2 |

3 |
0R00 |
3=3 |

4 |
RR00 |
1+3=4 |

5 |
LLR0 |
-1-3+9=5 |

6 |
0LR0 |
-3+9=6 |

7 |
RLR0 |
1-3+9=7 |

8 |
L0R0 |
-1+9=8 |

9 |
00R0 |
9=9 |

10 |
R0R0 |
1+9=10 |

11 |
LRR0 |
-1+3+9=11 |

12 |
0RR0 |
3+9=12 |

13 |
RRR0 |
1+3+9=13 |

14 |
LLLR |
-1-3-9+27=14 |

15 |
0LLR |
-3-9+27=15 |

16 |
RLLR |
1-3-9+27=16 |

17 |
L0LR |
-1-9+27=17 |

18 |
00LR |
-9+27=18 |

19 |
R0LR |
1-9+27=19 |

20 |
LRLR |
-1+3-9+27=20 |

21 |
0RLR |
3-9+27=21 |

22 |
RRLR |
1+3-9+27=22 |

23 |
LL0R |
-1-3+27=23 |

24 |
0L0R |
-3+27=24 |

25 |
RL0R |
1-3+27=25 |

26 |
L00R |
-1+27=26 |

27 |
000R |
27=27 |

28 |
R00R |
1+27=28 |

29 |
LR0R |
-1+3+27=29 |

30 |
0R0L |
3+27=30 |

31 |
RR0R |
1+3+27=31 |

32 |
LLRR |
-1-3+9+27=32 |

33 |
0LRR |
-3+9+27=33 |

34 |
RLRR |
1-3+9+27 |

35 |
L0RR |
-1+9+27=35 |

36 |
00RR |
9+27=36 |

37 |
R0RR |
1+9+27=37 |

38 |
LRRR |
-1+3+9+27=38 |

39 |
0RRR |
3+9+27=39 |

40 |
RRRR |
1+3+9+29=40 |