$$\left(\left(\left(\mathrm{ERROR}\right)\,{ and }\,\left(\mathrm{ERROR}\right)\right)\,{ and }\,\left(\mathrm{ERROR}\right)\right)\,{ and }\,\left(\mathrm{ERROR}\right) = \left(\left(\underset{{\tiny{\text{Error: Unknown Function 'bin_and'}}}}{\left(\mathrm{ERROR}\right)\,{ and }\,\left(\mathrm{ERROR}\right)}\right)\,{ and }\,\left(\mathrm{ERROR}\right)\right)\,{ and }\,\left(\mathrm{ERROR}\right)$$
It can be done with seven weights, and I would guess that this is the optimum, but apart from it being obvious ????? I don't know how to prove it.
As Heureka points out, weights of 1 and 3 allow us to get to 4. We now need to cater for 5 and this can be done (optimally) with a weight of 9 since the 4 can be used for subtraction. Also by subtraction we can get 6,7 and 8. Moving on from 9, the 1 and 3 allow to get to 13, and the next weight we need to worry about is 14.
Using the subtraction method again, we can get 14 using a weight of 27, (27 in one pan and 1+3+9=13 in the other), and since all weights from 1 to 13 are already available, the other weights from 15 to 26 can be formed. That takes us upto 40, 1+3+9+27=40.
To get 41 a weight of 81 wiil do, (81 in one pan and 40 in the other), and the intervening weights will be covered also.
It seems fairly clear now that we are going up through the powers of 3, in which case in addition to 1, 3, 9, a 27 and 81, we need 243 and 729.
Your Question for all:
You can place weights on both side of weighing balance and you need
to measure all weights between 1 and 1000.
For example if you have weights 1 and 3,now you can measure 1,3 and 4
like earlier case, and also you can measure 2,by placing 3 on one side
and 1 on the side which contain the substance to be weighed.
So question again is how many minimum weights and of
what denominations you need to measure all weights from 1kg to 1000kg.
It can be done with seven weights, and I would guess that this is the optimum, but apart from it being obvious ????? I don't know how to prove it.
As Heureka points out, weights of 1 and 3 allow us to get to 4. We now need to cater for 5 and this can be done (optimally) with a weight of 9 since the 4 can be used for subtraction. Also by subtraction we can get 6,7 and 8. Moving on from 9, the 1 and 3 allow to get to 13, and the next weight we need to worry about is 14.
Using the subtraction method again, we can get 14 using a weight of 27, (27 in one pan and 1+3+9=13 in the other), and since all weights from 1 to 13 are already available, the other weights from 15 to 26 can be formed. That takes us upto 40, 1+3+9+27=40.
To get 41 a weight of 81 wiil do, (81 in one pan and 40 in the other), and the intervening weights will be covered also.
It seems fairly clear now that we are going up through the powers of 3, in which case in addition to 1, 3, 9, a 27 and 81, we need 243 and 729.