Jump to content

Recommended Posts

Posted

If I have x number of balls in a lottery, how many times will I have to draw a ball at random and replace it before I draw a ball that has already been drawn once before?

 

I developed an algorithm to solve this, I think it works, not entirely sure. But I was wondering how to solve it algebraicly, here is my algorithm:

 

t = number of balls in lottery
x = 1
n = 0

while (x>0.5) {
   n = n + 1
   x = x * (t - n + 1) / t
}

Answer = n

Posted

the question is badly worded. and the answer is x+1 if we assume you mean "have to draw a ball that has been drawn before". obviously, by the pigeon hole principle in x+1 draws there is at elast one repetition, and in x draws it is possible to get each balle xactly once.

 

however, you might mean "draw with probability freater than 1/2 a balll that has been drawn before, and that is a simple exercise in probability (geometric i think).

Posted

[math]\frac{n!}{n^n}[/math]

But how does that help?

 

EDIT: OK, perhaps this is better, but I how would I then solve for n?

 

[math]\frac{t!}{t^n.(t-n)!}<0.5[/math]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.