Does the random variable have a binomial or hypergeometric distribution

66 Views Asked by At

So I'm given a probability assignment that states the following:

In one garden there are 15 cherries out of which 5 are contaminated. One greedy little pig ( Sorry for the cringe ) eats 3 out of those 15 cherries.

Find the probability that out of those 3 cherries that it has eaten 1 will be contaminated.

So in order to solve this I assume that I will have to use the following method:

If 1 of those 3 is contaminated then either the first, second or third one will be contaminated so I will have to use the binomial distribution. However since the pig eats 3 all at once then I'm starting to think that the Hypergeometric distribution seems more logical. So what distribution should I use the first or the second one?

1

There are 1 best solutions below

0
On

It's the hypergeometric distribution - sampling without replacement: each cherry eaten changes the probability of choosing a contaminated cherry on the next pick.

See how the percentage of $3$ draws from a vector of $15$ elements (cherries) (with $5$ of them contaminated) that include $1$ (and only $1$) contaminated cherry in a $1$-million-trial Monte Carlo simulation matches the calculation of the probability of the same event using the hypergeometric distribution (using R):

> x = c(rep(0,10), rep(1,5))                   # Vector of 15 cherries with 5 contaminated
> mean(colSums(replicate(1e6,sample(x,3)))==1) # Monte Carlo simulation (1 mil. sim.)
[1] 0.494702
> dhyper(1, 5, 10, 3, log=F)                   # Built-in R hypergeometric function
[1] 0.4945055