Fewest weights when they may only go on one pan
A grocer's balance has two pans. The item being weighed always sits alone on the left pan, and the grocer piles reference weights on the right pan until the two sides balance. The grocer wants to be able to weigh any item of 1, 2, 3, ..., up to 63 grams exactly.
What is the smallest number of reference weights that makes this possible, and which weights should they be?
(If you know the classic version where weights may go on either pan, notice how the answer changes when that freedom is taken away.)
Show a hint
Each weight is either used or not used in a given weighing. How many different "use it or not" patterns do k weights have, and how many targets do you need to hit?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.