To solve the 8 or 9 weights problem:
- Divide the balls into 3 groups of 3.
Example:
1, 2, 3 vs 4, 5, 6
Leaving 7, 8, 9
If both 1, 2, 3 and 4, 5, 6 are both the same weight, we know 7, 8, 9 one of them is the lighter ball.
If 1, 2, 3 is lighter than 4, 5, 6, we just weight 1 and 2 to each other. If 1 and 2 are the same weight, we know 3 is the heavy ball, and if either 1 or 2 is lighter than the other, then we know what is the lighter ball.