# A Combinatoric Probability Question

Suppose we have infinitely many boxes and the probability of any one box is non-empty is p.
Now if we randomly choose m boxes from them, line them up and name them as box 1, box 2,..., box m. Then for given n and k (k<n<m), what is the probability that there exist a set of n consecutive boxes that we can find k or more non-empty boxes in it?
Anyone know how to approach this question? Thanks.

matt grime
Homework Helper
let E(r) be the probaility that there are k empty boxes in the range (r,r+n-1) where r can go from 1 to m-n+1. Then we want to know

P(E(1)or(E(2)or..E(m-n+1))

which is inclusion exclusion principle innit?

you can formulate the following recursion
f(m+1,n,k)=f(m,n,k)-f(m-n+1,n,k).C(n-1,k-1).p^k.(1-p)^(n-k)
where f(m,n,k) is the probability that...("what you have stated")