# Probability of 4 specific numbers (1-3000) occuring in a sample of 400

How to calculate the probability that four specific, distinct numbers from the range 1 - 3000 occur at least once in a fixed sample of 400 random numbers from the range 1-3000? The numbers in the sample can repeat as they were randomly generated.

My intuition would be that it is basically a set of four "scans" of the 400 numbers, so the probability of hitting the 1/3000 searched number in each of the scans is roughly 400/3000 = 2/15. This would give the total probability count as (2/15)x(2/15)x(2/15)x(2/15) = 16/50625 = 0,000316. However, I'm not sure if this accounts (and if it should account) for the fact that it is a fixed sample so it's not "re-rolled" for each of the four scans.

Use inclusion/exclusion principle:

• Include the number of combinations with at least $\color\red0$ missing values: $\binom{4}{\color\red0}\cdot(3000-\color\red0)^{400}$
• Exclude the number of combinations with at least $\color\red1$ missing values: $\binom{4}{\color\red1}\cdot(3000-\color\red1)^{400}$
• Include the number of combinations with at least $\color\red2$ missing values: $\binom{4}{\color\red2}\cdot(3000-\color\red2)^{400}$
• Exclude the number of combinations with at least $\color\red3$ missing values: $\binom{4}{\color\red3}\cdot(3000-\color\red3)^{400}$
• Include the number of combinations with at least $\color\red4$ missing values: $\binom{4}{\color\red4}\cdot(3000-\color\red4)^{400}$

Finally, divide by the total number of combinations, which is $3000^{400}$:

$$\frac{\sum\limits_{n=0}^{4}(-1)^n\cdot\binom{4}{n}\cdot(3000-n)^{400}}{3000^{400}}\approx0.000239$$

• Thank you. Sorry for a layman question but how does this formula account for an increase of probability as the sample increases?
– Vam
Jul 7 '16 at 9:54
• @Vam: You're welcome. If you're asking what happens to the probability when you change $40$ to a larger value, then I don't know. Intuitively, I would guess that the probability decreases as you increase the sample size. But I don't have any proof of that. You can post it as a separate question. Jul 7 '16 at 10:37

Label the $4$ numbers and let $E_{i}$ denote the event that number with label $i\in\left\{ 1,2,3,4\right\}$ does not occur in the sample.

Then you are looking for $\Pr\left(E_{1}^{c}\cap E_{2}^{c}\cap E_{3}^{c}\cap E_{4}^{c}\right)=1-\Pr\left(E_{1}\cup E_{2}\cup E_{3}\cup E_{4}\right)$.

With inclusion/exclusion and symmetry we find that this equals:

$$1-4\Pr\left(E_{1}\right)+6\Pr\left(E_{1}\cap E_{2}\right)-4\Pr\left(E_{1}\cap E_{2}\cap E_{3}\right)+\Pr\left(E_{1}\cap E_{2}\cap E_{3}\cap E_{4}\right)$$

Can you take it from here?

• I must have messed something up along the way, as my Pr (Ec1∩Ec2∩Ec3∩Ec4) came out as 0.4624 which is obviously way too high (more likely than Pr for E1). I took Pr E1 as 0.8666, Pr (E1∩E2) as 0.9822, Pr (E1∩E2∩E3) as 9976 and Pr (E1∩E2∩E3∩E4) as 9996.
– Vam
Jul 7 '16 at 9:50
• Thanks, this solves it. Sorry for an easy question.
– Vam
Jul 7 '16 at 10:16