Puzzling Stack Trade is a query and reply web site for many who create, clear up, and examine puzzles. It solely takes a minute to enroll.
Signal as much as be part of this neighborhood
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
For example we’ve 6 balls, the place all of them have totally different weight.
Discover and describe the least weighings you want on scales to seek out second lightest ball and second heaviest ball.
The least variety of (two-pan) weighings required is
The flowchart under particulars carry out the weighings; an unlabelled poset represents all information gathered of the relative weights of the balls. At every step the 2 black balls are in contrast, and the scenario superior one step to the correct relying on its outcome.
The code that proved the optimality of this scheme could be discovered right here.
A attainable approach:
– Divide the balls into two teams of three. Measure any two of the identical group in opposition to one another. You will get one thing like $A>B>C$ and $D>E>F$ (6 weighings).
– Weigh $A$ in opposition to $D$. Let $A>D$ (1 weighing).
– Weigh $B$ in opposition to $D$. The heavier one is the second-heaviest (1 weighing).
– Repeat it for the underside to determine the 2 lightest (2 weighings). This makes 10.
Divide the balls into teams of three to higher type them out to seek out the 4 balls. Weigh all of the balls in every group in opposition to one another. If there’s $n$ balls, you spend $n$ turns for the preliminary sorting, and $n/3-1$ turns every to seek out the 4 balls. The sum is $7n/3-4$ weighings.