Sobes.tech
Senior

There are 9 billiard balls, all look the same, but one is slightly heavier than the others. There are mechanical scales with two pans. The goal is to determine the heaviest ball with the minimum number of weighings.

sobes.tech AI

Answer from AI

Minimum number of weighings — 2.

Algorithm:

  1. Divide the 9 balls into 3 groups of 3 balls each.
  2. Weigh two groups of 3 balls against each other.
    • If the scales balance, the heavy ball is in the third group.
    • If not, the heavy ball is in the heavier group.
  3. Take the identified group of 3 balls and weigh any two of them against each other.
    • If one side is heavier, the heavy ball is found.
    • If they balance, the heavy ball is the third, unweighed ball.

Example:

Balls: A, B, C, D, E, F, G, H, I
Weighing: (A, B, C) against (D, E, F)
- If equal, heavy in (G, H, I)
- Otherwise, heavy in the heavier group

Then weigh two balls from the identified triplet, for example G against H
- If equal, heavy is I
- Otherwise, the heavier one is the heavy ball
There are 9 billiard balls, all look the same, but… - sobes.tech