Problem 28.1 Easy Free

Finding a Heavier Coin

You have 1818 beans that look identical, but one is heavier than the rest, which all weigh the same. Using a two-pan balance scale (which only tells you which side is heavier, or if they balance), what is the minimum number of weighings needed to guarantee identifying the heavy bean?

Work it out, then compare with the answer.

SolutionShow the worked solution

Lower bound. Each weighing has three outcomes: left heavier, right heavier, or balance. A strategy of at most kk weighings may let later weighings depend on earlier results, but it can still be drawn as a ternary decision tree of depth kk. Such a tree has at most 3k3^k leaves.

Each of the 1818 beans could be the heavy one, and each possibility must end at a different leaf. So we need 3k≥183^k \ge 18. Since 32=9<183^2 = 9 < 18, two weighings cannot suffice.

Three weighings suffice.

  • First weighing: split the beans into three groups of 66 and weigh two of the groups against each other. If one pan is heavier, the heavy bean is in that group. If the pans balance, it is in the third group. Either way, 66 candidates remain.
  • Second weighing: split these 66 into three pairs and weigh two pairs against each other. By the same reasoning, 22 candidates remain.
  • Third weighing: put one remaining bean on each pan. The heavier bean is the odd one.
3\boxed{3}

Generalisation. The same argument works for nn beans with one known to be heavier. The counting bound gives 3k≥n3^k \ge n. Conversely, a weighing can always split the candidates into two equal pans and a remainder, each part of size at most ⌈m/3⌉\lceil m/3\rceil, where mm is the current number of candidates. Hence the minimum number of weighings is ⌈log⁡3n⌉\lceil \log_3 n\rceil.