3
$\begingroup$

I face a question as follow from my friend. I wonder whether we can identify the location of counterfeits or just the number of coins lie between them.

Given 16 identical coins in a row. There is exactly one counterfeit coin in the first 8 coins (Left group) and exactly one counterfeit coin in the last 8 coins (Right group). Both counterfeit coins have the same weight, which is lighter than a genuine coin. We need to determine the number of genuine coins located between the two counterfeit coins using exactly three weighings on a balance scale (without standard weights). Each weighing may place any number of coins on each side.

This is my try!

Let the position of the counterfeit coin in the Left group be $x$, with $1 \le x \le 8$.

Let the position of the counterfeit coin in the Right group be $y$, with $9 \le y \le 16$.

The number of genuine coins to be found is $y - x - 1$.

We perform the three weighings as follows:

  1. Weighing 1:Left $\{1, 2, 5, 6, 9, 10, 13, 14\}$ and Right Pan $\{3, 4, 7, 8, 11, 12, 15, 16\}$
  2. Weighing 2: Left $\{1, 3, 5, 7, 9, 11, 13, 15\}$ (The coins at odd positions) and Right $\{2, 4, 6, 8, 10, 12, 14, 16\}$ (The coins at even positions)
  3. Weighing 3:Left $\{1, 2, 3, 4, 13, 14, 15, 16\}$ and $\{5, 6, 7, 8, 9, 10, 11, 12\}$

For each weighing $k \in \{1, 2, 3\}$, we define a property $C_k(n)$ for each coin $n \in \{1, \dots, 16\}$: $$ C_k(n) = \begin{cases} +1 & \text{if coin } n \text{ is on the left pan in weighing } k \\ -1 & \text{if coin } n \text{ is on the right pan in weighing } k \end{cases} $$ The outcome of weighing $k$ depends on the sum $C_k(x) + C_k(y)$. Since the counterfeit coins are lighter, we have:

  • Left pan is lighter ($\downarrow$): $C_k(x) + C_k(y) > 0 \implies C_k(x) = +1$ and $C_k(y) = +1$.

  • Right pan is lighter ($\uparrow$): $C_k(x) + C_k(y) < 0 \implies C_k(x) = -1$ and $C_k(y) = -1$.

  • Balanced ($=$): $C_k(x) + C_k(y) = 0 \implies C_k(x) = -C_k(y)$. Each weighing gives us the exact pair of values $(C_k(x), C_k(y))$ if the scale is unbalanced, or tells us they are opposite if the scale is balanced.

    We define a property vector for each coin $n$ as $\vec{v}(n) = (C_1(n), C_2(n), C_3(n))$. Let $y' = y - 8$, with $1 \le y' \le 8$.

    The weighings are designed in a special way to have the following relationships:

  • $C_1(y) = C_1(y')$, due to the repeating structure for the two groups of 8 coins.

  • $C_2(y) = C_2(y')$, due to the repeating structure for the two groups of 8 coins.

  • $C_3(y) = -C_3(y')$, because the group $\{9, \dots, 12\}$ is on the right pan while the group $\{1, \dots, 4\}$ is on the left, and similarly for the other groups.

Everything works well, except when the scale is balanced all three times. Can I improve this strategy, or do you have any hints?

$\endgroup$
2
  • $\begingroup$ I just wonder about the way this question ask. It makes me curious about whether can I identify exactly the locations of counterfeits or not. Maybe it comes from some contests, I gave it a try but i got stucked there. $\endgroup$ Commented Aug 15 at 18:26
  • $\begingroup$ @ĐạtTrầnTấn, there are 15 possible answers (0 - 14) to the original question, so it might be possible to have a set of 3 weighings that map to it ($3^3=27$ possible results from 3 weighings). There are 64 possible pairs of locations, so it's not possible to discover both locations in 3 weighings. $\endgroup$ Commented Aug 19 at 18:06

1 Answer 1

6
$\begingroup$

With three weighings, we can only distinguish 27(=3³) distinct scenarios. As there are 64(=8²) possible configurations of where the two coins may be, there is no hope to determine their exact location.

However, we can still determine their distance by doing a

binary-ish search like so:

Our weighings are

1,2,3,4 vs 9,10,11,12, then 1,2,5,6 vs 9,10,13,14 and finally 1,3,5,7 vs 9,11,13,15 (irrespective of the intermediate outcomes).

From these, we can determine their distance:

In fact, there is an easy formula for it. Let $w_i$ encode the result of the i-th weighing as $w_i=1,0,-1$ depending on if the left side was lighter, they balanced or the right side was lighter, respectively. Then, the distance of the two counterfeits is exactly $8+4w_1+2w_2+w_3$.

This is not hard to see by

observing the effect of a single weighing when holding the other two results fixed.

As these account for all possible results, this method will always determine their distance but (almost) never their exact location. (Can you tell when it will?)

As a little bonus,

by the same reasoning as in the beginning, we can see that two weighings are not enough - with two, we can only distinguish 9 scenarios, but there are 15 possible differences. So three weighings are also necessary.

$\endgroup$
2
  • $\begingroup$ I wonder how you can cone up with this strategy. $\endgroup$ Commented Aug 16 at 0:31
  • 1
    $\begingroup$ @ĐạtTrầnTấn The essential question was if it is possible to "cut the problem in half" with only one weighing. With that in mind, weighing 4 left vs 4 right options seems natural. Then, the next question is how to arrange for groups that tell you something useful even if they balance. Once you view the first weighing through that lens, the rest comes pretty easily. $\endgroup$ Commented Aug 16 at 11:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.