Serving the Quantitative Finance Community

 
User avatar
darkforce
Topic Author
Posts: 0
Joined: October 21st, 2005, 4:58 pm

ball weighing

January 30th, 2007, 12:36 am

You have 10 jars each containing 10 balls each. In 8 of the jars, each of the balls weigh 1 oz whereas in remaining 2 jars the balls weigh 2 ozs each. Using one weighing on a digital scale, how would you determine the 2 odd jars?
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

January 30th, 2007, 10:16 am

Let (a_1, ... a_10) be the weight of the ball from jar 'i', a_i = 1 or 2.Let (b_1,... b_10) the number of balls chosen in each jar, chosen in [[0,10]].One is only allowed to know outcome of the function f(a,b) := Sum a_ib_i. If this function is not injective then we won't be able to determine the odd jars.Suppose that there exists i!=j such that b_i = b_j then Sum a_ib_i = Sum a'_ib_i with (a_i, a_j) = (2, 1) and (a'_i, b'_i) = (1,2) and a_k = a'_k for k not in {i,j}, that is 'f' is not injective. So a first constraint on (b_1,... b_10) is that all b_i are different, which yields to 11 choices (choose which number in [[0,10]] u discard). (C1)Now, there is an other constraint. Suppose that there exists (i,j,k,l), distinct such that b_i + b_j = b_k + b_l. Then (a) and (a') with a_i = a_j = 2 and a'_k = a'_l = 2, other a' and a fixed to 1, are indistinguishable, i.e. Sum a_pb_p = Sum a'_pb_p. (C2)For example, (b) = (1,2,3,... 10) doesn't satisfy (C2) as 1+4 = 2+3, so you can't have {1,2,3,4} at the same time, {0,1,2,3} doesn't work either. In fact, if there are 4 consecutive numbers it won't work. If you choose to discard i, if i > 3 then {0,1,2,3} won't allow 'f' to be injective. If i < 3 then {7,8,9,10} will rise trouble.Thus, it is easily seen that there doesn't exist (b) that satisfy (C1) and (C2). Subsequently, one has to allow b_j to take values in a bigger range than [[0,10]]. The solution is to cut the balls in 2, or 4 or more. If we have enough balls, then the solution should be obvious. Now, what is the minimum balls we need to have to be able to satisfy (C1) and (C2) ?Let's try one solution.{0,1,2}, 3 is not possible.{0,1,2,4} 5 doesn't workFinally {0,1,2,4,6,9,12,16,20,25} is a possible allocation (difference between consecutive terms 1 1 2 2 3 3 4 4 5 5 etc..Thus, I cut the balls in 3, obtaining 30 pieces of ball in each jar, and the problem becomes possible.Edit: Not proven that (C1) and (C2) satisfied imply 'f' injective. Edit: Indeed, that doesn't work. In fact one has to choose a sequence such that adding 2 numbers among previous one, can't be equal to the next + one of the previous. Let's try again.{0,1,2} -> choosing to add 2 numbers allow {1,2,3} as a sum, so 3 doesn't work (3+0 = 3){0,1,2,4} -> sum to {1,2,3,4,5,6} so 6 doesn't work.{0,1,2,4,7} -> {1,2,3,4,5,6,7,8,9,11}ok {0,1,2,4,7,12,20, 33, 54, 88} works. I cut in 9.
Last edited by iwanttobelieve on January 29th, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

January 30th, 2007, 10:48 am

Ok, without cutting the balls, I do this.I take a long plank the weight of which I know. Then I put the balls in different places from the middle so that I measure the 'moment' rather than the weight. If these places are sufficiently far from each other, then this should allow to discriminate between each contribution. Edit: moment = momentum.Other solution, that doesn't involve a tool. I drop the balls from different heights at different times so that they end up on the scale at the same time. If I neglect friction then the time of fall doesn't depend on the weight so that it's possible to do some computatio beforehand.
Last edited by iwanttobelieve on January 29th, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
darkforce
Topic Author
Posts: 0
Joined: October 21st, 2005, 4:58 pm

ball weighing

January 30th, 2007, 4:21 pm

Neone has solution that does not involve cutting the balls or using anything other than the digital scale?
 
User avatar
vixen
Posts: 0
Joined: April 5th, 2006, 1:43 pm

ball weighing

January 30th, 2007, 5:16 pm

Take one ball from each jar, label them, stand on the balance and juggle them!
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

January 30th, 2007, 6:06 pm

QuoteOriginally posted by: darkforceNeone has solution that does not involve cutting the balls or using anything other than the digital scale?Since some necessary conditions can't be satisfied, we are naturally looking for farfetched answers...
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

January 30th, 2007, 9:44 pm

I have had a new idea that needs further development. I have shown that if you use pure strategies, you can't possibly end up with identifying the odd jars since the weighting couldn't be injective.Nevertheless, my analysis has been narrow as mixt-type strategies should also been considered.A pure strategy is an element from [[0,10]] whereas a mixt strategy is an element of size 10x10, namely you choose the probabilities that you are going to choose 0 ball, 1 ball, 2 balls etc.. in jar 1, same for jar 2 to 10. Once you have chosen this strategy, you weight and you compute the probability that the 2 odds jars are i and j given the outcome, and you choose the more likely.That's rather complicated since you need to perform maximisations but promising. More soon.
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

ball weighing

February 1st, 2007, 2:57 am

Not sure it would work, but maybe we need to mix the balls (following a pattern I don't know yet) before choosing balls from each jar and weighting them.We need to find a way to choose between 45 different possibilities and just doing a standard 1 ball from jar 1, 2 balls from jar 2, ... will give us just 17 different sums. Maybe there is a rearranging that will lead us to get more information.
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

February 1st, 2007, 8:51 am

If you suppose that (b1,..b_10) are the number of balls you choose from each jar, then you want to maximize #{b_i+b_j}. If b_i is not bounded by 10 then you obtain 45 possible sums but with 10, I think 17 looks hard to beat. I think we need some more hint here. Does the author's thread have any ?
Last edited by iwanttobelieve on January 31st, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

ball weighing

February 2nd, 2007, 3:48 pm

If we look at a simpler case (4 jars 4 balls 2 of the jars with heavier balls) there's a solution where you either choose {0,2,3,4} or {0,1,2,4} balls.
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

ball weighing

February 2nd, 2007, 4:28 pm

An exhaustive search did not return any solution for 5 or 6 jars/balls ... not enough memory for an exhaustive search of all the Tuples for 10 jars/balls, unless i improve the program and discard simmetric solutions.
 
User avatar
iwanttobelieve
Posts: 1
Joined: August 20th, 2006, 7:09 am

ball weighing

February 2nd, 2007, 9:27 pm

Err, I've shown that there didn't exist any solution for 8/2. I recap my proof.Assume that you choose (b1, b2, ... b10) balls.C1) If there exists i,j such that bi = bj then the cardinal of {b_k + b_l, (k,l) in [1,10]²} is stricly lower than C(2,10) where C is the binomial coefficient (that is 45).The set of choices that satisfy 1 is {1,2... 10} {0,1,2,..9} {0,2,3,...} (you discard a number in [0,10]).C2) If there exists 4 consecutive numbers then, card{b_k+b_l} < C(2,10) since b_k + b_{k+3} = b_{k+1} + b_{k+2}.Now, when you discard a number in the sequence {0,1,2,.... 10}, there remain necessarily 4 consecutive numbers...No need for exhaustive search Edit: I think you should make use of 'sets' from STL in C++ to describe {p_i+p_j}
Last edited by iwanttobelieve on February 1st, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

ball weighing

February 3rd, 2007, 2:43 pm

I'm working with Mathematica, not C++ ... I was interested in finding a solution for a simpler case.But it made me think of the simplest way to express all possibilities of choosing balls taking into account that, if we look at all the Binomial[n,2] possibilities of jars we need to test a restricted set of choices where b_j >= b_i, j>i.And we're still not aware of the purpose of proposing the problem.
 
User avatar
sanjeevise
Posts: 0
Joined: August 22nd, 2005, 1:31 pm

ball weighing

February 3rd, 2007, 8:46 pm

Hrmm...Depends on how many of these glass jars you could weight at the same time. Stick them all on the scales then take them off one at a time noting the drop in weight, or put them on the scale one at a time noting the increase in weight. Is that technically one weighing?
 
User avatar
Msccube
Posts: 0
Joined: May 5th, 2006, 12:09 pm

ball weighing

February 4th, 2007, 8:19 am

QuoteOriginally posted by: darkforceNeone has solution that does not involve cutting the balls or using anything other than the digital scale?I am sorry that I cannot understand this. In your question, you ask us how to find out those two jars by using one weighting on a digital scale.But now, you ask whether anyone has a solution other than using the digital scale.By the way, this question can be solved if the jar contains 100 balls rather than 10 balls. Is a zero missing in the question?
Last edited by Msccube on February 3rd, 2007, 11:00 pm, edited 1 time in total.