Archive for the ‘Weighings’ Category.

ApSimon’s Mints Investigation

I recently wrote a post about the ApSimon’s Mints problem:

New coins are being minted at n independent mints. There is a suspicion that some mints might use a variant material for the coins. There can only be one variant material. Therefore, fake coins weigh the same no matter where they’ve been minted. The weight of genuine coins is known, but the weight of fake coins is not. There is a machine that can precisely weigh any number of coins, but the machine can only be used twice. You can request several coins from each mint and then perform the two weighings in order to deduce with certainty which mints produce fake coins and which mints produce real coins. What is the minimum total of coins you need to request from the mints?

The post was accompanied by my paper Attacking ApSimon’s Mints.

Unfortunately, both the post and the paper contain wrong information. They both state that the number of coins as a sequence of the number of mints is 1, 2, 4, 8, 15, 38, 74. This is wrong. I took this data from the sequence A007673 in the OEIS database. The sequence had incorrect data lying dormant for 20 years. I believe that the sequence was generated from the paper of R. K. Guy and R. J. Nowakowsky, ApSimon’s Mints Problem, published in Monthly in 1994. To the credit of Guy and Nowakowsky, they never claimed to find the best solution: they just found a solution, thus providing a bound for the sequence. Someone mistook their solution for the optimal one and generated the sequence in the database.

After my post, my readers got interested in the problem and soon discovered the mistake. First Konstantin Knop found a solution for 6 mints with 30 coins and for 7 mints with 72 coins. Konstantin is my long-time collaborator. I trust him so I was sure the sequence was flawed. Then someone located a reference to a paper in Chinese A New Algorithm for ApSimon’s Mints Problem. Although none of my readers could find the paper itself nor translate the abstract from Chinese. But judging from the title and the formulae it was clear that they found better bounds than the sequence in the database. My readers got excited and tried to fix the sequence. David Reynolds improved on Konstantin’s results with a solution for 6 mints with 29 coins and for 7 mints with 52 coins. David did even better on his next try with 28 and 51 coins correspondingly. He also found a solution with 90 coins for 8 mints. Moreover, his exhaustive search proved that these were the best solutions.

Now the sequence in the database is fixed. It starts 1, 2, 4, 8, 15, 28, 51, 90.

For future generations I would like to support each number of the sequence by an example. I use the set P(Q) to represent the sequence of how many coins are taken from each mint for the first(second) weighing. For one mint, only one coin and one weighing is needed. ApSimon himself calculated the first five values, so they were not in dispute.

  • a(2) = 2: P=(1,0) and Q=(0,1). Found by ApSimon.
  • a(3) = 4: P=(0,1,2) and Q=(1,1,0). Found by ApSimon.
  • a(4) = 8: P=(0,1,2,3) and Q=(1,0,2,2) or P=(0,1,1,4), Q=(2,0,1,1). Found by ApSimon.
  • a(5) = 15: P=(0,1,1,4,5) and Q=(2,1,2,5,0). Found by ApSimon.
  • a(6) = 28: P=(1,2,2,5,5,0) and Q=(0,1,2,1,8,10). Found by Robert Israel, Richard J. Mathar, and David Reynolds,
  • a(7) = 51. P=(2,3,7,2,8,12,0) and Q=(0,2,1,7,7,12,12). Found by David Applegate and David Reynolds.
  • a(8) = 90. P=(4,6,6,7,3,13,15,3) and Q=(4,0,1,6,12,12,1,27). Found by David Applegate and David Reynolds.

There is a solution for nine mints using 193 coins that is not confirmed to be optimal. It was found by David Reynolds: P=(1,2,4,12,5,4,20,39,43) and Q=(0,1,3,3,25,33,34,18,27). In addition, David Reynolds provided a construction that reduces the upper bound for n mints to (3(n+1)−2n−3)/4. The following set of coins work: P=(1,3,7,15,…,2n−1) and Q=(1,4,13,40,…,(3n−1)/2).

Share:Facebooktwitterredditpinterestlinkedinmail

ApSimon’s Mints

Hugh ApSimon described the following coin puzzle in his book Mathematical Byways in Ayling, Beeling and Ceiling.

New coins are being minted at n independent mints. There is a suspicion that some mints might use a variant material for the coins. There can only be one variant material: fake coins weigh the same independently of the mint. The weight of genuine coins is known, but the weight of fake coins is not. There is a machine that can precisely weigh any number of coins, but the machine can only be used twice. You can request several coins from each mint and then perform the two weighings so that you can deduce with certainty which mints produce fake coins and which mints produce real coins. What is the minimum total of coins you need to request from the mints?

I will follow ApSimon’s notation. Suppose Pr and Qr is the number of coins from the mint r used in the first and the second weighing correspondingly. That is, we are minimizing Σmax(Pr,Qr). (All my summations are over all the mints. I skip the summation limits because it is difficult to write math in html.) Let us denote by W the weight of the genuine coin and by W(1 + ε) the weight of the fake coin. We do not know ε, except that it is not zero.

Let dr be either 0 or 1, depending on what material the r-th mint uses. Thus, the coin from the r-th mint weighs W(1 + drε). We know the results of these two weighings and the weight of the genuine coin. Therefore, we can calculate the following two values: a = ΣPrdrε and b = ΣQrdrε.

It is clear that we need to request at least one coin from each mint and use it in at least one weighing: Pr + Qr > 0. If both sums a and b are zero, then all the mints are producing genuine coins. Neither of the two values gives us much information as we do not know ε. We can get rid of ε by dividing a by b.

There are 2n − 1 combinations of possible answers: these are subsets of the set of mints producing fake coins given that there is at least one. Thus we need to select numbers Pr and Qr, so that a/b produces 2n − 1 possible answers for different sets of values of dr.

Let us consider cases in which the total number of mints is small. If there is one mint we can take one coin and we won’t even need a second weighing. For two mints we need one coin from each mint for a total of 2. For three mints, one coin from each mint is not enough. I leave this statement as an exercise. It is possible to test three mints with four coins: one each from the first and second mints and two from the third mint. The coins from each mint for the first and second weighings are (0,1,2) and (1,1,0) respectively.

To prove that this works we need to calculate (d2 + 2d3)/(d1 + d2) for seven different combinations of dr. I leave this as an exercise.

This puzzle seems to be very difficult. We only know the answer if the number of mints is not more than seven. The corresponding sequence A007673 in the OEIS is: 1, 2, 4, 8, 15, 38, 74. It is possible to give bounds for this sequence, but they are so far apart. The lower bound is n. And the ApSimon’s book offers a construction for two weighings were Pr = r! and Qr = 1.

You can try to find a better construction, or you can try calculating more terms of the sequence. You can also read more about this problem in my short paper Attacking ApSimon’s Mints.

I do not want to leave the readers with the puzzle that might end up being intractable. So I suggest the following easy puzzle. Solve the ApSimon’s Mints problem assuming that the weight of the fake coin is known.

Share:Facebooktwitterredditpinterestlinkedinmail

Parallel Weighings Solution

I recently posted the following coin weighing puzzle invented by Konstantin Knop:

We have N indistinguishable coins. One of them is fake and it is not known whether it is heavier or lighter than all the genuine coins, which weigh the same. There are two balance scales that can be used in parallel. Each weighing lasts one minute. What is the largest number of coins N for which it is possible to find the fake coin in five minutes?

The author’s solution in Russian is available at his blog. Also, two of my readers, David Reynolds and devjoe, solved it correctly.

Here I want to explain the solution for any number of required weighings.

It is easy to see that for n weighings the information theoretical bound is 5n. Indeed, each weighing divides coins into five groups: four pans and the leftover pile. To distinguish between coins, there can’t be two coins in the same pile at every weighing.

Suppose we know the faking potential of every coin, that is, each coin is assigned a value: potentially light or potentially heavy. If a potentially light coin is ever determined to be fake, then it must be lighter than a real coin. The same story holds for potentially heavy coins. How many coins with known potential can we process in n weighings?

If all the coins are potentially light then we can find the fake coin out of 5n coins in n weighings. What if there is a mixture of coins? Can we expect the same answer? How much more complicated could it be? Suppose we have five coins: two of them are potentially light and three are potentially heavy. Then on the first scale we compare one potentially light coin with the other such coin. On the other scale we compare one potentially heavy coin against another potentially heavy coin. The fake coin can be determined in one weighing.

The discussion above shows that there is a hope that any mixture of coins with different potential can be resolved. After each weighing, we want the number of coins that are not determined to be real to be reduced by a factor of 5. If one of the weighings on one scale is unbalanced, the potentially light coins on the lighter pan, plus the potentially heavy coins on the heavier pan would contain the fake coin. We do not want this number to be bigger than one-fifth of the total number of coins we are processing. So we divide coins in pairs with the same potential, and from each pair we put the coins on different pans of the same scale. So in one weighing we can divide the group into five equal groups. If there is an odd number of coins with the same potential, then the extra coin doesn’t go on the scales.

The only thing that we is left to check is what happens if the number of coins is small. Namely, we need to check what happens when the number of potentially light coins is odd and the number of potentially heavy coins is odd, and the total number of coins is not more than five. In this case the algorithm requires us to put aside the extra coin in each group, but the put-aside pile can’t have more than one coin.

After checking small cases, we see that we can’t resolve the problem in one weighing when there are 2 coins of different potential, or when the 4 coins are distributed as 1 and 3.

On the other hand, if we have extra coins that are known to be real, then the above cases can be resolved. Hence, any number of coins with known potential greater than four can be resolved in ⌈log5n⌉ weighings.

Now let’s go back to the original problem in which we do not know the coins’ potential at the start. After a weighing, if both scales balance, then all the coins on the scale are real and the fake coin is in the leftover pile and we do not know its potential. If a scale doesn’t balance then the fake coin is in one of its two pans: the lighter pan has coins that are potentially light and the heavier pan has coins that are potentially heavy.

Let’s add an additional assumption to the original problem. Suppose we have an unlimited supply of coins that we know to be real. Let u(n) be the maximum number of coins we can process in n weighings if we do not know their potential.

What would be the first weighing? Both scales might be balanced, meaning that the fake coin is in the leftover pile of coins with unknown potential. So we have to leave out not more than u(n−1) coins. On the other hand, exactly one scale might be unbalanced. In this case, all the coins on this scale will get their potential known. The number of these coins can’t be more than 5n-1. But this is an odd number, so we can use one extra real coin to make this number even, in order to put the same number of coins in each pan on this scale.

So u(n) = 2 · 5n-1 + u(n−1), and u(1) = 3. This gives the answer of (5n+1)/2. Now we need to go back and remember that we got this bound using an additional assumption that we have an unlimited supply of real coins. Looking closer, we do not need our additional supply of real coins to be unlimited; we just need not more than two real coins. The good news is that we will have these extra real coins after the first weighing. The bad news is that for the first weighing we do not have extra real coins at all. So in the first weighing we should put unknown coins against unknown coins, not more than 5n-1 on each scale, and as the number on each scale must be even, the best we can do is put 5n-1−1 coins on each scale.

Thus the answer is (5n−3)/2 for n more than 1.

We can generalize this problem to any number of scales used in parallel. Suppose the number of scales is k. Suppose the number of weighings is more than 1, then the following problems can be solved in n weighings:

  • If all the coins have known potential, then the maximum number of coins that can be resolved is (2k+1)n.
  • If we do not know the potential of any coin and there is an unlimited supply of real coins, the maximum number of coins that can be solved is defined by a recursion: u(n) = k (2k+1)n-1 + u(n−1) and u(1)=k + 1. So the answer is: ((2k+1)n+1)/2.
  • If we do not know the potential of any coin and there is no extra real coins, then the answer is u(n) − k = ((2k+1)n+1)/2 − k.

The methods I described can be used to answer another common question in the same setting: Find the fake coin and say whether it is heavier or lighter. Let us denote by U(n) the number of coins that can be resolved in n weighings when there is an unlimited supply of extra real coins. Then the recurrence for U(n) is the same as the recurrence for u(n): U(n) = 2·5n-1 + U(n−1). The only difference is in the initial conditions: U(1) = k. This means that U(n) = ((2k+1)n−1)/2. If we don’t have extra real coins then the answer is: U(n) = ((2k+1)n−1)/2 − k.

When we don’t need to say whether the fake coin is heavier or lighter, we can add one extra coin to the mix: the coin that doesn’t participate in any weighing and is fake if the scales always balance.

Share:Facebooktwitterredditpinterestlinkedinmail

Missing Coin

I recently published the following coin puzzle:

There are four silver coins marked 1, 2, 3, and 5. They are supposed to weigh the number of grams that is written on them. One of the coins is fake and is lighter than it should be. Find the fake coin using the balance scale twice.

My readers, David Reynolds and ext_1973756, wrote to me that I am missing a coin of 4 grams. Indeed, the same puzzle with five coins—1, 2, 3, 4, and 5—is a more natural and a better puzzle.

David Reynolds also suggested to go all the way up to 9 coins:

There are nine silver coins marked 1, 2, 3, 4, 5, 6, 7, 8, and 9. They are supposed to weigh the number of grams that is written on them. One of the coins is fake and is lighter than it should be. Find the fake coin using the balance scale twice.

It is impossible to resolve this situation with more than nine coins as two weighings provide nine different answers to differentiate coins. But indeed it is possible to solve this problem for nine coins. It is even possible to suggest a non-adaptive algorithm, that is to describe the weighings before knowing the results.

To find such a strategy we need to satisfy two conditions. First, we have to weigh groups of coins of the same supposed weight, otherwise we do not get any useful information. Second, there shouldn’t be any two coins together (in or out of the pan) in both weighings, because it would then be impossible to differentiate between them.

Here is one possible solution of the problem:

  • The first weighing: 1, 5, and 9, against 2, 6, and 7
  • The second weighing: 1, 6, and 8, against 2, 4, and 9

David Reynolds also suggested a problem in which we do not know whether the fake coin is heavier or lighter:

There are four silver coins marked 1, 2, 3, and 4. They are supposed to weigh the number of grams that is written on them. One of the coins is fake and is either lighter or heavier than it should be. Find the fake coin using the balance scale twice.

Again, four coins is the best we can do when in addition to find it, we also want to determine if it is heavier or lighter. Indeed, if there were five coins we would have needed to cover ten different answers, which is too many for two weighings.

Here is the solution for four coins:

The two weighings are 1+3=4, and 1+2=3. If the first weighing balances, then the fake coin is 2 and the second weighing shows if it is heavier or lighter than it should be. Similarly, if the second weighing balances, then the fake coin is four and we can see whether it is heavier or lighter than it should be. If the left pan is lighter/heavier for both weighings, then the fake coin is 1 and is lighter/heavier. But if one pan is heavier on the first of two weighings and the other pan is heavier on the second weighing, then the fake coin is 3. In both cases it is easy to determine whether the fake coin is heavier or lighter.

Now David is missing a coin. If we just want to find the fake coin without determining whether it is heavier of lighter, we can do it with five coins:

There are five silver coins marked 1, 2, 3, 4, and 5. They are supposed to weigh the number of grams that is written on them. One of the coins is fake and is either lighter or heavier than it should be. Find the fake coin using the balance scale twice.

We can use the same solution as the previous (four coins) problem. If the scale balances both times, then the fake coin is 5. However, in this case we will not know whether the coin is heavier or lighter.

We can’t extend this problem to beyond five coins. Suppose we have six coins. We can’t use more than three coins in the first weighing. This is because if the scale unbalances, we can’t resolve more than three coins in one remaining weighing. Suppose the first weighing balances; then we have at least three leftover coins we know nothing about and one of them is fake. These three coins should be separated for the next weighing. That means one of the coins needs to be on the left pan and one on the right pan. We can add real coins any way we need. But if the second weighing unbalances we do not know if the fake coin is on the left and lighter or on the right and heavier.


Share:Facebooktwitterredditpinterestlinkedinmail

Parallel Weighings

We’ve all been hearing about parallel computing, and now it has turned up in a coin-weighing puzzle invented by Konstantin Knop.

“We have N indistinguishable coins. One of them is fake and it is not known whether it is heavier or lighter, but all genuine coins weigh the same. There are two balance scales that can be used in parallel. Each weighing lasts a minute. What is the largest number of coins N for which it is possible to find the fake coin in five minutes?”

This puzzle reminds me of another coin-weighing problem, where in a similar situation you need to find a fake coin by using one scale with four pans. The answer in this variation would be 55 = 3125. We can divide coins in five groups with the same number of coins and put four groups on the scale. If one of the groups is different (heavier or lighter), then this group contains the fake coin. Otherwise, the leftover group contains the fake coin. This way each weighing reduces the pile with the fake coin by a factor of five. One scale with four pans gives you more information than two scales with two pans used in parallel. We can conclude that Knop’s puzzle should require at least the same number of weighings as the four-pan puzzle for the same number of coins. So we can expect the answer to Knop’s puzzle will not be bigger than 3125. But what will it be?

Share:Facebooktwitterredditpinterestlinkedinmail

Weighing Coins during the Mystery Hunt

The ultimate goal of each MIT Mystery Hunt is to find a hidden coin. So it was highly appropriate that our 2013 team created a coin-weighing puzzle (written by Ben Buchwald, Darby Kimball, and Glenn Willen) as a final obstacle to finding the winning coin:

There are nine coins, one real and eight fake. Four of the fake coins weigh the same and are lighter than the real coin. The other four fake coins weigh the same and are heavier than the real coin. Find the real coin in seven weighings on the balance scale.

Actually, it is possible to find the real coin in six weighings. Can you do that?

Share:Facebooktwitterredditpinterestlinkedinmail

A Median Coin

Baron Münchhausen is famous for his tall tales. My co-author Konstantin Knop wants to rehabilitate him and so invents problems where the Baron is proven to be truthful from the start. We already wrote a paper about one such problem. Here is a new problem by Konstantin:

Kostya has a black box, such that if you put in exactly 3 coins of distinct weights, the box will expose the coin of median weight. The Baron gave Kostya 5 coins of distinct weights and told him which coin has the median weight. Can Kostya check that the Baron is right, using the box not more than 3 times?

Actually, Konstantin designed a more complicated problem that was given at the Euler Olympiad, 2012 in Russia.

Let n be a fixed integer. Kostya has a black box, such that if you put in exactly 2n+1 coins of distinct weights, the box will expose the coin of median weight. The Baron gave Kostya 4n+1 coins of distinct weights and told him which coin has the median weight. Can Kostya check that the Baron is right, using the box not more than n+2 times?

Note that Kostya can’t just put 4n+1 coins in the box. The box accepts exactly 2n+1 coins. The problem that I started with is for n = 1. Even such a simple variation was a lot of fun for me to solve. So, have fun.

Share:Facebooktwitterredditpinterestlinkedinmail

Binary Bulls Explained

I recently posted an essay Binary Bulls without Cows with the following puzzle:

The test Victor is taking consists of n “true” or “false” questions. In the beginning, Victor doesn’t know any answers, but he is allowed to take the same test several times. After completing the test each time, Victor gets his score — that is, the number of his correct answers. Victor uses the opportunity to re-try the test to figure out all the correct answers. We denote by a(n) the smallest numbers of times Victor needs to take the test to guarantee that he can figure out all the answers. Prove that a(30) ≤ 24, and a(8) ≤ 6.

There are two different types of strategies Victor can use to succeed. First, after each attempt he can use each score as feedback to prepare his answers for the next test. Such strategies are called adaptive. The other type of strategy is one that is called non-adaptive, and it is one in which he prepares answers for all the tests in advance, not knowing the intermediate scores.

Without loss of generality we can assume that in the first test, Victor answers “true” for all the questions. I will call this the base test.

I would like to describe my proof that a(30) ≤ 24. The inequality implies that on average five questions are resolved in four tries. Suppose we have already proven that a(5) = 4. From this, let us map out the 24 tests that guarantee that Victor will figure out the 30 correct answers.

As I mentioned earlier, the first test is the base test and Victor answers every question “true.” For the second test, he changes the first five answers to “false,” thus figuring out how many “true” answers are among the first five questions. This is equivalent to having a base test for the first five questions. We can resolve the first five questions in three more tests and proceed to the next group of five questions. We do not need the base test for the last five questions, because we can figure out the number of “true” answers among the last five from knowing the total score and knowing the answers for the previous groups of five. Thus we showed that a(mn) ≤ m a(n). In particular, a(5) = 4 implies a(30) ≤ 24.

Now I need to prove that a(5) = 4. I started with a leap of faith. I assumed that there is a non-adaptive strategy, that is, that Victor can arrange all four tests in advance. The first test is TTTTT, where I use T for “true” and F for “false.” Suppose for the next test I change one of the answers, say the first one. If after that I can figure out the remaining four answers in two tries, then that would mean that a(4) = 3. This would imply that a(28) ≤ 21 and, therefore, a(30) ≤ 23. If this were the case, the problem wouldn’t have asked me to prove that a(30) ≤ 24. By this meta reasoning I can conclude that a(4) ≠ 3, which is easy to check anyway. From this I deduced that all the other tests should differ from the base test in more than one answer. Changing one of the answers is equivalent to changing four answers, and changing two answers is equivalent to changing three answers. Hence, we can assume that all the other tests contain exactly two “false” answers. Without loss of generality, the second test is FFTTT.

Suppose for the third test, I choose both of my “false” answers from among the last three questions, for example, TTFFT. This third test gives us the exactly the same information as the test TTTTF, but I already explained that having only one “false” answer is a bad idea. Therefore, my next tests should overlap with my previous non-base tests by exactly one “false” answer. The third test, we can conclude, will be FTFTT. Also, there shouldn’t be any group of questions that Victor answers the same for every test. Indeed, if one of the answers in the group is “false” and another is “true,” Victor will not figure out which one is which. This uniquely identifies the last test as FTTFT.

So, if the four tests work they should be like this: TTTTT, FFTTT, FTFTT, FTTFT. Let me prove that these four tests indeed allow Victor to figure out all the answers. Summing up the results of the last three tests modulo 2, Victor will get the parity of the number of correct answers for the first four questions. As he knows the total number of correct answers, he can deduce the correct answer for the last question. After that he will know the number of correct answers for the first four questions and for every pair of them. I will leave it to my readers to finish the proof.

Knop and Mednikov in their paper proved the following lemma:

If there is a non-adaptive way to figure out a test with n questions by k tries, then there is a non-adaptive way to figure out a test with 2n + k − 1 questions by 2k tries.

Their proof goes like this. Let’s divide all questions into three non-overlapping groups A, B, and C that contain n, n, and k − 1 questions correspondingly. By our assumptions there is a non-adaptive way to figure out the answers for A or B using k tries. Let us denote subsets from A that we change to “false” for k − 1 non-base tests as A1, …, Ak-1. Similarly, we denote subsets from B as B1, …, Bk-1.

Our first test is the base test that consists of all “true” answers. For the second test we change the answers to A establishing how many “true” answers are in A. In addition we have k − 1 questions of type Sum: we switch answers to questions in Ai ∪ Bi ∪ Ci; and type Diff: we switch answers to (A ∖ Ai) ∪ Bi. The parity of the sum of “false” answers in A − Ai + Bi and Ai + Bi + Ci is the same as in A plus Ci. But we know A‘s score from the second test. Hence we can derive Ci. After that we have two equations with two unknowns and can derive the scores of Ai and Bi. From knowing the number of “true” answers in A and C, we can derive the same for B. Knowing A and Ai gives all the answers in A. Similarly for B. QED.

This lemma is powerful enough to answer the original puzzle. Indeed, a(2) = 2 implies a(5) ≤ 4, and a(3) = 3 implies a(8) ≤ 6.

Share:Facebooktwitterredditpinterestlinkedinmail

Weighings and Puzzles

My co-author Konstantin Knop wrote a charming book, Weighings and Algorithms: from Puzzles to Problems. The book contains more than one hundred problems. Here are a couple of my favorites that I translated for you:

There is one gold medal, three silver medals and five bronze medals. It is known that one of the medals is fake and weighs less than the corresponding genuine one. Real medals made of the same metal weigh the same and from different metals do not. How can you use a balance scale to find the fake medal in two weighings?

There are 15 coins, out of which not more than seven are fake. All genuine coins weigh the same. Fake coins might not weigh the same, but they differ in weight from genuine coins. Can you find one genuine coin using a balance scale 14 times? Can you do it using fewer weighings?

You might get the impression that the latter problem depends on two parameters. Think about it: It is necessary that the majority of the coins are genuine in order to be able to solve the problem. In fact, the number of weighings depends on just one parameter: the total number of coins. Denote a(n) the optimal number of weighings needed to find a genuine coin out of n coins, where more than half of the coins are genuine. Can you calculate this sequence?

Hint. I can prove that a(n) ≤ A011371(n-1); that is, the optimal number of weighings doesn’t exceed n − 1 − (number of ones in the binary expansion of n−1).

Share:Facebooktwitterredditpinterestlinkedinmail

Heavier or Lighter

In my old essay I presented the following coin problem.

We have N coins that look identical, but we know that exactly one of them is fake. The genuine coins all weigh the same. The fake coin is either lighter or heavier than a real coin. We also have a balance scale. Unlike in classical math problems where you need to find the fake coin, in this problem your task is to figure out whether the fake coin is heavier or lighter than a real coin. Your challenge is that you are only permitted to use the scale twice. Find all numbers N for which this can be done.

Here is my solution to this problem. Let us start with small values of N. For one coin you can’t do anything. For two coins there isn’t much you can do either. I will leave it to the readers to solve this for three coins, while I move on to four coins.

Let us compare two coins against the other two. The weighing has to unbalance. Then put aside the two coins from the right pan and compare one coin from the left pan with the other coin from the left pan. If they balance, then the right pan in the first weighing contained the fake coin. If they are unbalanced then the left pan in the first weighing contained the fake coin. Knowing where the fake coin was in the first weighing gives us the answer.

It is often very useful to go through the easy cases. For this problem we can scale the solution for three and four coins to get a solution for any number of coins that is divisible by three and four by just grouping coins accordingly. Thus we have solutions for 3k and 4k coins.

For any number of coins we can try to merge the solutions above. Divide all coins into three piles of size a, a and b, where a ≤ b ≤ 2a. In the first weighing compare the first two piles. If they balance, then the fake coin must be among the b remaining coins. Now pick any b coins from both pans in the first weighing and compare them to the remaining b coins. If the first weighing is unbalanced, then the remaining coins have to be real. For the second weighing we can pick a coins from the remaining pile and compare them to one of the pans in the first weighing.

The solution I just described doesn’t cover the case of N = 5. I leave it to my readers to explain why and to solve the problem for N = 5.

Share:Facebooktwitterredditpinterestlinkedinmail