Beam Balance

Chris has 6 coins of distinct weights and a beam balance with two pans.

Can he find both the heaviest and the lightest coins by using the balance 7 times?

Yes No

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

11 solutions

Let the weights of the 6 coins be A , B , C , D , E , F A,B,C,D,E,F . Pair them off sequentially onto the beam balance, making a total of 3 weighings. Without loss of generality suppose we find that A < B , C < D A \lt B, C \lt D and E < F E \lt F . We then know that the lightest coin will be among A , C A,C and E E , and that the heaviest coin will be among B , D B, D and F F .

Now weigh A A against C C . Whichever is the lightest, say A A , we then just need to weigh A A against E E to determine the lightest of all the coins. Similarly, to find the heaviest coin we start by weighing B B against D D , and then weighing the heaviest of these against F F . We have made 4 additional weighing in the process, giving us a total of 7 weighings to determine both the lightest and heaviest coins. The answer to the question is therefore True \boxed{\text{True}} .

Can this be done using the balance 6 times, or is 7 the best upper bound? Why or why not?

Eli Ross Staff - 3 years, 8 months ago

Log in to reply

We can do this in 6 times if we have a weighting machine instead of the beam balance.

Though, frankly speaking we can do it without the balance. A random guess might turn out to be true. But that's all probability. And chances of correct guessing of the order of coins is negligible or, 1/6! .

Thank you!

Kaushik Chandra - 3 years, 7 months ago

Log in to reply

We're only asked for the heaviest and the lightest. The probability that a random guess would be correct is (1/6)*(1/5).

Richard Desper - 3 years, 7 months ago

Log in to reply

@Richard Desper Yeah you are right . I thought about the order of the coins.

Kaushik Chandra - 3 years, 7 months ago

I have a proof that you can't do better than 5 using a decision tree. Note that the tree has at least n ( n 1 ) n(n-1) leaves (number of different ordered pairs), so it must have a height of at least log n ( n 1 ) = 5 \lceil \log{n(n-1)} \rceil=5 . That means we must perform at least 5 comparisons to guarantee an outcome.

How do you go about proving you can't do better than 7?

Christopher Boo - 3 years, 7 months ago

Log in to reply

I thought intuitively . Can you please prove your point by providing an easy example like Mr. Charlesworth did?

Kaushik Chandra - 3 years, 7 months ago

Log in to reply

@Kaushik Chandra You might lose the big picture if you only look at a specific example. A decision tree is a general method to argue about the lower bound. Here is an example of applying the decision tree to prove the performance of comparison-based sorting algorithms.

Christopher Boo - 3 years, 7 months ago

Log in to reply

@Christopher Boo I didn't knew this method. Thanks for sharing :)

Kaushik Chandra - 3 years, 7 months ago

Can we actually use this decision tree as it is to describe an algorithm for doing it in 5 steps? We should not require any more information than this 5 bits, because it is irrelevant.

Agnishom Chattopadhyay - 3 years, 7 months ago

Log in to reply

@Agnishom Chattopadhyay No. The decision tree only tells us that you can't do better than 5. It does not say that i) you can do it in 5 steps, nor ii) describe an algorithm that can do it in 5 steps.

Christopher Boo - 3 years, 7 months ago

Log in to reply

@Christopher Boo Are there cases where one needs an algorithm consisting of strictly larger number of steps than the depth of the decision tree?

Agnishom Chattopadhyay - 3 years, 7 months ago

Log in to reply

@Agnishom Chattopadhyay Sorry, I don't really understand your question. Do you mean if there's a set of weights such that the worst case of the best algorithm is more than the depth of the decision tree?

Christopher Boo - 3 years, 7 months ago

I was about to solve this but then I got scared by his last name

some guy - 3 years, 7 months ago

"We then know that the lightest coin will be among" actually I do know nothing , can you please explain how I am supossed to know this. I am stuck betweem the bubble sort and dichotomy. dividing the set in two, smells like dichotomy, and afterwards sorting the two sets in a bubble sorts.

Georges GOOSSENS - 3 years, 7 months ago

Log in to reply

The lightest coin must weigh less than every other coin. Since each of B , D , F B,D,F are heavier than at least one of the other coins, none of them can be the lightest, and so one of A , C , E A,C,E must be the lightest.

Similarly, since the heaviest coin must weigh more than every other coin, and since each of A , C , E A,C,E are lighter than at least one of the other coins, the heaviest coin must be among B , D , E B,D,E .

Brian Charlesworth - 3 years, 7 months ago
John Shugg
Oct 17, 2017
  1. Weigh any 2 coins. Put each into either a heavy pile or a light pile.
  2. Do the same with the next 2 coins. You now have 2 heavy and 2 light and 2 unknown after 2 weigh ins.
  3. Weigh the 2 heavy coins and discard the loser.
  4. Weigh the 2 light coins and discard the loser.
  5. Weigh the 2 unknowns and put each into the correct pile, either heavy or light.
  6. Weigh the 2 heavy coins and discard the loser.
  7. Weigh the 2 light coins and discard the loser. You have now identified both the heaviest and the lightest coins using 7 weighings.

What do you mean by loser?

Agnishom Chattopadhyay - 3 years, 7 months ago

Log in to reply

The lighter weight is the loser

Navneet Rana - 3 years, 7 months ago

I think he means that the loser of the heavy pair is the lighter one of the two and the loser of the lighter pair is the heavier one out of the two.

Tapas Mazumdar - 3 years, 7 months ago

When weighing heavy pile to know which is heavier, light one is loser. When weighing light pile to know which is lighter, heavier one the loser.

Cool MusicStereo - 3 years, 7 months ago

I tried in two different random cases I find ur way is best

Eswar G - 3 years, 7 months ago

Thx! I struggled with this one and this helped a lot.

Pascal Drude - 3 years, 7 months ago

What's a loser: heavy or light?

Advait Junnarkar - 3 years, 7 months ago
Jay McCarthy
Oct 16, 2017

Imagine a tournament of coins to find the heaviest. It takes one round (3 matches) to eliminate half of the coins (A B C and D E F). Of the remaining three coins (D E F), two matches determine the heaviest (F). Now, to find the lightest, you know it lost the first round, so you use the other half of the coins (A B C) and have another round of two matches to discover it (A).

A variant of this question is to ask how many matches you need to find the second heaviest. Clue: It lost against the heaviest.

In your variant D E F have to be measured 3 times, since if D>E, then D>F, you still don't know if E or F is bigger. So it needs one additional measurement.

József Inczefi - 3 years, 7 months ago

Log in to reply

What about the one that F beat in the first round of weighings? How do you know that it isn't the 2nd heaviest?

Alec WILSON - 3 years, 7 months ago

Log in to reply

Exactly.
In general, you can use a tournament of height h = log n to find the greatest element. And then you have h candidates for second best. So you'll need (n-1) + (log n - 1) to find the second best.

Richard Desper - 3 years, 7 months ago

That is a very interesting variant indeed. Maybe you could post it as a problem on Brilliant?

Agnishom Chattopadhyay - 3 years, 7 months ago

José N. Olmos
Oct 21, 2017

if you set this up as a tournament with five "matches" you'll find the heaviest. to find the lightest take all the losers (3) from the first round and instead advancing the winer (heaviest) you'll advance the loser (lightest). in two matches you should have your answer

Divyansh Saxena
Oct 21, 2017

Label all coins 1,2,3,4,5,6. Now make pair as (1,2),(3,4),(5,6) The three above pairs are now sent for a dead match ...suppose 1,3,5 wins in the allotted pairs,then (1,3) are sent to dead match...and suppose 3 wins.. Then (3,5) sent for dead match .Finally say,5 wins(Heavy weight champion) So overall we had 5 matches so far... Let's give the failures their "second chance" (1,4) are sent for a dead match ...say 1 wins..now (1 ,6) are the final challengers ..who will the winer,will be the lightest-weight champion... So total seven matches are done..

Sivasuriyan S
Oct 19, 2017

Let the weights of the 6 coins be A,B,C,D,E,F. Choose a coin in random to be a constant. Now, weigh the other 5 coins against it. The heaviest coin will be the one which causes the biggest tilt and the lightest coin will be the one which causes the smallest tilt.

Shreyas Belwalkar
Oct 18, 2017

First, put 3 coins in each pan of the balance. The set with heavier coins will go down. Now we have three coins which contain the heaviest and other 3 which contain the lightest. You now have two options, to weigh the heaviest first or the lightest. It is simple. You just have to first weigh two coins against each other(this activity will be separate for both the sets) and determine the heaviest among them and then repeat this activity for the remaining coin. You still have 4 chances left of using the balance. So repeat this for the other set and you will get the heaviest and the lightest coins!

Not true; it depends upon the differences between the coins. 1g + 2g + 6g < 3g + 4g + 5g, but the heaviest individual value there would appear in the lighter of the 2 groups of 3. You can only say that the set with the heaviest total will go down in your initial weighing.

Alec WILSON - 3 years, 7 months ago

Log in to reply

I was thinking the same by giving specific values like 1 2 3 4.5 5.5 6 grouping 1 4.5 5.5 eq the group 2 3 6 in sum ...

Georges GOOSSENS - 3 years, 7 months ago
Luis Salazar
Oct 18, 2017

Example list with 6 weights: a = [8,4,3,9,1,2]

Find the lowest with 5 comparisons:

cmp(8,4) low = 4, hi = 8

cmp(4,3) low = 3, hi = 8

cmp(3,9) low = 3, hi = 8

* remember number 9, the first non-lower number *

cmp(3,1) low = 1, hi = 8

cmp(1,2) low = 1, hi = 8

Found the lowest number=1, with 5 comparisons.

Find the greatest with 2 additional comparisions:

* start from previous number 9, because all the left is lower or equal to 8 *

cmp(8,9) low = 1, hi = 9

* no need to compare to 1, as it's already proved the lowest *

cmp(9,2) low = 1, hi = 9

Found the highest number=9, with 2 additional comparisons.

Michael Mitchell
Oct 17, 2017

This can be done with 7 weighings.

1) Randomly create three pairs of coins.

2) Compare each coin pair using the scale. Separate coins that are heavier into a 'heavy' pile and the lighter coins into a 'light' pile (this will require 3 weighings)

3) Select two coins from the 'heavy' pile at random and compare with the scale. Remove the lighter coin from the scale and place the remaining coin from the 'heavy' pile on the scale. The heaviest coin from this weighing is the heaviest of all the original coins (this will require 2 weighings)

4) Select two coins from the 'light' pile at random and compare with the scale. Remove the heavier coin from the scale and place the remaining coin from the 'light' pile on the scale. The lightest coin from this weighing is the lightest of all the original coins (this will require 2 weighings)

Zain Majumder
Oct 16, 2017

Let the weights be A < B < C < D < E < F A<B<C<D<E<F and the coins be c 1 , c 2 , . . . c 6 c_1, c_2, ... c_6 . Since we do not know the relationship between the weights of the coins, weighing with more than one coin on a side gives no information. For example, when trying two coins on one side and one on the other, weighing C , E C, E with F F may result in either side being heavier than the other because we do not know if C + E C+E is greater or less than F F . This will be seen with any other situation where more than one coin is on one side.

Now we weigh two coins, c 1 c_1 and c 2 c_2 , against each other. Suppose c 1 < c 2 c_1<c_2 . Now we know c 1 c_1 does not weigh F F and c 2 c_2 does not weigh A A . If we weigh one of these two, c 1 c_1 for example, with another coin, c 3 c_3 , we will find that one cannot be A A and the other might be. If we weigh two unrelated coins c 3 c_3 and c 4 c_4 , we will learn this information, but we will also learn that one cannot be F F . Therefore, weighing two new coins gives the most information. We will do the same for the last two coins.

WLOG, we have c 1 < c 2 c_1<c_2 , c 3 < c 4 c_3<c_4 , and c 5 < c 6 c_5<c_6 , and we took 3 3 separate measurements so far. We know one of c 1 c_1 , c 3 c_3 , and c 5 c_5 weigh A A , and one of c 2 c_2 , c 4 c_4 , and c 6 c_6 weigh F F . Cross comparing the two groups gives no information about A A or F F since we already eliminated these weights from each of the groups. We will weigh two of the lighter coins, c 1 c_1 and c 3 c_3 , and we find that c 1 < c 3 c_1<c_3 . Now c 3 c_3 cannot weigh A A . A similar result would occur if we weighed any two of the lighter coins. This alone does not tell us the lightest coin, so at least one more weight is needed. This can be accomplished by weighing the last two coins that might weigh A A , c 1 c_1 and c 5 c_5 . With 2 2 additional weighings, we found the lightest coin. A very similar method will locate the heaviest coin in the second group with 2 2 weighings. Therefore, the minimum number of weighings needed to find the lightest and heaviest coins is 3 + 2 + 2 = 7 3+2+2=\boxed{7} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...