Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of pan balance
theincidentaleconomist.com
theincidentaleconomist.com
What method results in the fewest uses of the balance to separate them properly?
1. Split the 12 balls into 2 groups. Place the groups on the scale. The heavier group has the heavy ball.
2. Split the 6 balls from the heavy group into 2 groups. Place the groups on the scale. The heavier group has the heavy ball.
3. Take 2 of the remaining 3 balls, place them on the scale. If the scales are even, the heavy ball was left off the scale. If one side of the scale is heavier, that's the heavy ball.
when it is further specified that all remaining balls are of equal weight then your solution cannot be optimal since comparing two thirds yields the required information about the remaining third.
First, it is trivial to communicate the problem and any moderately competent person will find a solution within a short time frame. Second, it tests how precisely someone takes a problem definition. (In my experience, the kind of person who glances over such details will also tend to make trivial programming mistakes like off-by-ones.) Third, by varying a well-known question slightly you can easily filter out those who have simply learned the "correct" solution from the internet rather than thinking it through.
I found this one less intuitive; if you use the same algorithm as the 12 balls problem, it requires using the scale three times, which is one over the amount of times you're allowed to use the scale.
The key is that given there are 24 possibilities, and 3 possible outcomes from the scale, at each stage you must choose balls in order to maximize the amount of information gained.
After the first weighing, you've reduced the possibilities to 8 (whatever the outcome). Since, on the final weighing there are only 3 possible outcomes, you need to devise a second weighing that ensures that the 8 possibilities are split into 3,3,2 - (ie. no result of the second weighing can yield an outcome where more than 3 possibilities remain).
So the final constraint (not mentioned in the title) is to find out whether the anomalous ball is heavier or lighter than the rest.
That's where the third measure comes in.
Each experiment gives has 3 possible outcomes: left, right, and balanced. So in 2 experiments you can a maximum of 9 = 3*3 different outcomes. That's not enough to pick one ball out of 12.
If you have 3 experiments, you have 27 outcomes. You need 24 to tell which ball, + heavier/lighter, and 3 outcomes are impossible.
Edit: impossible or redundant, depending of your strategy.
If yes, care to give a hint? :P
(It's Exercise 4.13 in http://www.inference.phy.cam.ac.uk/mackay/itila/book.html ... and there is a solution and other related weighing problems in there.)