| Abstract
In this discussion we examine two versions of the famous
Counterfeit Coin Problem, focusing on their educational OR/MS content.
It is shown that this problem provides an excellent environment for
illustrating a number of fundamental OR/MS problem-solving concepts
and methods related to decision making under uncertainty. A number
of interactive modules are provided for experimentation with this
problem.
1. Introduction
The Counterfeit Coin Problem is a classical puzzle. It
has a long history of challenging ' ... one's reasoning power and
ingenuity ...'. It has to do with the following basic situation: There
are N coins that are identical in size, shape, color, smell, and general
appearance. One coin, however, is counterfeit, having a slightly different
weight than the other N-1 coins. The mission is to identify the counterfeit
coin - with the aid of a two-pan balance - deploying the smallest
possible number of weighings.
Details concerning this standard version of the problem
can be found in Albers (1966) and Martelli and
Gannon (1997). In our discussion we shall
consider the simpler version where the counterfeit coin is known to
weight less than the good coins. Hence, formally our problem is as
follows:
There are N coins that are identical in size, shape, color, smell,
and general appearance. One coin, however, is counterfeit, having
a slightly smaller weight than the other N-1 coins. The mission
is to identify the counterfeit coin - with the aid of a two-pan
balance - deploying the smallest possible number of weighings. |
The first fact to notice regarding this problem is that
strictly speaking it is not well defined. This fact often puzzles
students when they encounter the problem for the first time. It will
therefore be constructive to explain why the problem as stated above
is not well defined.
Consider the following set-up, describing a situation
where there are N = 20 coins and 6 coins are placed in each
pan, so there are 20 - ( 2 * 6) = 8 coins off-scale.
The two gold bars are very important in this picture:
they are used to support the scale so that the picture depicts a situation
where it is not known yet where the counterfeit coin is located.
If we now remove the supporting gold bars, there
could be three possible outcomes:
- The right pan will rise
- The left pan will rise
- The scale will remain balanced
Since the same number of coins (6) is placed in each
pan, from the decision making perspective the first two outcomes are
equivalent: in each case 6 coins will be left for further inspection.
On the other hand, the third outcome will leave 8 coins for further
inspection. More generally, we distinguish between two cases:
- The counterfeit coin is on the scale
- The counterfeit coin is off the scale
In the first case 6 coins are left for inspection,
in the second case 8 coins will be left for inspection.
What emerges is that there is an inherent uncertainty
in the results generated by the weighing process and therefore the
problem is ill-defined unless we agree on the rules according to which
the outcome of the weighing process is determined.
We shall consider two popular decision-analysis approaches
for dealing with this kind of uncertainty, namely
- Worst Case Scenario: Mother Nature is playing against us
- Laplace's Scenario: each coin is equally likely to be the
counterfeit coin
For each case we shall derive an optimal weighing policy.
2. Worst Case Scenario
This is the popular "minimax" approach. It assumes
that the worst case will materialize and this way the uncertainty
is completely removed. In the context of the counterfeit coin problem
under consideration this means that if n coins are left for inspection
and x coins are placed in each pan, then exactly
coins will be left for inspection after this weighing.
Thus, in the case depicted in Figure 1, exactly max{6,8} = 8 coins
will be left for inspection after the weighing.
Now, let f(n) be the minimum number of weighings
required for the identification of the counterfeit coin under
the Worst Case scenario given that n coins are left for inspection.
Then, it follows - using standard dynamic programming arguments
(Sniedovich, 1992) - that
| (2) |
| f(n) = 1 + min {f(max{x,n-2x} : x = 1,2,...,Integer(n/2)})}, n = 2,3,... |
|
|
|
with f(1) = 0, where Integer(a) denotes the integer
part of number a.
Observe that it is not too difficult to show that
f(n) is non-decreasing with n, hence from (2) it follows that
| (3) |
| f(n) = 1 + f(min {max{x,n-2x} : x = 1,2,...,Integer(n/2)})
, n = 2,3,4,... |
|
|
|
This means that the optimal value of x can be obtain
by solving the following simple problem:
| (4) |
| x(n) = min {max{x,n-2x} : x = 1,2,...,Integer(n/2)}}
, n=2,3,... |
|
|
|
where clearly x(2) =1.
The notation 'x(n)' is a reminder that the optimal
value of x depends on the number of coins left for inspection (n).
Applying the beloved Pigeon Hole Principle
(see Burton, 1997) we conclude that the
optimal value of x is Integer(n/3), or more specifically:
Recipe for the Worst Case Scenario
If n > 1 coins are left for inspection, place x(n) coins
in each pan, where x(n) is the integer computed as follows:
Let k and b be the unique non-negative integers such that
n=3k + b, b < 3. Then set x(n) = k if b < 2, otherwise
set x(n) = k+1. |
For example, if n = 12, then k = 4 and b =
0, hence x(12) = 4. If n = 13, then k = 4 and b = 1, hence x(13)
= 4 .If n = 14, then k = 4, and b = 2, hence x(12) = 5.
A rough formal proof that this recipe provides
an optimal policy goes like this: disregarding the integrality
constraint on x, the expression z(n,x) = max{x, n-2x} attains
it minimum at a point where x = n-2x. This is so because as
x increases n-2x decreases, hence the minimum (over x) of max{x,
n-2x} is attained when the line y = x intersects the line y
= n-2x. This is illustrated graphically as below.
|