25. THE RIGHT SCALES
As I remember, my old friend Mr Bachet the chemist used a simple balance to weigh out his chemicals. He had six different weights which he could place in the left pan – let me see now, there was a 2 gram weight, and a 16, a 9 gram weight and a 4, an 8 gram weight, and ... oh yes! a tiny 1 gram weight. Yes! That’s right. And with these weights he could weigh any amount up to 40 grams.
Then one day this brash young salesman came in and greatly upset Mr Bachet by telling him he was out of date and old-fashioned, and that if he had six decent weights he could weigh much larger quantities.
My friend suffered a fatal heart attach shortly afterwards, and I have often wondered since then whether the salesman was telling the truth. Are there really six weights which when placed in various combinations in the left pan will weigh any amount up to – who knows?
The wrong scales!
Hint 1
Can you weigh all weights up to 40 grams with Mr Bachet's weights?
Hint 2
Now try to find a smallest set of weights for weighing small quantities: 1, 2, 3, 4, ... . Can you see a pattern here?
Solution
It quickly becomes apparent that powers of 3 provide the answer to this problem. In fact Mr Bachet could weigh any weight from 1 to 40 with just the four weights 1, 3, 9, and 27.
In ternary notation, any positive integer N can be expressed as a combination of powers of 3:
N = a..1 + b.3 + c 32 + d.33 + ...
where the coefficients a, b, c, d, ... are 0 or ±1.
So with weights 1 (= 30), 3, 32, 33, ...the coefficient 0 means don't use the weight at all, coefficient –1 means use the left pan, coefficient +1 means use the right pan. In our example with weights 1, 3, 9, 27 we can weigh all weights from 1 through to 1 + 3 + 9 + 27 = 40. This generalizes easily. And since every integer occurs, and occurs just once, we can’t expect to do any better than this.
Extensions
1. What happens if there is just a single pan? This is a little easier!
2. Read up about number systems with various bases.
3. Our own number system has base 10. Why is this? would there be any advantage in using base 8 or base 12?
Hint 1
Hint 2
Solution
Extensions