|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Imagine that u have 8 balls, 7 of them have the same weight, and one of them is a little heavier.
U alse have a weighting device with two cups. U can place as many balls on one cup as u wish, and the device will show you which cup weights more. The problem is to find the heavier ball using the minimum number of weighting procedures. What will be your algorythm for that? ![]() |
|
#2
|
|||
|
|||
|
How about put 4 balls in each cup, take the heavier set and split 2 balls in each, take the heavier and split 1 ball in each, 3 steps to get heaviest.
Scott
__________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Scott B. Pier ScottBP@amalla.com http://www.amalla.com |
|
#3
|
||||
|
||||
|
Quote:
Nah. When you think about it, you can do better. What you do is you get 3 and 3 balls and put 'em on weights. 1) they are equal You get last two balls, put them on weights and get the heaviest one 2) one part is heavier You put 1 ball from those 3 on one plate and another on another i) they are equal 3rd ball is heaviest ii) one of them is heavier, it's the heaviest Heaviest ball in 2 measurements. Where can I collect my prize? ![]()
__________________
And you know I mean that. |
|
#4
|
|||
|
|||
|
Very nice !!
.... But I wanted the prize ![]() |
|
#5
|
|||
|
|||
|
yes, the second guy is right
![]() |
|
#6
|
|||
|
|||
|
How many weights would you need if you DIDN'T know whether the special ball is lighter or heavier?
|
|
#7
|
||||
|
||||
|
Quote:
erm... I'd say 5. edit: there are 3 ways I can think of (4x4,3x3,2x2x2x2), but all of them need 5 measurements, what am I missing? Last edited by AlCapone : November 20th, 2002 at 12:03 AM. |
|
#8
|
||||
|
||||
|
The same amount, 2. For the same reasoning of comparing weight.
|
|
#9
|
||||
|
||||
|
Quote:
Wrong - you cannot do this in 2 steps because you don't know if the ball if heavier or lighter. So if you measure 3 and 3, and say one of them is heavier it doesn't mean 'special' ball is in there. So you have to do more measurements. |
|
#10
|
||||
|
||||
|
Yes, I misunderstood it at first. Now I know what you meen. hmm..my guess would be:
3 and 3, if same weight then calculate the weight of one cup/3. Put other two balls on and the number that comes closest to the cup weight/3 is the ball. That way would work with two steps if a little luck at hand. if... 3 and 3, if not the same weight then take one out of each cup. If same weight then take the weight of one of the cups/2 is one of the remaining balls that was taken out. That is 3 steps. And so on and so on. In conclusion for the equation to work everytime. Four is my guess. |
|
#11
|
||||
|
||||
|
And how, may I ask, are you going to calculate weight? All you got is balance - and the only thing they say is which group of balls is heavier/lighter. You cannot weight it and see how heavy they are.
|
|
#12
|
||||
|
||||
|
Well. I misunderstood yet again. I thought it said a scale, not a balance. I am not going to attempt anymore because I know I'll miss another detail.
-andy UPDATE: I am right. Read first post. "U alse have a weighting device with two cups. " |
|
#13
|
||||
|
||||
|
Quote:
Update: It actually tells you that the device will tell you which cup weighs more, it makes no reference to being able to show specific weight measurements, therefor you cannot assume as such. This is my take: 1) compare 3 and 3, this will tell you which set of three the odd ball is in. 2) compare 2 of the three, if they are equal, the third is the odd one. otherwise, if they are not the same it must be one of those two, but you do not know if one is lighter or heavier than the others so... 3) compare one of the two against any of the other 7 (as you have ascertained that these are all the same). If there is still a difference, then it is the one you kept, otherwise it is the other. |
|
#14
|
||||
|
||||
|
One additonal method for finding it in three measurements:
Break the balls into 4 groups of 2 (let's call them A, B, C, D) 1. Weigh A x B 2. Weigh A x C From this you can derive the status of group D. The results would be analyzed as follows. 1. Balance 2. Balance = Odd ball in D 1. Balance 2. Unbalance = Odd ball in C 1. Unbalance 2. Balance = Odd ball in B 1. Unbalance 2. Unbalance = Odd ball in A Once you know which pair has the odd ball after two measurements, an additional measurement against one of the six known standard balls will let you know which one is odd. |
|
#15
|
||||
|
||||
|
Mincer, that's what I did in my first post, but it doesn't work if you don't know whether the ball is heavier or lighter (hence group of 3 heavier or lighter).
dcaillouet, *clap*clap*. One thing I don't get though - I did the same thing 3 weeks ago (in my second post) and somehow I counted to 5 while doing that ![]() |
![]() |
|