For diddlers everywhere I have created the virtual ball-puzzle scale. You can test out your solution systems. Or just mess around. It's so much fun, I would not be afraid to call it mildly interesting.

During a recent bit of downtime, I came across this post about a type of puzzle programmers sometimes get asked during a job interview.

The gist of the puzzle is given n apparently identical balls and a simple scale, how many weighings would it take to find the ball with a mass different from the others.

There is an easier version of the puzzle where the odd ball is guaranteed to be heavier than the others. And a harder version were the odd ball can be either heavier or lighter.

Before, I never had the patience to figure out the answer to this sort of puzzle, but using this tool, I have come up with a general solution when n < 4.