1
$\begingroup$

The exercise

A batch of 30 bulbs contains two defective ones. A random sample with no batch return of size 4 is obtained.

a) What is the probability that the sample contains at least one defective bulb?

b) What should be the size of the sample, so that the probability of finding at least one defective bulb, is at least 0.5?

My solution

Let $X$ be the number of defective bulbs in a sample of size $n$, with $$ X \sim \mathrm{Hypergeometric}(30,2,n). $$ a) $P(X≥1) = 1-f_X(0) = 0.252873563... \Leftrightarrow n=4$

b) $P(X≥1)≥0.5 \Leftrightarrow n=k$

  • $P(X≥1) = 1-f_X(0) = 1-\dfrac{\binom{28}{n}}{\binom{30}{n}}≥0.5 \Leftrightarrow n=k$
  • $P(X≥1)$ grows as $n$ grows $\Rightarrow$ if $P(X≥1) = 0.5$ for $n = k \Rightarrow n≥k$ for which $P(X≥1)≥0.5$

And I came here, but I do not know if the reasoning is right. And if it's okay, I also do not know how to get the value of $k$, so that $n$ is greater than or equal to that $k$.

  • 0
    what distribution is $H$?2017-02-07
  • 1
    Is the $H$ypergeometric. I really do not know how it is symbolized.2017-02-07

2 Answers 2

1

Observe $$\begin{align*} \Pr[X \ge 1] &= 1 - \frac{\binom{28}{n}}{\binom{30}{n}} \\ &= 1 - \frac{28!}{n!(28-n)!} \cdot \frac{n!(30-n)!}{30!} \\ &= 1 - \frac{28!}{30!} \cdot \frac{(30-n)!}{(28-n)!} \\ &= 1 - \frac{28!}{(30)(29)(28!)} \cdot \frac{(30-n)(29-n)(28-n)!}{(28-n)!} \\ &= 1 - \frac{(30-n)(29-n)}{(30)(29)}. \end{align*}$$ Thus the requirement that $\Pr[X \ge 1] \ge \frac{1}{2}$ leads to the quadratic inequality in $n$ $$n^2 - 59n + 435 \le 0.$$ Solving for the roots using the quadratic formula gives $$\frac{59 - \sqrt{1741}}{2} \le n \le \frac{59 + \sqrt{1741}}{2},$$ from which we conclude that the least such integer $n$ that satisfies the criterion is $$n = 9.$$


It is worth noting that because there are only $2$ defective items, the solution can be found relatively easily. In general, solving for the minimum $n$ involves finding the smallest real root of a degree $m$ polynomial where $m$ is the number of defects. In cases where $m \ge 3$, it may be simpler to just perform trial computations and find the result by brute force.

  • 0
    Nice! I looked at that way briefly, but botched it. (+1)2017-02-07
  • 0
    How did you go from $1 - \frac{28!}{n!(28-n)!} \cdot \frac{n!(30-n)!}{30!}$ to $1 - \frac{(30-n)(29-n)}{(30)(29)}$?2017-02-07
2

This is a problem on the hypergeometric distribution.

You may be able to unscramble the binomial coefficients and the factorials to get an algebraic solution. The ratio of the binomial coefficients simplifies considerably after several 'cancellations'.

But my guess is this may be a drill problem in computing hypergeometric probabilities, and that you are expected to use the 'brute force' method of trying various values of $n$ until you get the answer. That is feasible because the required $n$ isn't very large.

You have already done the proper computation for $n = 4.$ In R statistical software the computation to verify your answer is as follows:

1 - dhyper(0, 2, 28, 4)
## 0.2528736

Now, it is easy to see the answer from the following, sightly wasteful, computation:

n = 4:10;  pr = 1 - dhyper(0,2,28,n)
cbind(n, pr)      # 'cbind' binds together two column vectors to make table
  ##  n        pr
  ##  4 0.2528736
  ##  5 0.3103448
  ##  6 0.3655172
  ##  7 0.4183908
  ##  8 0.4689655
  ##  9 0.5172414
  ## 10 0.5632184

With a bit of strategy, you could vastly reduce the number of values you'd have to try--either on a calculator or with MatLab, R, or some other software.

  • 1
    In fact I had already tried to do it in the scientific calculator to see more or less how much I would have to give. But I wanted to know if it was possible to do it without brute force, if in the future they asked me the same calculation but with larger numbers.2017-02-07
  • 1
    Ideas: As long as number $n$ sampled is relatively small compared with number $N$ in batch, hypergeometric and binomial are not much different. It might be easier to get close to the right answer using binomial, then test out the exact result with hypergeometric. Also, in some cases, normal aprx to hypergeometric might be useful. // I don't think Sitling's approx for factorials is accurate enough for small numbers. // The general topic related is 'sampling plans' for inspection; I think software is generally used for those, but you might find some useful analytic formulas.2017-02-07
  • 1
    Oops! _Stirling's_ approximation.2017-02-07
  • 1
    @heropup's Answer is probably what you want.2017-02-07