Expected number of random bitstrings that match a certain prefix

37 Views Asked by At

I am faced with the following problem. Assume I generate $N$ random bitstrings of length $L$ without replacement, that is, no duplicate bitstrings are allowed. Now let $p$ be an arbitrary, but fixed, prefix of length $|p| <L$. In expectation, how many generated bitstrings have the same prefix $p$? I was thinking that the number should be $1/2^{|p|} \cdot N$, but this seems to neglect the fact that I sample the bitstrings without replacement. Is there any other way that I can estimate the number? An upper bound is also completely fine.