> For the complete documentation index, see [llms.txt](https://maksimdan.gitbook.io/interview-practice-problems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maksimdan.gitbook.io/interview-practice-problems/coding_practice_questions/math_and_puzzles/nine-balls.md).

# Nine Balls

**6.02: Nine Balls.** You have nine balls. Eight are of the same weight, and one is heavier. You are given a balance which tells you only whether the left side or the right side is heavier. Find the heavy ball in just two uses of the scale.

Weight 2 groups of 3. Set 1 group of 3 off to the side. Deduce heaviest group from first scaling. Weight last group of 3, weight 2 balls, set one off to the side. Deduce heaviest group.
