Can You Find Heavy Ball in 2187 balls In Minimum Weigh? || Interview Puzzle

Puzzle Details

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

First, divide the group of 2187 into 3 groups of 729. Take two arbitrary groups and weigh them. Either they will be imbalanced (in which case you’ve identified the group with the heaviest ball), or they are equal, in which case you know the 3rd group has the heaviest ball.
Split the heaviest group of 729 into 3 groups of 243, and continue on. So first test 2187 balls, then 729, then 243, then 81, then 27, then 9, then 3 balls remaining. You can deduce which one is heaviest at this (7th) step in which 3 balls remaining.
Answer => 2187 => 3^7 => 7 times.

You may like these posts:

No comments:

Post a Comment