# What is the probability of 5 anomalies appearing in a batch of 100, from a data set of 1000 examples and 10 anomalies?

I am trying to work out the expected value of the following example:

A data set contains 1000 examples in total. 10 examples can be considered anomalous.

I am randomly drawing 100 examples to form a batch.

I have two related questions.

1) What is the probability that a batch will contain 5 or more anomalies?

2) What is the probability that a batch will contain 1 or more anomalies?

Attempted Solution

I believe I need to calculate the combinations.

I can start by considering the probability that I draw no anomalies and taking the compliment. Let $$X$$ be the number of anomalies.

$$P(X \ge 1 ) = 1 - P(X = 0)$$, where $$P(X = 0) = C(10,0) C(990,100) / C(1000,100) = 0.346$$ so $$P(X \ge 1 ) = 0.653$$

So 65.3% of the time a batch will contain at least one anomaly? I'm doubting myself because that seems so high.

For the probability of drawing at least 5 anomalies, I'm less sure where to begin.

• Aren't you in the process of studying Binomial distributions? If so, then most likely your batches are samples with replacement. If not, then see our posts about hypergeometric distributions. – whuber Jan 6 at 19:22
• There is no replacement in this context. The idea is you are drawing 100 from 1000 all at once. – Nick Merrill Jan 6 at 19:37
• Then generalize your formula about combinations: it is correct. Note that the answer to (1) is the sum $P(X=5)+\cdots + P(X=10).$ – whuber Jan 6 at 19:46
• The comment thread below was deleted, so for completion, I will post the solution The probability of drawing 5 anomalies is ~ 0.15% – Nick Merrill Jan 6 at 19:57