News for hackers. Stuff that matters.
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by 16s on Saturday June 25, 2011 @09:14PM (#2697107)
I recall that the puzzle says "one ball is heavier than the others" not "one ball is a different weight". That being the case, here is the solution:

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.

Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by omnigoat on Saturday June 25, 2011 @09:15PM (#2697109)
That is a different and far easier question. Try and work out the stated question, "heavier or lighter".
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by thisisfmu on Saturday June 25, 2011 @09:55PM (#2697164)
this is incorrect. the sum of n>1 balls each of some non-maximum weight needs not be less than another set including the max-weight one.
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by seabee on Saturday June 25, 2011 @10:01PM (#2697176)
But if the cardinality of the sets are equal, as is the case in each step of the solution, the set containing the max-weight ball is necessarily heavier. Can you explain further?
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by thisisfmu on Saturday June 25, 2011 @10:22PM (#2697214)
consider the following example where the condition "one ball is heavier than the others" holds true but your method yields the wrong solution: {1,10} vs {6,6}

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.

Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by thisisfmu on Sunday June 26, 2011 @02:17PM (#2698625)
downvoter dumb. no hire.
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by seabee on Sunday June 26, 2011 @09:49PM (#2699750)
I didn't downvote you, but I think they object to your overly literal interpretation of "one ball is heavier than the others" given it was contrasted with the original phrasing "one ball is a different weight". This is a math puzzle, not a lateral thinking puzzle.
Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by thisisfmu on Monday June 27, 2011 @12:38AM (#2700135)
Not to draw this out further but I do think variations of these make for good interview questions for entry-level people. Here is why:

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.

Re:Good puzzle: 12 balls, 1 a diff weight, find in 3 uses of... by 16s on Saturday June 25, 2011 @10:10PM (#2697192)
Odd. I think it's correct... which step is incorrect?