** Puzzle:** There are 2187 balls, out of which 1 is heavy. Find the minimum number of attempts the balls have to be weighed for finding out the heavy ball.

** Solution: **The minimum amount of measurements needed to be done will be equal to 7 times.

2187 = 3^7

**Step 1:**Divide the 2187 balls into 3 equal groups of 729 each, let’s say C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 1 follows up, and C3 has the heaviest ball.

**Step 2:**Now divide C3 again into 3 equal groups of 243 each, naming them again C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 2 follows up, and C2 has the heaviest ball.

**Step 3:**Now divide C2 again into 3 equal groups of 81 each, naming them again C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 3 follows up, and C1 has the heaviest ball.

**Step 4:**Now divide C1 again into 3 equal groups of 27 each, naming them again C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 3 follows up, and C1 has the heaviest ball.

**Step 5:**Now divide C1 again into 3 equal groups of 9 each, naming them again C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 1 follows up, and C3 has the heaviest ball.

**Step 6:**Now divide C3 again into 3 equal groups of 3 each, naming them again C1, C2 and C3. Put C1 on one side of the weighing machine and C2 on the other. This can give rise to 3 conditions:- Condition 1: C1 equals C2, which means C3 has the heaviest ball
- Condition 2: C1 < C2, which means C2 has the heaviest ball.
- Condition 3: C1 > C2, which means C1 has the heaviest ball.

Let’s suppose Condition 1 follows up, and C3 has the heaviest ball.

**Step 7:**Now finally divide C3 which has 3 balls into group of 1, naming them again B1, B2 and B3. Put B1 on one side of the weighing machine and B2 on the other. This can give rise to 3 conditions:- Condition 1: B1 equals B2, which means B3 has the heaviest ball
- Condition 2: B1 < B2, which means B2 has the heaviest ball.
- Condition 3: B1 > B2, which means B1 has the heaviest ball.

Let’s suppose Condition 1 follows up, then B3 is the heaviest ball we were looking for.

- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle 63 | Paper ball and three friends
- Puzzle | Find the last ball to remain after the entire process
- Puzzle | Minimum number steps to weigh 1 kg rice with 1gm weight
- Find out the correct position of the ball after shuffling
- Find the position of box which occupies the given ball
- Ways to choose balls such that at least one ball is chosen
- In how many ways the ball will come back to the first boy after N turns
- Find total no of collisions taking place between the balls in which initial direction of each ball is given
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 28 | (Newspaper Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 38 | (Tic Tac Toe Puzzle)
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution

So, in all, it takes 7 steps to reach to the heaviest ball.

This article is contributed by **Shubham Singh**. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.