3 ms·
> 16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by us
by aneesh 18y ago
> 16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?
Take (any) 6 of the balls, and divide into 2 groups of 3. Weigh the groups of 3 against each other on the balance.
If one group is heavier: The heavier ball is in that group of 3. So take (any) 2 of the 3 balls in that group, and weigh them. If either is heavier, you've found the heavy ball. If those two weigh the same, the 3rd ball is the heavy one
If both groups weigh the same: The heavy ball is one of the remaining 2 balls. Weigh those two to see which is heavier.
Given n weighings you can actually identify the heavy ball out of a group of upto 3^n balls.
- dangoldin 18y agoI like this question because of you word it slightly differently, you get an entirely different answer. If you remove the condition that one of the balls is heavier and just say that one of the balls weighs differently, instead of slightly more, you can no longer solve it in 2 weightings. In an interview, you can follow up the listed question with this one to see the response.
- jcl 18y agoBy the same token, the pirate question in the article is worded incorrectly for its proposed solution. If, as the problem is usually posed, all pirates get to vote on a division of loot, then the lead pirate can indeed get away with the hinted 98 coins. But the article says that "the other pirates get to vote on his plan and if fewer than half agree with him...", implying that the lead pirate does not get to vote. The solution requires different logic -- I think the best the lead pirate can do in this case is 97 coins.