Some of the bags are fake, still one weighing
You have ten large bags of coins. A genuine coin weighs exactly 10 grams; a fake weighs 11 grams. Each bag is either entirely genuine or entirely fake, and any number of the bags could be fake, from none of them to all ten. You have a digital scale that gives an exact reading, but you may use it only once.
In the well-known version of this puzzle exactly one bag is fake and you take 1 coin from bag 1, 2 from bag 2, and so on. Here that no longer works: two fake bags could produce the same excess as a single different bag.
How do you identify exactly which bags are fake with a single weighing?
Show a hint
You need a set of "coin counts" in which every possible subset adds up to a different total. Powers of two have exactly that property.
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.