- #1
Tony11235
- 255
- 0
Say we have a scale for weighing objects, contains two pans that are balanced.
Given a collection of objects of known weight we weigh an object by putting it in one pan and putting known weights in the other pan until the scale balances. It may happen to be that there is no way to do this if we may place the given weights only in one pan.
If we can place the weights in both pans what is the minimum number of weights necessary to weigh an object whose weight is an unknown integer n? Then find a good lower bound.
This is for my algorithms analysis class. It is probably easy, but I'm having trouble getting started. Has anybody had this type of problem before? I thought I once heard that if n is odd, then it's 3, but I wouldn't know why.
Given a collection of objects of known weight we weigh an object by putting it in one pan and putting known weights in the other pan until the scale balances. It may happen to be that there is no way to do this if we may place the given weights only in one pan.
If we can place the weights in both pans what is the minimum number of weights necessary to weigh an object whose weight is an unknown integer n? Then find a good lower bound.
This is for my algorithms analysis class. It is probably easy, but I'm having trouble getting started. Has anybody had this type of problem before? I thought I once heard that if n is odd, then it's 3, but I wouldn't know why.
Last edited: