2

I have 2 fixed buckets. Than I have N cards (let's say I have 4 Cards). Each card can be thrown inside one bucket with the same probability.

I want to know which is the probability that at least K (say K = 1) will go into the first bucket.

In this case with K = 1 and 4 cards I have

$$P = \frac{15}{16} $$ Where 15 are the good events (the only bad event is when all 4 cards go inside the other bucket) / 16 possibile combinations

If I have K = 2 and 4 cards (with always 2 bucket) I have a probability that at least K = 2 cards will go into the first bucket of:

$P = 11/16$

Which is the formula that given K and N calcs the probability (or just the good events?) that at least K cards will go into the first bucket?

Related questions:
- How can I solve bins-and-balls problems?
- What's the probability that there's at least one ball in every bin if 2n balls are placed into n bins?

dynamic
  • 310

1 Answers1

2

Use Bernoulli's Trails.

$$P(K)=\binom n k p^{n-K}q^k$$ P(k) is probability of K success in n trails. p=prob. of success, q=1-p=prob. of failure .

$P$(atleast 1)$=1-P(0)=p^n$

$P$(atleast k)$=P(1)+P(2)+... P(k)$

Here as cards are all equal, (p,q) for each is same and equal to 1/2.

So, the general formula for n cards and atleast k in one bucket of 2 is : $$p(\text{atleast k})=\dfrac{\binom nk +\binom n{k+1} \dots + \binom n{n}}{2^n}$$

  • Use this for $n=4,k=2$

    you get $p(2)=11/16$.

  • for $n=4,k=1$

    $p(1)=15/16$

ABC
  • 6,034
  • @yes123 Okay,but i thought you want general. – ABC May 05 '13 at 13:13
  • @yes123 That $2^n$ in p(atleast k) is due to two buckets in the question. – ABC May 05 '13 at 13:16
  • Thanks a lot! Anyway how do you calc that sum of binomial terms in the numerator of p(at least k) ? – dynamic May 05 '13 at 13:17
  • @yes123 I don't think there is any general formula for sum till $\binom nk$ but i'll see. Otherwise in these problems n,k are small enough that they can be calculated easily. – ABC May 05 '13 at 13:19
  • I have pretty big numbers :(, N can be up to $10^6$. I need a direct formula – dynamic May 05 '13 at 13:20
  • @yes123 if $ n=10^6$ what is k close to? – ABC May 05 '13 at 13:22
  • K is in the range $[1 ... 10^6]$ I can't calc it with a loop, I need a direct formula I believe. Anyway I am +1 your previous answers :) – dynamic May 05 '13 at 13:23
  • Maybe we can use the formula at the end of pag 120: http://books.google.it/books?id=qT2srNLLxB0C&lpg=PA120&ots=W2PPJAOY-o&dq=Bernoulli's%20Trails&hl=it&pg=PA120#v=onepage&q=Bernoulli's%20Trails&f=false – dynamic May 05 '13 at 13:28
  • ( Related question: http://math.stackexchange.com/questions/114443/given-k-balls-and-n-buckets-what-is-the-expected-number-of-occupied-buckets ) – dynamic May 05 '13 at 13:34
  • Related2: http://math.stackexchange.com/questions/119076/how-can-i-solve-bins-and-balls-problems – dynamic May 05 '13 at 13:49
  • @yes123 Sorry the last is $\binom n{n-k}$ – ABC May 05 '13 at 16:42
  • @yes123 Sorry again. It's my time to sleep but I'm online. It must start from $\binom nk$ to $\binom nn$ – ABC May 05 '13 at 16:47
  • Well now it could be a lot faster because N and K aren't too far... But still It would be interesting to find a closed formula, thanks again anyway – dynamic May 05 '13 at 16:51
  • @yes123 I had asked this before . But then the range you gave astonished me. – ABC May 05 '13 at 16:52
  • the range are still that, but now the formula it totally different.. before if K was big I had to calc a lot of binomial coeff. Anyway I am praticing this problem: https://code.google.com/codejam/contest/2434486/dashboard#s=p1 you are pretty good you should partecipate – dynamic May 05 '13 at 16:55
  • I know you are solving that problem now :D – dynamic May 05 '13 at 17:11
  • @yes123 No, it seemed to more difficult, maybe I'll try next day. – ABC May 05 '13 at 17:15
  • @yes123 YES if n>4, p(1)=1 – ABC May 05 '13 at 17:22
  • Anyway your formula worked for the small dataset where N is up to 20.. For the large dataset number grows too much (it is correct anyway)... – dynamic May 05 '13 at 17:49