You have a weighing balance, which you can place weights on both sides of. You need to measure all weights between 1 and 1000.
For example if you have weights 1 and 3, you can measure test objects of weights 1, 3 or 4. You can also measure objects of weight 2, by placing 3 on one side and 1 on the side which contain the object to be weighed.
What is the minimum number of weights that you would need to be able to measure all (integral) weights from 1 kg to 1000 kg?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
that's nice
The weights are
1,3,9,27,84,243,729
So a total of 7
The weights intrestingly come out to be a GP of common ratio 3 with the first term as 1
Please post your solution if u could do it via computer program or algebraically :)
Log in to reply
We all agree that using weights that are powers of 3 are to be used, i.e.
3 0 = 1 , 3 1 = 3 , 3 2 = 9 , etc...
We need as many weights such that:
k = 0 ∑ n 3 k ≥ 1 0 0 0 ⇒
3 − 1 3 n + 1 − 1 ≥ 1 0 0 0 ⇒
n ≥ lo g 3 ( 2 ⋅ 1 0 0 0 + 1 ) − 1 ≈ 5 . 9 1 9
Therefore the smallest integer n that satisfies the inequality is n = 6 .
However that means that we need weights that weigh:
3 0 , 3 1 , 3 2 , … , 3 6
This means that a total of 6 + 1 = 7 weights are required.
The answer is 7 , it's okay.
But with 1 , 3 , 9 , 2 7 , 8 4 , 2 4 3 , 7 2 9 , you won't be able to make 4 1 kg, 4 2 kg and 4 3 kg.
We can generalize the problem for 1 to n , then have the solution to the generalized problem as follows.
Consider the recurrence relation f p = 3 f p − 1 + 1 , for p ≥ 1 , with the initial condition f 0 = 0 .
Then it can be proved that
The minimum number of weights that you would need to be able to measure all (integral) weights from 1 kg to n kg is the minimum positive integer p such that f p ≥ n ; suggesting the a th weight (in increasing order) is ( 2 f a − 1 + 1 ) kg, for ( a ≥ 1 ).
As here n = 1 0 0 0 , with 3 6 < n < 3 7 , I didn't bother to find a closed form of the recurrence relation.
Now, f 0 = 0 , f 1 = 1 , f 2 = 4 , f 3 = 1 3 , f 4 = 4 0 , f 5 = 1 2 1 , f 6 = 3 6 4 , f 7 = 1 0 9 3 ... ... ...
7 is the answer.
And the weights are: w 1 = 1 , w 2 = 3 , w 3 = 9 , w 4 = 2 7 , w 5 = 8 1 , w 6 = 2 4 3 , w 7 = 7 2 9 , but for n = 1 0 0 0 , any value of w 7 with 5 1 7 ≤ w 7 ≤ 7 2 9 works.
The closed form is ⌈ lo g b lo g n ⌉ where b the base (3 in this case).
Problem Loading...
Note Loading...
Set Loading...
Note that 7 weights work. Let the weights be 1 , 3 , 9 , 2 7 , 8 1 , 2 4 3 , 7 2 9 --the powers of 3 . We can represent the weight we want to measure in balanced ternary --a positional numeral system that uses the digits − 1 , 0 , 1 instead of the usual 0 , 1 , 2 for ternary. Then, for every digit 1 , we put the appropriate weight on the opposite side, while for every digit − 1 , we put the appropriate weight on the same side.
For example, 2 3 1 0 = 1 0 T T b t , where b t stands for "balanced ternary" and T stands for the digit − 1 . Thus to measure a weight of 2 3 units, we put the 1 -unit weight on the same pan (because the first digit from the right is T ); we put the 3 -unit weight also on the same pan (the second digit is T ); we don't use the 9 -unit weight (the third digit is 0 ); and we put the 2 7 -unit weight on the opposite pan (the fourth digit is 1 ). Checking that this is a correct measurement is left to the reader.
The largest weight that can be measured is 1 1 1 1 1 1 1 b t = 1 0 9 3 1 0 , so we can measure up to 1 0 9 3 units.This is more than enough.
Now, suppose that we have only 6 weights. Then there are at most 3 6 = 7 2 9 cases that we can distinguish: each weight has 3 places to put (on the same pan, on the opposite pan, or not on the balance), and there are 6 weights. But we need to distinguish 1 0 0 0 cases, impossible. Thus 6 weights don't suffice, and clearly neither do a smaller number of weights. Thus we have proven that 7 weights is the minimum.
Further reading: Wikipedia