Two Bad Batches
The puzzle
Ten crates each hold many identical bolts. Good bolts weigh 10 g; bolts from a bad batch weigh 9 g. Exactly two of the ten crates are bad, and you do not know which.
You have a digital scale that reads a total weight, and you may use it once. How do you identify both bad crates?
Stuck?
One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.
Hint 1
The classic one-bad-crate version takes 1 bolt from crate 1, 2 from crate 2, and so on. Why does that fail with two bad crates?
Hint 2
You need every pair of crates to give a different shortfall. Which counts guarantee that?
Show the answer Hide the answer
Take 1, 2, 4, 8, 16, 32, 64, 128, 256 and 512 bolts from the ten crates. The shortfall in grams, written in binary, has a 1 in exactly the two positions of the bad crates.
How to get there
With counts 1, 2, 3, ..., 10 the shortfall is the sum of the two bad crates' numbers - and 3 + 8 = 4 + 7, so that scheme cannot tell those pairs apart. Consecutive counts are not enough.
Use powers of two instead. Every subset of {1, 2, 4, ..., 512} has a distinct sum, because a sum of distinct powers of two is just that number's binary representation. So the shortfall names the bad crates uniquely.
Concretely: 1 + 2 + ... + 512 = 1023 bolts, weighing 10230 g if all were good. If the scale reads 10230 - 72 = 10158, the shortfall is 72 = 64 + 8, so crates 7 and 4 are bad. The method also works unchanged if one, three or any number of crates is bad.
The technique worth keeping
When one measurement must identify a subset, give each item a weight that makes subset sums unique. Powers of two do this by construction, and the reading is then a binary answer sheet.