You have 8 identical balls. 7 weigh the same, 1 is heavier. Using a balance scale only twice, find the heavy ball.
You have 8 identical balls. 7 weigh the same, 1 is heavier. Using a balance scale only twice, find the heavy ball.
Approach: Divide balls into groups of 3,3,2.
First weigh: 3 vs 3. If equal, heavy is in remaining 2; second weigh finds it. If one side heavier, take those 3. Second weigh: 1 vs 1 from heavy group; if equal, third ball is heavy, else scale shows heavy.
Follow-up: What if you don't know if heavy or light?
Key concepts: balance scale, information theory, ternary search.