Re: Answer to bags with 20 coins weighing problem.
Yes, 6 weighings is indeed optimal!
Nice going.
From the first hint, the only way to identify the "bad"
bag is to have a weighing that includes the heavy coin
but does not include the light one. Thus, you need to
find the minimal set of weighings such that at least one
of weighings is guaranteed to contain the heavy coin and
not the light one *regardless* of which of the coins are
heavy and light.
The answer is 6 because 6 choose 3 equals 20. So take the
20 coins from one bag and pair them up with the 20 3-member
subsets of {1,2,3,4,5,6}. The nth weighing will include
exactly those coins whose subset contains n -- set the
scale to 10 ounces since each such weighing includes
exactly 10 coins. Now suppose the selected bag is the
bad one. Since none of the subsets contains another, the subset associated with the heavy coin must contain an element s that is *not* in the subset associated with the light coin. Hence, the s'th weighing will contain the
heavy coin but not the light one.
Note that in *any* set of say w weighings, we can associate
a subset of {1,2,3,...w} with each coin such that the
k'th weighing contains those coins whose subset contains
k. To be a solution to the puzzle, the subsets must
have the property that no subset is contained in another.
Then the optimality of the above solution follows from Sperner's Theorem
Sperner's Theorem: If you have an n-element set, the
maximum number of subsets you can choose with none of the
subsets being included in another is n choose k where
k = n/2 rounded to an integer.
This is "obvious" if the chosen subsets all have to be the
same size; the point is that you can't do any better by
using different sized subsets.
Sperner's theorem implies that 5 weighings are not enough
for 20 coins (5 choose 2 = 10). Since we have a 6 weighing
solution this must be optimal. Note that Sperner's theorem
also implies that 6 weighings are not enough for 21 coins
(since 6 choose 3 = 20 < 21).