Hypergeometric Probability with a twist 
A manufacture receives a lot of 200 parts from vendor. The lot will be unacceptable :
If more than five (>5) parts are defective. 
The manufacturer will select randomly K parts from the lot for
  inspection
The lot will be accepted if there is atmost one (<=1)
  defective in the sample. 
How large does K have to be to ensure that the probability that the
  manufacturer accepts an unacceptable lot is less than 0.05?

 A: Let $N$ be the total number of parts ($N = 200$).
For $n \in \{1, \ldots, N\}$, let $X_n = 1$ if the $n$th part is defective, and $0$ otherwise.
Assume $X_1, \ldots, X_N$ are independent and identically distributed (they will thus be Bernoulli random variables with some common probability of defect $p$).
Let $Y_1, \ldots, Y_N$ be sampled without replacement from $X_1, \ldots, X_N$.
That is, let $\sigma$ be an independent permutation chosen uniformly at random from the symmetric group $\mathfrak{S}_N$, and let $Y_n = X_{\sigma(n)}$ for each $n \in \{1, \ldots, N\}$.

We want to choose the smallest $K \in \{1, \ldots, N\}$ such that
  $$
P\left(\sum_{n=1}^N X_n > 5, \sum_{k=1}^K Y_k \leq 1\right) < 0.05.
$$

First observe that the joint distribution of $(Y_1, \ldots, Y_N)$ is the same as the joint distribution of $(X_1, \ldots, X_N)$.
Indeed, for any $y_1, \ldots, y_N \in \{0, 1\}$ we have
$$
\begin{aligned}
P(Y_1 = y_1, \ldots, Y_N = y_N)
&= P(X_{\sigma(1)} = y_1, \ldots, X_{\sigma(N)} = y_N) \\
&= \sum_{\tau \in \mathfrak{S}_N} P(\sigma = \tau)
P(X_{\tau(1)} = y_1, \ldots, X_{\tau(N)} = y_N \mid \sigma = \tau) \\
&= \frac{1}{n!} \sum_{\tau \in \mathfrak{S}_N} P(X_{\tau(1)} = y_1, \ldots, X_{\tau(N)} = y_N) \\
&= \frac{1}{n!} \sum_{\tau \in \mathfrak{S}_N} P(X_{\tau(1)} = y_1) \cdots P(X_{\tau(N)} = y_N) \\
&= \frac{1}{n!} \sum_{\tau \in \mathfrak{S}_N} \left(p^{y_1} \left(1 - p\right)^{1 - y_1}\right) \cdots \left(p^{y_N} \left(1 - p\right)^{1 - y_N}\right) \\
&= \left(p^{y_1} \left(1 - p\right)^{1 - y_1}\right) \cdots \left(p^{y_N} \left(1 - p\right)^{1 - y_N}\right) \\
&= P(X_1 = y_1) \cdots P(X_N = y_N) \\
&= P(X_1 = y_1, \ldots, X_N = y_N).
\end{aligned}
$$
Using this fact together with the fact that $\sum_{n=1}^N X_n = \sum_{n=1}^N Y_n$, we have
$$
\begin{aligned}
P\left(\sum_{n=1}^N X_n > 5, \sum_{k=1}^K Y_k \leq 1\right)
&= P\left(\sum_{n=1}^N Y_n > 5, \sum_{k=1}^K Y_k \leq 1\right) \\
&= P\left(\sum_{n=K+1}^N Y_n > 5, \sum_{k=1}^K Y_k = 0\right) \\
&\qquad+P\left(\sum_{n=K+1}^N Y_n > 4, \sum_{k=1}^K Y_k = 1\right) \\
&= P\left(\sum_{n=K+1}^N Y_n > 5\right) P\left(\sum_{k=1}^K Y_k = 0\right) \\
&\qquad+ P\left(\sum_{n=K+1}^N Y_n > 4\right) P\left(\sum_{k=1}^K Y_k = 1\right)
\end{aligned}
$$
I'll leave the rest to you: just observe that each sum in the expression above is a binomial random variable, and compute the probabilities using facts about the binomial distribution.
Then choose the smallest $K$ that satisfies the boxed inequality.
A: Performing a Monte Carlo simulation at most 78 samples are needed to find a defect.
Here is the R code I simulated 100,000 trials:
#product lot with 6 defects
product<-c(rep(1,6), rep(0, 194))

#vector to track the index of first found defect
first<-rep(0, 200)

#number of trails
n<-100000


for (i in 1:n){
   #shuffle the products
   y<-sample(product, 200)
   #find the index of the first fail
  index<- min(which(y==1))
  #update the tracker
  first[index]<-first[index]+1
}

cumsum(first)/n
#find the index where 95% of the first fails are found.
min(which(cumsum(first)/n>0.95))

