Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Puzzle | 8 balls problem

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Puzzle: You are provided with 8 identical balls and a measuring instrument. 7 of the eight balls are equal in weight and one of the eight given balls is defective and weighs less. The task is to find the defective ball in exactly two measurements.

Solution:

  • Step 1: Divide the balls into three categories(C1, C2 and C3).
    • Let C1 consist of balls B1, B2 and B3.
    • Let C2 consist of balls B4, B5 and B6.
    • Let C3 consist of balls B7 and B8.

  • Step 2: Put C1 on one side of the weighing machine and C2 on the other.
    This can give rise to 3 conditions:

    1. Condition 1: C1 equals C2
    2. Condition 2: C1 < C2
    3. Condition 3: C1 > C2

Now let’s analyse the three conditions to find the defective ball:

  • Condition 1: If C1 is equal C2, then C3 has the defective ball. Now measure the weights of ball B7 and B8.
    • If B7 < B8, B7 is defective
    • If B7 > B8, B8 is defective.

  • Condition 2: If C1 < C2, then C1 has the defective ball. Now measure the weights of ball B1 and B2.
    • If B1 equals B2, B3 is defective.
    • If B1 < B2, B1 is defective.
    • If B1 > B2, B2 is defective.

  • Condition 3: If C1 > C2, then C2 has the defective ball. Now measure the weights of ball B4 and B5.
    • If B4 equals B5, B6 is defective.
    • If B4 < B5, B4 is defective.
    • If B4 > B5, B5 is defective.

    • My Personal Notes arrow_drop_up
Last Updated : 18 Jan, 2023
Like Article
Save Article
Similar Reads