You have 3 coins of different weights and a beam balance, as shown above.
What is the minimum number of times you need to use the balance in order to guarantee (in the worst case) that you can sort the coins according to their weights?
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.
The reason you can't involve all three is because in the worst case scenario it gives no new information. It's possible that the coins satisfy the triangle inequality (the sum of two coins is greater than the third) which means no matter how you weigh two coins against the third you get the same result, two coins beating one. The only way to guarantee each measurement is useful is to weigh the coins one to one.
How can we prove that there is no solution with two measurings where at least one of the measuring involves all three coins (two combined compared to the third)? I mean, intuitively I don't think there is, but I can't prove it.
Log in to reply
You only need to use it twice. First place any two coins on the scale, one coin in each pan. Mark the coins as heavy and light. Remove the light coin and replace it with the third coin. Mark the coin as lighter or heavier than the light coin. Arrange the coins in order of weight. You only use the scale twice to arrange the coins by weight.
Log in to reply
Remove the light coin and replace it with the third coin. Mark the coin as lighter or heavier than the light coin.
Could you explain how you can compare the third coin against the light coin when the light coin is removed from the scales?
When weighing coins against each other individually, in the worst-case scenario, the heaviest coin is weighed against two different lighter coins. How do you determine which of the lighter coins is lightest without weighing them against each other? (The same applies in the reverse worst-case scenario, where the lightest coin is weighed against two different heavier coins)
Log in to reply
@Jonathan Quarrie – You can compare the lighter coins by how far they push up the heaviest coin on the scale.
Log in to reply
@Jerome Be – Worst case scenario, the heaviest coin takes the scale to its maximum, and the lighter coins are not heavy enough to register a change in position. How do you determine which of the two coins that didn't register is lightest?
That is a valid point to raise. When showing that something is a minimium, we have to 1) Show that it can be achieved, 2) Show that no smaller number can be achieved. For this problem, the solution has only done part 1. Here's the missing details for part 2:
There are 6 ways that the G, S, B coins could be arranged.
If we do 2 weighings, regardless of whatever combination of coins we decide to use, then there are at most
2
×
2
=
4
distinct outcomes. Hence, we would not be able to distinguish between some of these arrangments.
If we do 3 weighings, then there are at most
2
×
2
×
2
=
8
distinct outcomes, so it might be possible that 3 weighings is sufficient. We then need to find a way to do so using 3 weighings.
Forgot the "worst case scenario"! Otherwise you can do it with two weighings. A+B against C and A+C against B.
If one measures the angle of the bar on each measurement, one need only select one coin at random to be stardard against which the other two are weighed. The change in the angle of the bar for each of the other two coins will reveal the weight relationship between the three coins. Thus two measurements are all that is required to establish the relationship.
Aren't 2 trails enough? Trail 1 :weight any 2 coins say gold and silver. By this we can find out which is heavier and also observe how high the balance has risen on the lighter side Trail 2 :remove the lighter coin and replace it with the 3rd coin. Assuming worst case 3rd coin is lighter than the heavier one in trail one. But still we are able to determine its order by observing how high the balance has risen. If it has risen more than in trail one then we can say that 3rd coin is the lightest coin If it has risen less than in trail one then we can say that 3rd coin is the middle coin and the coin removed after trail 1 is the lightest coin
Log in to reply
What if the 1st coin is so much heavier than either of the other two coins (and the weight of the beam) such that the beam balance reaches its maximum distance in both cases?
First you give them the names according to their colours; yellow, brown and grey. You can then start by weighing the yellow coin and the brown coin. It is possible that you may find that the yellow coin is heavier than the brown coin and in that case you will have to weigh the yellow coin against the grey coin but then you may find that the yellow coin is heavier than the grey coin. Afterwards, you will weigh the grey coin against the brown coin to find which is heavier/lighter to solve them.That means you need to use the beam balance 3 times. From M-pesa foundation academy.
You have suggested one particular process of weighing which (in the worst case) will require 3 tries. But you have not proved the non-existence of a different process of weighing which could require less than 3 tries.
Minimum needs to be removed from the question
If we take the wording "in the worst case" literally, then the weight difference between two or more coins would be within the margin of error for the scale and would be impossible to establish a relationship ranking them by weight.
We'll call the three coins A, B, and C throughout this solution.
To make the measurement in three comparisons, we can measure A vs. B, B vs. C, and A vs. C. This means we know every coin's weight relative to the other two, so the three can easily be ordered.
Now we'd like to justify that the measurement can't be done in two weighings.
EASY METHOD:
Each weighing conveys a binary piece of information (either the scale goes to the left or to the right).
So each pair of weighings convey to us 2 × 2 = 4 pieces of information.
However, there are 3 × 2 × 1 = 6 ways to order the three coins.
Since 4 < 6 , in a worst case scenario there is not enough information to order the three coins.
LONGER METHOD:
This matches more closely the solution method some other people are attempting, and should indicate where any gaps might be.
We'll do this by looking at every measuring possibility and showing there is at least one possible outcome for each that makes the ordering impossible. Note we do have to account for the fact that an intelligent measurer can choose their second measurement based on the result of their first.
1st method: A single comparison followed by a single comparison
Suppose (without loss of generality) our first comparison is A vs B. We can assume A is heavier (both without loss of generality and also because we can create a worst-case scenario any way we desire).
So A > B. Now we can compare either A vs C or B vs C.
With A vs C, A > C indicates that while A is the heaviest coin, we don't know how to compare B and C.
With B vs C, B < C indicates that while B is the lightest coin, we don't know how to compare A and C.
2nd method: A single comparison followed by a dual comparison
Suppose (without loss of generality) our first comparison is A vs B. Again we can assume A is heavier.
So A > B. We can now compare A vs B+C, B vs A+C, or C vs A+B.
With A vs B+C, A > B+C conveys that A is the heaviest but nothing about B vs. C.
With B vs A+C, B < A+C conveys that B is the lightest but nothing about A vs. C.
With C vs A+B, C < A+B conveys nothing about A vs C or B vs C.
3rd method: Starting with a dual comparison
For a worst case scenario here, let's suppose the weights follow the triangle inequality:
Then any comparison of one coin vs. two will indicate the two coins are heavier! Therefore no information can be learned about their relative weights in this scenario.
This means that one follow-up measurement, whether single or dual, will not be able to determine a complete ordering.
The scenario of 3 coins is "easy", once we understand what "worst case scenario" requires.
How about the case of 4 coins? Can it only be done using all 6 comparisons of these coins? Or could we do better?
Hint: If we used the easy method, what is the bound on the number of weighings that is needed?
The tricky one, and it can be done, is to order five coins of different weights in seven weighings.
For each coin, there are two others. So in the worst case scenario, there would be 3 x 2 possibilities, or 6, but you have to remember that you are counting each pairing twice, so it's 6/2, which is 3.
Considering the worst scenario you have this:
1 v 2
if we call the winner x, then we next have this:
x v 3
if x is less than three, we have a solution in two rounds. However, we have the worst, so x is less than 3, which then requires a third round of this:
3 vs the loser of the first round.
But can you do better than having to check every possible pair?
Hint: Remember that there are an O ( n 2 ) of possible pairs, but it should take you only O ( n lo g n ) comparisons to sort.
the question is bogus: "What is the ~~minimum number~~ of times you need to use the balance in order to guarantee (in the worst case) that you can sort the coins according to their weights?
The MINIMUM is two, under ideal conditions.
Log in to reply
Do you know what "in the worse case" means?
The question is absolutely not "Bogus". It is talking about the minimum for the worst case scenario. You are not taking into account what worst case scenario means. It means that the conditions are not ideal.
I agree with Linda Williams. Bogus question. If A > B and B> C, you can stop. The minimum is two.
A very clean solution.
For completeness, can you show that 1 or 2 cannot be the answer?
Two times. we can put one coin in the balance and record its weight, then the second one and record its weight. For the third one we can conclude based on its size where its weight lies before, after or between any of the previous records.
How do you conclude based on its size?
The intent of the question was to compare between the coins. A beam balance cannot tell you the actual weight of the coin.
Log in to reply
I know but we have to use our observation here. No exact measurements involved.
Log in to reply
I was originally going to say something about the worst case scenario, but (based on the reports) I can see that everything you've said here was before that specification was added to the problem.
Even so, you know enough to understand that size does not equate to weight.
Log in to reply
@Jonathan Quarrie – The reason l mentioned the size is we have to make some observations from our first two trials when weighing the first two pennies and compare this to the last penny.
the phrase "in the worst case" was not clear.
Log in to reply
I agree, Duncan. But then, some engineers are notoriously bad communicators. ha ha ha ha 😇
This is exactly what I thought as well.
first wt. all the three of them .. then if we wt. any two of them we can get the wt. of the third ( by subtracting it from the previous observation) similarly we can get wt. of one more coin . and finally add the two and subtract it from the 1st observation to get the wt. of the last coin ... so total observations = 1+2=3
It's a beam balance, not a numerical weighing scale... You don't get any numbers from it.
if you place two coins on one side and the other coin on the other side of the scale. you will know if the singe coin is the heaviest coin or not, if it is the heaviest coin then you can place the other two coins on each side and in two movie you will know the relative weights of the coins.
Conversely, if the single coin is lighter than you will need two more steps!
Since you have got three coins:bronze, silver and gold you will first start by weighing two at a time . For example you will first weigh that of bronze and gold, followed by silver and bronze then at last weigh gold and silver. When you get the masses of each pair ,you shall subtract to get the mass of each coin and at last you will weigh all the coins three times. SO THE ANSWER IS THREE TIMES.
Quick solution: There are 3 ! = 6 possible orderings of the coins, and we have to encode them by a string of 0/1s (say 0 for left scale being heavier and 1 for the right one), regardless of what we weigh against what. But one can encode only 4 outcomes by 2 weighings (00, 01, 10 and 11). And it's kind of easy to see that you can do it with 3.
I was alittle surprised that there was not a straight math solution, so here goes. Three unknowns require three equations to solve for each of the unknowns. In this case we cannot know the absolute values of the weights, but just the relative weights. weigh a vs b+c weigh b vs a+c weigh c vs a+b This will yield 3 equations such as a > b+c, b <c+c, c > a+b. The scale will tell you which way the inequality will go. > or <. Solve the three equations via substitution, addition and subtraction which will yield three inequalities such as b > a > c, for example
john neglia
Unusual approach. But can you show that 1 or 2 cannot be the answer?
Clearly there are three ways as you first have Weigh two and let one is heavier. Then replace lighter one with another,you find this on lighter to that of heavier one. Now put the heaviest one aside and compare lighter ones and you get the order of weight.
That's 3 weighings. But can you do less than 3 weighings? Why not?
What does this represent? Are you trying to do some combination? If so, how is that relevant to this question?
For comparison sorting lower bound is floor n*log(n), where n denotes number of elements.
How did you get this lower bound? Does this work for all positive integers "n"?
At first start with any two coin say gold and silver.
Weighting them on the balance we can found which one is more heavy.
Now taking heavier one with the bronze coin in the balance.
If we found bronze coin is heavier then we are done. But we have to consider the worst case so assume bronze coin is lighter than the heavy coin.
Then taking the bronze coin and the coin we found lighter at the first time.
Here we found the heavier one
So we are done.
Therefore minimum necessary steps is 3.
That's the correct algorithm. But can we do better than 3? In other words, can you show that 1 (or 2) weighings is not possible?
First, you weigh any two coins. Remember how low the heavier side got. Then, you take the lighter coin and weigh it against the last one.
If the coin that was originally lighter was heavier, then the order(from least to greatest) is Last One - Originally lighter - Originally Heavier.
If the coin that was originally lighter again was lighter, then compare how much the heavier side dropped in both cases. You should then get the answer.
That is correct, which means only 2 weighings necessary. Apparently the solution given failed to consider the Captain Obvious answer that one's eye can discern how much the disparity in thw two weighings there is. So many of the problems given suffer from incompleteness in assumptions.
And to those who question wheter you can eye ball small relative differences, then how can one determine if one or an other coin have a discernible differences. Balance scales have gradation to measure rwlative weight differences so the eywballing is made easier.
Although not explicitly mentioned, you cannot use "eyeballing" to compare the weights. The gist of the problem is asking how many comparisons does it make and nothing else.
Problem Loading...
Note Loading...
Set Loading...
First you weigh gold and silver, lets say gold is heavier, then you take the bronze and weigh it against the gold. If bronze is heavier than gold then you have solved the order, and you only had to use the balance twice. But it is possible that the gold is heavier than both other coins and in that case you'll have to weigh the two other coins against each other to find which is lighter/heavier to solve for the order. It is possible to find the order in only 2 tries, however we are looking for the worst case scenario which will take 3 tries.