Balls and scales (generalization)

43 Views Asked by At

A classical brain teaser is :

You have twelve balls identical in size and appearance but one ball is an odd weight (could be either light or heavy). You have a set of balance scales. How many steps are necessary to identify the odd ball and to say whether it is light or heavy?

The answer is $3$ steps, and the the solution is easily found on the web. But what if twelve is replaced by any number $N > 2$? Is there a general way to find the optimal number of steps?