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|