There are N=2^n bags of rice looking alike, N-1 of which have equal weight and one is slightly heavier. The weighing balance is of unlimited capacity. Using the balance, the minimum number of weighing required to identify the heavier bag is?
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers56
Suggested Problems
-
Return the 3n+1 sequence for n
8487 Solvers
-
Remove any row in which a NaN appears
8768 Solvers
-
Who knows the last digit of pi?
689 Solvers
-
185 Solvers
-
Is this triangle right-angled?
6532 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think it only takes 5 weighings when N=128. Am I incorrect?
agree 5 weighing for N=128 (worst case scenario you reduce to 43 15 5 2 1 after each consecutive weighing)
the last test case provided by the author is wrong: should be 5 since log(128)/log(3) < 5.
The problem is that the author do not specify an strategy. And as mentioned, dividing by 3 yields a better strategy than 6 weightings for 128. But, my guess is that the author counted the number of divisions instead of the number of weightings 128->[42 42 43] -> [14 14 14; 14 14 15]->[5 5 4; 5 5 5]->[2 2 0; 2 2 1]->[1;2]->1.