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.
2187 = 3^7
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 remain. You can deduce which one is heaviest at this (7th) step in which 3 balls remain.
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 firstname.lastname@example.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.
- Puzzle 63 | Paper ball and three friends
- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle | Find the last ball to remain after the entire process
- Puzzle | Minimum number steps to weigh 1 kg rice with 1gm weight
- In how many ways the ball will come back to the first boy after N turns
- Find the position of box which occupies the given ball
- Ways to choose balls such that at least one ball is chosen
- Find out the correct position of the ball after shuffling
- Find closest integer with the same weight
- Number of N digit integers with weight W
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 85 | Chain Link Puzzle
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle | 3 Priests and 3 devils Puzzle