N marbles puzzle: find the heaviest among them. Suppose there are $N$ marbles and a two-pan balance used to compare the weight of 2 things. All of the marbles weigh the same except for one, which is heavier than all of the others. How would you find the heaviest marble in minimum number of comparisons.This link explains for $N=12$ .I have tried solving for $N$ but haven't come up with any solution.How it be can generalised for $N$ marbles? Explain in detail.

Sometimes, depending on the value of N, one can indirectly glean more info by combining multiple weighings.
For example, I was recently given this very problem as a tech test for N = 25, with the requirement to identify the heaviest in no more than 3 weighings.
After much pencil chewing, I came up with the following solution.
First note that if we know the heavier marble is one of a set of 3 marbles, then it can be easily determined by a single weighing of 1 against 1, which indicates either the heavier marble directly or, if these balance, indicates that the 3rd marble is the heavier one.


*

*Put aside 9 marbles, and weigh the remaining marbles 8 against 8.

*If this 8-by-8 weighing is balanced then the heaviest is among the 9 marbles, and in that case weigh 3 of these against another 3. If this is also balanced then the heavier is one of the remaining 3. Otherwise it is among the heavier 3 weighed, and in either case the heavier marble can be determined by one further weighing (see preliminary note above).

*If the 8-by-8 weighing is not balanced then remove 3 marbles from each side, and weigh the remaining 5-by-5 pair.

*If the 5-by-5 weighing is balanced then the heaviest is among a known one of the pair of triplets removed. So again (see preliminary note) it can be determined in one further weighing.

*If the 5-by-5 weighing is not balanced then remove one marble from each side, and make a third and final 4-by-4 weighing.

*If the 4-by-4 weighing is now balanced then the heavier marble is a known one of the pair removed.

*If the 4-by-4 weighing is still not balanced, then we're stuffed. Or are we?! ..
Note that in the latter case, in retrospect, none of the marbles removed or discounted are the heavier one, and the heavier one must be among the pair of 4 marbles just weighed.
So the final twist is to choose at the outset a fixed set of 4 marbles on either side of the 8-by-8 pair, and not remove these but between weighings swap pairs of these preassigned marbles judiciously to opposite sides of the balance so that each marble, were it the heavier, would give a unique "signature" of whether (say) the left hand side of the balance is heavier (H) or lighter (L), and as luck would have it there are 8 possible combinations for the 8 marbles LLL, LLH, LHL, .. HHH
Expressing this another way, treat the successive 4 preassigned pairs of marbles as follows:


*

*leave the 1st pair unswapped for all 3 weighings

*swap the 2nd after the 2nd weighing

*swap the 3rd after the 1st weighing and back after the 2nd weighing

*swap the 4th after the 1st weighing and leave unchanged for the 3rd weighing


Then if the result of the three unbalanced weighings is HLH we can deduce that it must be a known one of the 3rd pair.
