Confirming the Labels of Coins in One Weighing
Isha Agarwal, Paul Braverman, Patrick Chen, William Du, Kaylee Ji, Akhil Kammila, Tanya Khovanova, Shane Lee, Alicia Li, Anish Mudide, Jeffrey Shi, Maya Smith, Isabel Tu
aa r X i v : . [ m a t h . HO ] J un Confirming the Labels of Coins in One Weighing
Isha Agarwal Paul Braverman Patrick Chen William DuKaylee Ji Akhil Kammila Tanya Khovanova Shane LeeAlicia Li Anish Mudide Jeffrey Shi Maya Smith Isabel TuJuly 1, 2020
Abstract
There are n bags with coins that look the same. Each bag has an infinite numberof coins and all coins in the same bag weigh the same amount. Coins in different bagsweigh 1, 2, 3, and so on to n grams exactly. There is a unique label from the set 1through n attached to each bag that is supposed to correspond to the weight of thecoins in that bag. The task is to confirm all the labels by using a balance scale once.We study weighings that we call downhill: they use the numbers of coins from thebags that are in a decreasing order. We show the importance of such weighings. Wefind the smallest possible total weight of coins in a downhill weighing that confirmsthe labels on the bags. We also find bounds on the smallest number of coins neededfor such a weighing. Coin puzzles have fascinated mathematicians for a long time. Guy and Nowakowsky sum-marized the most famous coin problem in their paper [1]. We are interested in the particularfamous coin-weighing puzzle below. This puzzle appeared on the 2000 Streamline Olympiadfor 8th grade for the case of n = 6. Puzzle.
You have n bags with coins that look the same. Each bag has an infinitenumber of coins and all coins in the same bag weigh the same amount. Coinsin different bags weigh 1, 2, 3, 4, . . . , n −
1, and n grams exactly. There is alabel, which is an integer from 1 to n , attached to each bag that is supposedto correspond to the weight of the coins in that bag. You have only a balancescale. What is the least number of times that you need to weigh coins in orderto confirm that the labels are correct?The answer is 1 for all n , and we present an example of such a weighing.1 xample. On the right pan, place one coin from the bag labeled 2, two coins from thebag labeled 3, and so on such that there are i − i . On the leftpan, put coins from the bag labeled 1 to match the right pan in total weight. For example,if n = 4, we put 20 coins labeled 1 on the left pan and coins with the labels 2, 3, 3, 4, 4, and4 on the right pan. Any rearrangement of the bags makes the left pan heavier or the rightpan lighter. Thus, all the labels are confirmed if the scale balances.Our first goal in this paper is to find a weighing that minimizes the total weight on bothpans. Our second goal is to minimize the number of coins used.In Section 2, we provide definitions, examples, and basic results. We study downhillweighings, which are weighings that have decreasing multiplicities, that is weighings thatuse fewer coins of weight i than weight j , where i > j . For consistency, we assume thatthe multiplicities of the coins on the right pan are negative. In Section 3, we explain theidea of a separation point and how it helps to calculate the minimum weight for a downhillweighing. In Sections 4, 5, and 6, we calculate the minimum weight explicitly depending onthe remainder of n modulo 3. Section 4 is devoted to the simplest case of n = 3 k + 1. In thiscase, the minimum weight is n +12 n − n − . In Section 5 we study the case of 3 k and findthe minimum weight to be n +27 n +9 n − . In Section 6 we study the case of 3 k + 2. This caseis more complicated than other cases. We show that the minimum weight is n +56 n − n − with eight exceptions. In all the cases, the minimum weight grows as n . We present datafor the sequences of our lower bound for the minimum weight and the actual minimum weightin Section 7.Section 8 is devoted to finding the minimum number of coins. We show that for n = 3 k +1the answer is n − n − . For other n we find the lower and upper bounds on the number ofcoins. Both bounds are approximately n .Section 9 discusses downhill imbalances with the weight difference of more than 1. Suchimbalances use more coins and more weight. The last two sections discuss amusing examplesof weighings. Section 10 is devoted to weighings where one side of the pan has coins of onetype. Section 11 looks at weighings forming an arithmetic progression. We call a weighing verifying if it proves that all the labels on the bags are correct.We call a verifying weighing coin-optimal if it uses the minimum number of coins. Wecall a verifying weighing weight-optimal if the total weight is minimal. Many propertieswe discuss later are true for both coin-optimal and weight-optimal weighings. So we call aweighing optimal if it is either coin- or weight-optimal.There should not be coins of the same type on both sides in an optimal weighing. Oth-erwise, we can remove both coins and have a solution with fewer total coins and less total2eight. We call a weighing that does not have the same type of coins on both pans aneconomical weighing . From now on we assume that all weighings are economical.Let a i be the number of coins of type i that is placed on the left pan minus the numberof coins of type i on the right pan. If the coin of type i is not on any pan during a weighing,then a i = 0. We call numbers a i multiplicities . It follows, that if coins of type i are placedonly on the left pan, then a i is positive and if they are placed only on the right pan, then a i is negative.For example, if we compare one coin of weight 2 and two coins of weight 1 on the leftpan against one coin of weight 4 on the right pan, then we write the set of multiplicitiesas { , , , − } . This weighing is verifying. Sometimes we can also write this weighing as1 + 1 + 2 = 4, or as 112 = 4, where the equal sign denotes that this is a balanced weighing.We use > and < to denote imbalances.The total number of coins used in the weighing is Σ ni =1 | a i | . The total weight is Σ ni =1 | i · a i | .The set of multiplicities in a verifying weighing cannot contain duplicates. If so, thenwe could swap the coins corresponding to these multiplicities among themselves withoutchanging the weighing result. Thus, we cannot distinguish the corresponding bags, so theweighing would no longer be verifying. Lemma 1.
If a weighing with a set of multiplicities A is verifying, then a weighing with aset of multiplicities kA is also verifying.Proof. Suppose a weighing with the set of multiplicities kA is not verifying. Hence, thereexists some rearrangement of coins such that the pans do not change their relative weights.Taking this rearrangement of coins, dividing the weights of both pans by k keeps the pans inthe same position as the pans filled according to multiplicities A . Hence, A is not verifying,creating a contradiction.That means, we only need to study the weighings with multiplicities A such that gcd ( A ) =1. We call such sets primitive .We say that the coins from the same bag are of the same type . We need at least n − We call weighings with decreasing multiplicities downhill weighings. These weighings playan important role in this paper.
Lemma 2.
If a verifying weighing is an imbalance (left side lighter), then the multiplicitiesare decreasing: a i > a j for i < j . That is, it is a downhill weighing. roof. Suppose a i ≤ a j for i < j . Then ( j − i )( a j − a i ) ≥
0, which means ia i + ja j ≥ ia j + ja i .That means, swapping bags i and j keeps the imbalance in place. Therefore, we can notdifferentiate between coins of type i and j . Since this is a contradiction, an imbalancedverifying weighing must be downhill. Corollary 3.
If a verifying weighing is an imbalance with one type, x , of coins missing fromthe scale, then the lighter pan contains coins that are lighter than x , and the heavier pancontains coins that are heavier than x .Proof. If coins of type x are not on the scale, then a x = 0. Therefore, for i < x , multiplicities a i are positive, which means that the corresponding coins are on the left side. A similarstatement is true for the right side.We showed that a verifying imbalance must be downhill. The imbalances with a differenceof weight equal to 1 play an important role in this paper. We call such imbalances tight . Lemma 4.
A tight downhill imbalance is verifying.Proof.
Any permutation of bags increases the left side, decreases the right side, or both.This changes the outcome of the weighing from the left pan being lighter to a balance or toa left pan being heavier. Therefore, this is a verifying weighing.
Balances are more complicated than imbalances. A verifying balance does not have to bedownhill. For example, with 3 bags, the weighing 1113 = 222 with multiplicities { , − , } is verifying but not downhill. Another such example for 4 bags is 11114 = 332 with multi-plicities { , − , − , } . However, we can prove that all downhill balances are verifying.On another hand, a downhill balance is always verifying for the same reason a tightimbalance is verifying: any permutation of bags increases the left side or decreases the rightside. Lemma 5.
A downhill balance is verifying.Proof.
This follows from the same logic used in Lemma 4.In our computational experiments, we found that in general, balances that are not down-hill use more total coins and have greater total weight than downhill weighings. One excep-tion is for 3 bags; the weighing 1 + 1 = 2 with multiplicities { , − , } is weight-optimal.For the rest of the paper, we assume that all weighings are downhill . We can directly find the downhill weighings that are coin- and weight-optimal for smallvalues of the number of bags. The results are in Table 1.4umber of bags Example Multiplicities < { , − } < { , , − } { , , , − } { , , , , − } < { , , , , − , − }
12 337 1111222334 = 677 { , , , , , − , − }
13 40Table 1: Minimum number of bags for downhill weighings for n < Consider an imbalance that is not tight.
Lemma 6.
If, in a verifying imbalance, the difference of the weights on the two pans is d ,then the difference between two consecutive multiplicities is greater than or equal to d .Proof. Suppose multiplicities are a , a , a , . . . , a n , where a > a > a > .... > a n byLemma 2. The scales tilts depending on the sign of a + 2 a + 3 a + · · · + na n . Suppose the difference a k − a k +1 < d . After we switch the coins labeled k and k + 1, the newweighing tilts according to a + 2 a + 3 a + · · · ka k +1 + ( k + 1) a k + · · · + na n . The new expression differs from the previous one by ka k +1 + ( k + 1) a k − ka k + ( k + 1) a k +1 = a k +1 − a k , which is less than d . That means the scale tilts the same way as before. Hence, such aweighing is not verifying. It follows that the consecutive multiplicities need to differ by atleast d .We see that imbalances that are not tight need more coins and have greater weight. InSection 9, we prove that imbalances which minimize the number of coins and the total weightmust to be tight. To prove this, we first find bounds for coin- and weight-optimal balancesand tight imbalances. Then we show that the weight and the number of coins in non-tightimbalances exceed these bounds. The following well-known formulae are used repeatedly throughout this paper.5n the first formula, we have k products of two numbers such that one of the numbers isdecreasing by one and the other is increasing by one: ab + ( a + 1)( b −
1) + · · · + ( a + k − b − k + 1) = kab + k ( k − b − a ) − k ( k − k − . (1)One important case is a = 1 and b = k :1 · k + 2( k −
1) + · · · + k · k + k ( k − k − − k ( k − k − k ( k + 1)( k + 2)6 = (cid:18) k + 23 (cid:19) . (2)This sequence as a function of k is the sequence of tetrahedral numbers. It is sequenceA000292 in the OEIS [2].In the next important formula, we have k products of two numbers such that bothnumbers are increasing by 1: ab + ( a + 1)( b + 1) + · · · + ( a + k − b + k −
1) = kab + k ( k − b + a ) + k ( k − k − . (3)An important case to consider is a = 1: b + 2( b + 1) + · · · + k ( b + k −
1) = kb + k ( k − b + 1) + k ( k − k − k ( k + 1)2 b + k ( k − k + 2)6 . (4) Our first naive example in Section 1 provides an upper bound for the smallest total weightand the smallest number of coins in a verifying weighing. Here is the calculation.The right pan contains n ( n − coins for a total weight of:1 · · · · · + ( n − · n = ( n − n ( n + 1)3 . The left pan contains coins of weight 1 to match the weight of the right pan. That meansthe total number of coins used is( n − n ( n + 1)3 + n ( n − , and the total weight is 2( n − n ( n + 1)3 . Approximately, we use n coins for a total weight of n .6 Separation point and bounding weights
Let us define a separation point s to be the smallest label on the right pan in a downhillweighing. Given a separation point, the set of distinct multiplicities with minimal sum is s − , s − , s − , . . . , , , − , − , · · · , − ( n − s + 1) where n is the total number of bags.We denote the following quantity by W L ( s, n ): W L ( s, n ) = 1 · ( s −
2) + 2 · ( s −
3) + · · · + ( s − · s − · (cid:18) s (cid:19) . We call W L ( s, n ) the the bounding-left weight as the weight of coins on the left pan inany downhill weighing with n bags and separation point s is at least W L ( s, n ).Similarly we call W R ( s, n ) the bounding-right weight , where W R ( s, n ) = 1 · s + 2 · ( s + 1) + · · · + ( n − s + 1) · n = ( s − n − s − n − s + 2 n )6 . Suppose W L ( s, n ) ≥ W R ( s, n ). In a downhill weighing the right pan has to weigh at leastthe same as the left. Hence, the total weight in an optimal downhill verifying weighing withthe separation point s has to be at least 2 W L ( s, n ).Now, suppose W L ( s, n ) < W R ( s, n ).If the downhill weighing is tight, then the total weight in a verifying weighing has to beat least 2 W R ( s, n ) −
1. We discuss the case of the imbalance that is not tight in Section 9.Let us denote W B ( s, n ) as the value 2 W R ( s, n ) − W L ( s, ) < W R ( s, n ) and 2 W L ( s, n )otherwise. We call the integer W B ( s, n ) the bounding weight . As demonstrated above, atight downhill verifying weighing with a given separation point has to have a total weight ofat least the bounding weight.We denote the minimum bounding weight as W B ( n ), i.e. W B ( n ) = min s { W B ( s, n ) } . Wedenote the minimum possible weight in a downhill weighing as W M ( n ).Bounding weights are functions of the number of bags and a separation point. We call m the the minimal separation point if the corresponding bounding weight is minimal, i.e. W B ( n ) = W B ( m, n ). We call the corresponding bounding weight W B ( m, n ) the minimalbounding weight. The lemma below follows. Lemma 7.
The minimum weight is at least the minimal bounding weight: W M ( n ) ≥ W B ( n ) .If the minimal bounding weight can be achieved in a weighing, then it is the minimum weight. The polynomial W L ( s, n ) = (cid:0) s (cid:1) increases when s ranges from 1 to n , while W R ( s ) = ( s − n − s − n − s +2 n )6 decreases. They equal to each other for s = n +43 . Unfortunately, thisvalue is not always an integer. Thus, we divide our further investigations into three casesdepending on the remainder of n modulo 3.In the next three sections, we find the minimal weight for n = 3 k + 1, n = 3 k , and n = 3 k + 2, where k is a non-negative integer.7 Case n = 3 k + 1 . Minimum weight. Lemma 8. If n = 3 k + 1 , the minimum weight in a downhill weighing, which is balanced ortight imbalanced, is n +12 n − n − . Furthermore, it is achievable as a balance.Proof. If n = 3 k + 1, then our minimum separation point, s = n +43 = 2 k + 2, is an integer.For this separation point W L (2 k + 2 , k + 1) = (cid:18) k + 23 (cid:19) = 2 k (2 k + 1)(2 k + 2)6 , and W R (2 k + 2 , k + 1) = (2 k + 2 − k − − k + 2 − k − − k + 2 + 6 k + 2)6= ( − k − − k )(8 k + 4)6 . As W L ( s, n ) = W R ( s, n ), for n = 3 k + 1, the minimum bounding weight is k (2 k +1)(2 k +2)3 .It is achievable, and therefore, the minimum weight is: W M (3 k +1) = W B (3 k +1) = 2 W L (2 k +2 , k +1) = 2 k (2 k + 1)(2 k + 2)3 = 8 n + 12 n − n − . For 3 k + 1 bags, the minimum weight as a function of k > W L ( m, n ). This sequenceis not in the OEIS [2], but the sequence W L (2 k + 2 , k + 1) is there. It is sequence A002492,which is the sum of the first n even squares: 4, 20, 56, 120, 220, and so on. n = 3 k . Minimum weight. Lemma 9. If n = 3 k , the minimum weight in a downhill weighing, which is balanced ortight imbalanced, is n +27 n +9 n − . It is achievable as a tight imbalance. For n = 3 k + 1, the expression n +43 is not an integer. Thus, the minimal separationpoint is either ⌊ n +43 ⌋ or ⌈ n +43 ⌉ . In our case of n = 3 k , the minimal separation point iseither 2 k + 1 or 2 k + 2. If the separation point is 2 k + 1, then W L (2 k + 1 , k ) = k − k and W R (2 k + 1 , k ) = k +9 k + k . In this case W R (2 k + 1 , k ) > W L (2 k + 1 , k ), and the boundingweight is W B (2 k + 1 , k ) = 2 W R (2 k + 1 , k ) − k + 9 k + k − , which is achievable. Indeed, we can add any weight to the left side and still have a downhillweighing by using coins of type 1. 8f the separation point is 2 k +2, then W R ( s, n ) < W L ( s, n ) = k +12 k +4 k and the boundingweight is W B (2 k + 2 , k ) = 2 W L (2 k + 2 , k ) = 8 k + 12 k + 4 k . As W B (2 k + 1 , k ) < W B (2 k + 2 , k ), the minimal separation point is 2 k + 1. The minimalbounding weight is achievable. Thus, the minimum weight is: W M (3 k ) = W B (3 k ) = 2 W R (2 k + 1 , k ) − k + 9 k + k − n + 27 n + 9 n − . For 3 k bags, the minimum weight as a function of k > W R ( m, n ) −
1. This sequenceis not in the OEIS [2], but the sequence corresponding to W R ( m, n ) is there. It is sequenceA132124( n ) = n ( n +1)(8 n +1)6 , which starts as 0, 3, 17, 50, 110, 205, 343, 532, 780, 1095, 1485,1958, and so on. n = 3 k + 2 . Minimum weight. In the case of n = 3 k + 2, the minimal separation point is either 2 k + 2 or 2 k + 3. If theseparation point is 2 k + 2, then W R (2 k + 2 , k + 2) > W L (2 k + 2 , k + 2), and the boundingweight is W B (2 k + 2 , k + 2) = 2 W R (2 k + 2 , k + 2) − k + 30 k + 34 k + 63 − . If the separation point is 2 k + 3, then W R (2 k + 2 , k + 2) < W L (2 k + 3 , k + 2), and thebounding weight is W B (2 k + 2 , k + 2) = 2 W L (2 k + 3 , k + 2) = 8 k + 24 k + 22 k + 63 . The point 2 k + 3 is the minimal separation point with the bounding weight W B (3 k + 2) = W B (2 k + 3 , k + 2) = 8 k + 24 k + 22 k + 63 . Now we want to see if this weight is achievable, so we calculate the right weight: W R (2 k + 3 , k + 2) = (2 k + 3 − k − − k + 3 − k − − k + 3 + 6 k + 4)6 = 8 k + 15 k + 7 k . Consider the difference W L (2 k + 3) − W R (2 k + 3) = k +5 k +22 = (3 k +2)( k +1)2 . Now we haveto add some coins to the right pan so that the amount added is at least (3 k +2)( k +1)2 , and the9eighing is downhill. It is not always possible to add some more coins to the right pan sothat their weight sums up exactly to (3 k +2)( k +1)2 . We consider cases separately when k is oddor even.We later show in this section that the minimum bounding weight is achievable with eightexceptions.For 3 k + 2 bags, the minimum bounding weight as a function of k > W L . The sequence W L is also in the OEIS. It is sequence A000447: sumof odd squares. n = 3 k + 2 , k odd. If k = 2 j + 1 for some integer j , we can add the largest weighing coin k +12 times to the rightpan. In this case, the bounding weight is achievable and equal to W M (6 j + 5) = W B (6 j + 5) = 8 k + 24 k + 22 k + 63 = 8 n + 56 n − n − . For 3 k +2, where k = 2 j +1, the minimum weight as a function of j ≥ W L ( m, n ) is there. It is sequence A267031( n ) = (32 n − n ) /
3, which starts as 10, 84,286, 680, 1330, 2300.Thus, we have proved the following lemma.
Lemma 10. If n = 3 k + 2 , where k is odd, the minimum weight in a downhill weighing,which is balanced or tight imbalanced, is n +56 n − n − . Furthermore, it is achievable as abalance. n = 3 k + 2 , k even. Before discussing this case, we must first introduce the notation for triangular numbers.Suppose T m is the m -th triangular number, that is T m = 1 + 2 + · · · + m = m ( m + 1)2 . Lemma 11.
For n = 3 k + 2 , where k is even, and n > , the minimum weight in a downhillweighing, which is either tight imbalanced or balanced, is n +56 n − n − . Furthermore, it isachievable as a balance.Proof. Our separation point is s = 2 k + 3, and the difference between the RHS (right-handside) and LHS (left-hand side) is k +5 k +22 = n · n +46 − n .10onsider the coins added to the RHS in order to make it greater than or equal to theLHS and result in a downhill weighing. Let the multiplicity of the additional coins weighing i be a i , where s ≤ i ≤ n . The total added weight is: a n n + a n − ( n −
1) + a n − ( n −
2) + · · · + a s s, where a n ≥ a ≥ a n − ≥ . . . ≥ a s to keep the weighing downhill.We define non-negative integers b , b , b , . . . , b n − s +1 such that b n − s +1 = a s and b i = a n − i − a n − i − for 1 ≤ i < n − s + 1.With this notation we can represent the total weight a n + a ( n −
1) + a ( n −
2) + · · · + a n − s +1 · s as b n + b (2 n −
1) + b (3 n −
3) + · · · + b n − s +1 ( n ( n − s + 1) − T n − s ). Note that thelargest triangular number in the above expression is T n − s = T n − k − = T k − = T n − − .This sum can be expressed as a multiple of n minus a sum of triangular numbers:( b + 2 b + 3 b + · · · b n − s +1 ( n − s + 1)) n − b T − b T − · · · − b n − s +1 T n − s . Additionally, we have ( b + 2 b + 3 b + · · · b n − s +1 ( n − s + 1) = n + 46and b T + b T + · · · + b n − s +1 T n − s = n . (5)By reversing the procedure above, we see that if we can express n as a sum of triangularnumbers T i , where i < n − , then we can get the multiplicities a i and, correspondingly, theset of coins to add to the right pan to achieve the minimum weight.Suppose we find an expression for n = z using triangular numbers as in (Eq.) 5. Then,the expression works for n = z + 42. We increase b by 1. Thus, the left side in (Eq.) 5increases by 21, which is matched by increasing n by 42. It follows that if the minimumbounding weight can be achieved for n , then it can be achieved for n + 42. By computersearch, we found solutions for 50 < n < n > k + 2, where k = 2 j , the minimum weight as a function of j > W L ( m, n ) is there. It is sequence A015219 of odd tetrahedral numbers. n = 3 k + 2 , k even. Small values We showed that for n >
50 the bounding weight is achievable. We found the minimum weightfor smaller values of n by an exhaustive search. The results are represented in Table 2. Thelast column shows the number of coins used in our weight-optimal weighings.The sequence of differences for minimum bounding weight is: 5, 7, 7, 5, 1, 7, 1, 5, 0, 0,0, 0, 0, 0, . . . . 11bags Min Weight Min Bounding Weight Difference n = 3 k + 2, k even, n < {
7, 4, 3, 2, 1, 0, − − }
14 bags: {
10, 9, 7, 6, 5, 4, 3, 2, 1, 0, − − − − }
20 bags: {
14, 13, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, − − − − − − }
26 bags: {
19, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, − − − − − − − − }
32 bags: {
21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, − − − − − − − − − − }
38 bags: {
26, 25, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,1, 0, − − − − − − − − − − − − }
44 bags: {
29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8,7, 6, 5, 4, 3, 2, 1, 0, − − − − − − − − − − − − − − }
50 bags: {
35, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13,12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, − − − − − − − − − − − − − − − − } We combined the formulae for the minimum weight in Table 3. Recall that the case n = 3 k +2has exceptions when n <
50. k + 1 n +12 n − n − k n +27 n +9 n − k + 2 n +56 n − n − Table 3: Minimal weight.12n any case, the minimum weight is not more than8 n + 56 n + 9 n − . The sequence of minimal bounding weights W B ( n ), which starts with three bags, is: 5,8, 20, 33, 40, 70, 99, 112, 168, 219, 240, 330, 409, 440, 572, 685, 728, 910, 1063, 1120, 1360,1559, 1632, 1938, 2189, 2280, 2660, 2969, 3080, 3542, 3915, 4048, 4600, 5043, 5200, 5850,6369, 6552, 7308, 7909, 8120, 8990, 9679, 9920, 10912, 11695, 11968, 13090, 13973, 14280,15540, 16529, 16872, 18278, 19379, 19760, 21320, 22539, 22960, 24682, 26025, 26488, 28380,29853, 30360, 32430, 34039, 34592, 36848, 38599, 39200, 41650, 43549, 44200, 46852, 48905,49608, 52470, 54683, 55440, 58520, 60899, 61712, 65018, 67569, 68440, 71980, 74709, 75640,79422, 82335, 83328, 87360, 90463, 91520, 95810, 99109, 100232, and so on.The sequence of minimal weights W M ( n ) differs from the previous sequence in eight placesand is: 5, 8, 20, 33, 40, , 99, 112, 168, 219, 240, , 409, 440, 572, 685, 728, , 1063,1120, 1360, 1559, 1632, , 2189, 2280, 2660, 2969, 3080, , 3915, 4048, 4600, 5043,5200, , 6369, 6552, 7308, 7909, 8120, , 9679, 9920, 10912, 11695, 11968, ,13973, 14280, 15540, 16529, 16872, 18278, 19379, 19760, 21320, 22539, 22960, 24682, 26025,26488, 28380, 29853, 30360, 32430, 34039, 34592, 36848, 38599, 39200, 41650, 43549, 44200,46852, 48905, 49608, 52470, 54683, 55440, 58520, 60899, 61712, 65018, 67569, 68440, 71980,74709, 75640, 79422, 82335, 83328, 87360, 90463, 91520, 95810, 99109, 100232, and so on.We highlighted the places where the two sequences differ. Weight-optimal and coin-optimal weighings are not always the same. Below is an exampleof when more coins produce less total weight.Consider the case where we have 9 bags. Using the optimal separation point of 7, weget the starting multiplicities { , , , , , , − , − , − } . Here, the LHS weighs 35 and theRHS weighs 50. Hence, we can add 14 to the LHS to optimize the total weight to 99. Thecorresponding multiplicities for the smallest number of coins are { , , , , , , − , − , − } for a total of 28 coins.However, adding 15 to the LHS still keeps the weighing verifying, and we can do thiswith multiplicities { , , , , , , − , − , − } for a total of 26 coins. Notice that the secondexample uses fewer coins while having a greater total weight.Still, the number of coins used in the weight-optimal weighing is close to the minimum,so we will calculate this number in this section.13 .2 Estimate for the number of coins in our strategy for the min-imum weight We start by calculating the number of coins used in weight-optimal weighings, which weredescribed in the previous sections. We do this by analyzing individual cases. Note that theupper bound we find in this section is approximately 5 n /
18, which is a big improvementfrom our initial bound of n / s a separation point if s is the smallest label on the right pan in a downhill weighing. If the separation point is s ,then the multiplicities on the left pan have to be at least { , , , . . . , s − } for a total of ( s − s − coins, which we denote as F L ( s, n ). The multiplicities on the right have to be atleast { , , . . . , n − s, n − s +1 } for a total of ( n − s +2)( n − s +1)2 coins, which we denote as F R ( s, n ).We denote F L ( s, n ) + F R ( s, n ) as F ( s, n ). Thus, we have proven the following lemma. Lemma 12.
If the total number of bags is n , and the separation point is s in a downhillweighing, we need at least F ( s, n ) = F L ( s, n ) + F R ( s, n ) coins, which is equal to (cid:18) s − n + 32 (cid:19) + n − . n = 3 k + 1 . If n = 3 k + 1, then the separation point is 2 k + 2. Then the left pan has k (2 k + 1) coins,and on the right pan has k ( k +1)2 coins. Thus, the total number of coins used is k (5 k + 3)2 = ( n − n −
1) + 9)18 = ( n − n + 4)18 = 5 n − n − . The first few numbers that this bound produces are: 4, 13, 27, 46, 70, 99. They formsequence A147875 in the OEIS [2], which is the second heptagonal numbers. n = 3 k . For n = 3 k , the minimal separation point is 2 k + 1. It follows that W L (2 k + 1 , k ) = k − k and W R (2 k + 1 , k ) = k +9 k + k . In this case, W R ( s, n ) > W L ( s, n ), so the bounding weightis 2 W R ( s, n ) −
1, which is achievable. We can add the required weight by using the coinsfrom bag 1. However, we can do it by using fewer coins.To estimate the number of coins, we start with ( s − n +32 ) + n − from Lemma 12, which isthe number of coins used in the weighing before we add coins to balance the left and the rightpan. This is equal to n − n . Now we need to add some number of coins to the left pan to getto the weight W R ( s, n ) −
1. That is, we need to add the weight D = W R ( s, s ) − − W L ( s, s )which is equal to 14 = 8 k + 9 k + k − − k − k k − k + 1)2 = ( n − n + 3)6 . To keep this weighing downhill, we add coins in groups of 1 + 2 + · · · + j . Each groupweighs a triangular number T j . The largest triangular number available is T k − = k (2 k −
1) = n (cid:18) n − (cid:19) = 2 n − n . Our weight D = ( n − n +3)6 that needs to be added is no more than T k − for n ≥
6. Itis well-known fact, since Gauss discovered it in 1796, that each integer can be written asa sum of three triangular numbers, possibly including zero. Thus, we can represent D as T a + T b + T c . We want to find an upper bound on a + b + c , which is the correspondingnumber of coins. We have a ( a + 1) + b ( b + 1) + c ( c + 1) = 2 D. Equivalently, ( a + 0 . + ( b + 0 . + ( c + 0 . = 2 D + 0 . . By CauchySchwarz inequality, if x + y + z = R, then x + y + z ≤ √ R. Thus, a + b + c ≤ √ D + 2 . − . √ n + n − . − . ≤ n + 0 . − . n − . Thus, there is a way to add the weight to the left pan that uses no more than n − n − n
18 + n − n + 15 n − . The first few numbers that this bound produces are 4, 14, 29, 49, 74, 104, 139. Thissequence is not in the OEIS. n = 3 k + 2 and k is odd. For n = 3 k + 2 where k is odd, the minimal separation point is 2 k + 3. To calculate thenumber of coins, we start with ( s − n +32 ) + n − from Lemma 12, which equals n + n − . Wealso need to add some number of coins on the right pan. As we showed before, we add k +12 or n +16 . The total is 5 n + 4 n − .
15n this case, this is exactly the number of coins used in the corresponding weight-optimalweighing.The first few numbers that this calculation produces are: 8, 36, 84, 152, 240, 348, 476,624, 792. This sequence is not in the OEIS. n = 3 k + 2 and k is even and n > . For n = 3 k + 2 where k is even, the minimal separation point is 2 k + 3. To calculate thenumber of coins, we start with ( s − n +32 ) + n − from Lemma 12, which equals n + n − . Thealgorithm we used above adds exactly ⌊ k +12 ⌋ = k +22 coins. The latter expression equals n +46 .Thus, the total number of coins is n + n − + n +46 , which equals5 n + 4 n + 818 . The first few numbers that this bound produces are: 2, 20, 58, 116, 194, 292, 410, 548,706, 884, 1082, 1300, 1538, 1796, 2074, 2372, 2690. These numbers divided by 2 producesequence A079273 in the OEIS, which is the Octo numbers. The weighing algorithm thatwe use in this description is valid for n >
50. Thus, the calculation for the number of coinsis exact starting from 884. For smaller values we found weight-optimal weighings using 2,20, 60, 118, 196, 292, 412, 548, 708 coins, and this sequence is not in the OEIS.
As we showed in Lemma 12, if the total number of bags is n , and the separation point is s in a downhill weighing, we need at least (cid:18) s − n + 32 (cid:19) + n − s = n +32 . This is equivalent to saying that to minimizethe total number of coins, the zero multiplicity should be in the middle. This provides ourfirst lower bound of n − coins. We want to improve this bound by considering weight.We consider a separation point s ′ = ⌊ n +43 ⌋ to be the largest separation point such that theleft minimal weight does not exceed the right minimal weight. First, we need a preliminarylemma. Lemma 13. If s is a separation point and s < k , then to have the weight (cid:0) k (cid:1) on the left panwith the separation point s , we need more than ( k − k − coins on the left pan.Proof. The weight (cid:0) k (cid:1) can be represented as a sum1 · ( k −
2) + 2 · ( k −
3) + · · · + ( k − · k − · . ( k − k − coins. However, this expression for the LHS currently has separationpoint k . In order to have the same weight with separation point s where s < k , we mustremove some coins that weigh more than s − s while keeping the weighing downhill. As each removed coin weighs morethan each added coin, the number of removed coins will be no more than the number ofadded coins. This means that we need at least ( k − k − coins on the left pan. Theorem 14.
In a coin-optimal weighing with n bags, we need at least F ( s ′ ) coins.Proof. The number of coins needed for the separation point j < s ′ on the left pan is at least F L ( s ′ , n ). If j < s ′ , then F R ( j, n ) > F R ( s ′ , n ). Therefore, the total number of coins neededfor j < s ′ is more than F ( s ′ ). We also know that, for j > s ′ , we have F ( j, n ) > F ( s ′ , n ).That means we need at least F ( s ′ ) coins.The calculation for F ( s ′ , n ) is presented in the following Table 4. The last two columnsshow F ( s ′ , n ) expressed in terms of k and n .Number of bags s ′ s ′′ F ( s ′ ) F ( s ′ ) n = 3 k k + 1 2 k + 2 k − k n − n n = 3 k + 1 2 k + 2 2 k + 2 k +3 k n − n − n = 3 k + 2 2 k + 2 2 k + 3 k +5 k +22 5 n − n +818 Table 4: Minimal bounding number of coinsAs we can see, in any case our lower bound is approximately n , which is the samegrowth as the upper bound. We merge the lower and the upper bounds into Table 5.Number of bags Lower bound Upper bound n = 3 k n − n
18 5 n +15 n − n = 3 k + 1 n − n −
418 5 n − n − n = 3 k + 2, k is odd n − n +818 5 n +4 n − n = 3 k + 2, n > k is even n − n +818 5 n +4 n +818 Table 5: Lower and Upper boundWe see that, for n = 3 k + 1, both bounds are the same. Corollary 15.
For n = 3 k + 1 , the minimum number of coins is n − n − . The following Table 6 shows our computational results. In the middle row we presentthe smallest number of coins that we found. The numbers in bold are proven to be the bestbound by an exhaustive search or by the corollary above.17umber of bags 2 3 4 5 6 7 8 9 10 11 12 13 14 15upper bound N/A 4 4 8 14 13 N/A 29 27 36 49 46 N/A 74best found
22 26
36 47
60 70lower bound 1 2 4 6 9 13 16 21 27 31 38 46 51 60Table 6: Lower and Upper bound
Suppose a downhill verifying weighing is an imbalance that is not tight. As before, a sep-aration point s is the smallest weight used on the right pan. Then, the smallest set ofmultiplicities that is used on both pans is: { s − , s − , s − , . . . , , , , − , − , − , . . . , − n + 2 s − } . We want to calculate the number of coins used in this weighing as well as the weights on theright and the left pans.
Theorem 16.
The smallest number of coins cannot be achieved in a downhill imbalance thatis not tight.Proof.
We can use the previous calculations by noticing that { s − , s − , s − , . . . , , , , − , − , − , . . . , − n + 2 s − } =2 { s − , s − , . . . , , , , − , − , . . . , − n + s − } + { , . . . , , , , , , . . . , } . The number of coins used is 2( s − n +32 ) + n − − ( n − s + 1). The minimum is reached for s = n +54 , and the corresponding number of coins is n − n − . Asymptotically, this functiongrows faster than our worst bound of n +15 n − . In fact, it is bigger than our bound for n >
6. For n ≤
6, we calculated the exact minimum number of coins. This means that thesmallest number of coins cannot be achieved in a weighing that is not tight.Now we direct our attention to the weight.
Theorem 17.
The smallest weight cannot be achieved in a downhill imbalance that is nottight.Proof.
Let us denote the weight of the coins with multiplicities above as V ( s, n ). We seethat, for s < n , the difference of the weights of multiplicities for separation points s + 1 and s is 2 , , , . . . , , − , − , − , . . . , − , − , where − s + 1. Thus, V ( s + 1 , n ) − V ( s, n ) = 2(1 + 2 + 3 + · · · + s ) − ( s + 1) − s + 2) + ( s + 3) + · · · + n ) . V ( s + 1 , n ) − V ( s, n ) = s ( s + 1) − ( s + 1) − ( n + s + 2)( n − s −
1) = s − − n − n ( s + 2) + n ( s + 1) + ( s + 2)( s + 1) = − n − n + ( s + 1)(2 s + 1) . We see that, for small s , this expression is decreasing until s reaches the value thatsatisfies the equation ( s + 1)(2 s + 1) = n + n. (6)Then, it starts increasing. Let us denote the root of Equation 6 by s ′ . We see that s ′ ≈ √ n . The weight of the left pan in a non-tight weighing with separation point s is at least2 W L ( s, n ). The weight on the right is at least 2 W R ( s, n ) − s − ( s + 1) − · · · − n . Thus, thetotal weight is at least V ( s, n ) = 2 W L ( s, n ) + 2 W R ( s, n ) − s − ( s + 1) − · · · − n. (7)We chose s ′ to be the minimum of V ( s, n ) over s . This means that the total weight of anon-tight downhill weighing is at least V ( s ′ , n ). Now we notice that s ′ > n . To prove this,assume for the sake of contradiction that s ′ ≤ n . Then,( s ′ + 1)(2 s ′ + 1) ≤ (cid:18) n (cid:19) (cid:18) n (cid:19) = 89 n + 2 n + 1 . Moreover, 89 n + 2 n + 1 < n + n for all n > √ ≈ .
90. Thus, for all n ≥
10, we must have s ′ > n .This means that V ( s ′ , n ) > W L ( 2 n , n ) = 4 (cid:18) n (cid:19) . We showed in Section 7 that the minimum weight for balanced and tight imbalancedweighings does not exceed 8 n + 56 n + 9 n − . We now show that our lower bound for V ( s ′ , n ) is never better than this upper bound.First, we have V ( s ′ , n ) > (cid:18) n (cid:19) = 4 n ( n − n − > n + 56 n + 9 n − D ( n ) = 4 n ( n − n − − n + 56 n + 9 n −
881 = 8 n − n + 63 n + 881 > . D is positive, and the largest root of D is approximately15 .
48, we have D ( n ) > n , where n ≥ n ≥
16, non-tight imbalances are strictly worse in terms ofweight.We now resolve the cases when 3 ≤ n ≤
15 ( n = 1 does not require using the scale andnon-tight weighings are clearly worse for n = 2). Recall that s ′ is the root of Equation 6,which, when solved explicitly, yields one positive root, being s ′ = − √ n + 8 n . For n = 3 , , , , , , , , , , , ,
15, the corresponding values of s ′ are approxi-mately1 . , . , . , . , . , . , . , . , . , . , . , . , . s by using V ( s, n ) = 2 s ( s − s − s − n − s − n − s + 2 n )6 − ( n + s )( n − s + 1)2. Plugging our values of s ′ into this approximation yields Table 7. n s ′ ⌈ V ( s ′ , n ) ⌉ W M ( n )3 1 .
71 14 54 2 .
42 25 85 3 .
13 40 206 3 .
84 61 337 4 .
55 89 408 5 .
26 126 759 5 .
96 172 9910 6 .
67 228 11211 7 .
38 297 16812 8 .
09 378 21913 8 .
79 474 24014 9 .
50 585 33715 10 .
21 712 409Table 7: Non-tight weighings compared to previous upper boundNote that W M ( n ) < ⌈ V ( s ′ , n ) ⌉ for all 3 ≤ n ≤
15. Thus, we have now shown thatnon-tight weighings are never better than our previous upper bound W M ( n )) over all n .20 In this section, we consider the case when the right-hand side has only one type of coin. Wecall such weighings solo weighings .We want to find downhill verifying solo weighings such that the multiplicities on the leftside are consecutive numbers. As we are mostly interested in weighings with smaller weightsand fewer number of coins, we consider two possibilities: the range on the left is [0 . . . n − . . . n − Lemma 18.
A balanced downhill verifying solo weighing such that the multiplicities on theleft pan are consecutive numbers in the range [1 . . . n − exists if and only if n ≡ ± . An imbalanced downhill verifying solo weighing such that the multiplicities on theleft pan are consecutive numbers in the range [1 . . . n − exists if and only if n = 2 , or n = 6 .Proof. Consider the multiplicities on the left pan: n − , n − , n − , . . . , (cid:0) n +13 (cid:1) .If the weighing is a balance, then n | (cid:0) n +13 (cid:1) . For ratio (cid:0) n +13 (cid:1) : n = ( n +1)( n − to be aninteger, number n must be congruent to 1 or 5 mod 6.If the weighing is an imbalance, then, for n >
2, it must be a tight imbalance. Conse-quently, the RHS must have a weight of (cid:0) n +13 (cid:1) + 1, and thus, for this weighing to be possible,we must have n | (cid:0) n +13 (cid:1) + 1. Note that this is true if and only if (cid:0) n +13 (cid:1) + 1 n = ( n +1)( n )( n − + 1 n = ( n + 1)( n − n is an integer. For n ≤
6, we see that n = 1 , , n >
6, this expression is never an integer because the fractional part of ( n − n +1)6 is oneof: 0 , , , , , . Adding n for n > (cid:0) n +13 (cid:1) and the totalnumber of coins is( n − n n + 1)( n − n − n − . For example, for 5 bags, we have multiplicities { , , , , − } with 14 coins, and the totalweight is 40.Notice that this solo weighing is more efficient than our first example, when we had onlyone type of coin on the left pan. Lemma 19.
A downhill verifying solo weighing such that the multiplicities on the left panare consecutive numbers in the range [0 . . . n − exists if and only if n ≡ ± . roof. Consider the multiplicities on the LHS: n − , n − , n − , . . . , , (cid:0) n (cid:1) .If the weighing is balanced, then n | (cid:0) n (cid:1) . For the ratio (cid:0) n (cid:1) : n = ( n − n − to be an integer,number n must be congruent to 1 or 2 mod 3.If the weighing is imbalanced, then, for n > (cid:0) n (cid:1) + 1. Thus, for this weighing to be possible, we must have n | (cid:0) n (cid:1) + 1. Note that this is true if and only if (cid:0) n (cid:1) + 1 n = ( n )( n − n − + 1 n = ( n − n − n is an integer. For n ≤
6, this expression is only an integer for n = 1. For n >
6, thisexpression is never an integer for the same reasons as in the previous lemma.The total weight on both sides is 2 (cid:0) n (cid:1) , and the total number of coins is( n − n − n − n − n − n − . For example, for 5 bags, we have multiplicities { , , , , − } with 8 coins, and the totalweight is 20.
11 Multiplicities are in an arithmetic progression
In this section, we discuss verifying balanced weighings that form an arithmetic progression.We are interested only in primitive weighings. We denote the difference in this arithmeticprogression as d . Lemma 20.
A balanced verifying primitive weighing forms an arithmetic progression if andonly if either d = 3 and n could be any integer, or d = 1 and n = 3 k + 1 .Proof. Assume our multiplicities are a, a − d, a − d, . . . , a − ( n − d, where a is the first multiplicity. As our weighing is primitive, we have gcd( a, d ) = 1.As the weighing balances, we know that a + 2( a − d ) + 3( a − d ) + · · · + n ( a − ( n − d ) = 0 . We can group all the a ’s and d ’s together to get:0 = a (1 + 2 + 3 + · · · + n ) − d (2 · · · · · + n ( n − a n ( n + 1)2 ! − d ( n − n ( n + 1)3 ! . n ( n +1)2 yields: a = 23( n − d. Since a , d , and n are all integers, n ≡ d ≡ a, d ) = 1, if d ≡ d = 3, and if n ≡ d = 1. Therefore,we can only get primitive verifying balances in an arithmetic progression when either d = 3,or d = 1 and there are 3 k + 1 bags.For a small number of bags, the weighings with a difference of 3 are as follows:Number of Bags: Weighing:3 (4, 1, -2)4 (6, 3, 0, -3)5 (8, 5, 2, -1, -4)6 (10, 7, 4, 1, -2, -5)7 (12, 9, 6, 3, 0, -3, -6)8 (14, 11, 8, 5, 2, -1, -4, -7)We can notice that the multiplicities are of the general form2 n − , n − , n − , . . . , − n, where the next multiplicity is the previous one minus 3 and n ≥
12 Acknowledgements
This project was done as part of MIT PRIMES STEP, a program that allows students ingrades 6 through 9 to try research in mathematics. Tanya Khovanova is the mentor of thisproject. We are grateful to PRIMES STEP and to its director, Slava Gerovitch, for thisopportunity.
References [1] Richard K. Guy and Richard J. Nowakowski, Coin-Weighing Problems,