Try to solve the problem for a specific N and then generalize to the general case. Set N to 2 and solve. Then try 3. And by that moment you should be able to figure out a general equation.
I recently stumbled up on this question.
Need help in solving this.
N balls thrown at N baskets, what is the chance that a random basket will have at least one ball in it when all baskets have equal chance 1/N?
Try to solve the problem for a specific N and then generalize to the general case. Set N to 2 and solve. Then try 3. And by that moment you should be able to figure out a general equation.
prob(basket has >0 balls) = 1-prob(basket has 0 balls) = 1 - N^(N-1)/N^N = 1 - 1/N = (N-1)/N
Is this correct?
sunragav (04-29-2016)
I tried solving the problem by hand.
With an understanding that the problem statement is
"N balls thrown at N buckets. What is the probability that a random bucket will have atleast one ball when all the buckets have equal chance".
I assumed there is always a ball that falls in to any basket each time the ball is thrown and there is no miss.
I solved it for 2 ,3 and 4 balls by hand and found the following pattern 2/3,6/10,20/35 => i.e., 2/3 , 3/5 , 4/7.
So I arrived at the formula N/(2N-1) where N=no.of balls = no. of buckets.
To confirm this I wrote an algorithm in javascript which I have attached.
https://drive.google.com/file/d/0B8p...ew?usp=sharing
So the answer is N/2N-1.
Correct?
Last edited by sunragav; 04-28-2016 at 09:42 AM. Reason: Forgot to attach the script
I don't think that's correct. My reasoning is as follows:
P(random basket not empty) = P(No empty baskets)P(random basket picked is not empty) + P(One empty basket)P(random basket picked is not empty) + ... + P(N empty baskets)P(random basket picked is not empty)
The above formula is the same as I posted before.
sunragav (04-29-2016)
The logic behind my solution is that
by definition, probability = (No. of favorable events/Total no. of events)
So when we take 2 balls 2 baskets scenario
Total no of events are (1,1)(2,0)(0,2)=> each set has to be seen as (No. of balls in basket1, no.of balls in basket2).
so for basekt 1 ,when we eleminate (0,2) from the above events as there should be atleast 1 ball , the probability that there is atleast one ball there is 2/3.
In the sameway, for 3 baskets 3 balls scenario
Total events : (0,0,3),(0,1,2),(0,2,1),(0,3,0),(1,1,1),(1,0,2),(1,2,0),(2,1,0),(2,0,1),(3,0,0)
So total no. of events = 10
So the events that basket 1 will have atleast one ball are (1,1,1),(1,0,2),(1,2,0),(2,1,0),(2,0,1),(3,0,0)
Total of events favorable for basket 1 is 6.
So the probability for basket1 to have atleast one ball in it is 6/10 = 3/5
so far p(2), p(3) === 2/3, 3/5 ...
This forms a series of N/(2N-1)
Am I doing anything wrong?
I will give more thought on your answer as I have forgot my high school maths now. Sorry that I am week in understanding your solution. It takes some time to sync in that concept. I will come back to you after some time.
I got your logic. thanks!
So for an instance , in 3 balls 3 baskets scenario, when I apply your formula, I get,
p(m=0)*3/3 = p(m=0) = 1/10
p(m=1)*2/3 = p(m=1)*2/3 = 6/10*(2/3)
p(m=2)*1/3 = p(m=2)*1/3 = 3/10*(1/3)
p(m=3)*0/3 = p(m=3)*0 = 0
So the ans is (1/10)+(6/10)*(2/3)+(3/10)*(1/3) = (1/10)+(12/30)+(3/30) = 1/10*(1+(12/3)+(3/3)) =1/10*(1+4+1)=6/10 = 3/5
which is the same as what I got with my approach.
Please correct me if I am wrong.
Last edited by sunragav; 04-28-2016 at 12:27 PM. Reason: adding details
I get (3!/3^3)*1+(3*3*2/3^3)*(2/3)+(3*1*1/3^3)(1/3) = 19/27 with N=3.
sunragav (04-29-2016)
I dont really get that right. Can you explain how p(m=0) is (3!/3^3) and so on.
First of all according to me, the total no of possible outcomes is 10. But 3^3 is 27. Its confusing. Can you please point me to some right guide or course where I can learn the high school probability better?
Last edited by sunragav; 04-29-2016 at 12:04 AM.
But does it matter when the balls are identical. Arent we supposed to eliminate those duplicate cases. For an instance , when we ignore how many ever different ways a set of (1,1,1 ) can happen, we ihave only one such event to consider. Probabilty science does not allow that?
Tweet |