Solving for True Defect Rate from Limited Lot Data Trying to solve a problem at work. We are creating parts and some are defective with an unknown defect rate. Each part is tested 10 times to see if it works. A defective part will fail an individual test only 5% of the time because the defect is intermittent. 800 parts were tested 10 times each and 29 (3.6% defect rate from lot) of the parts came back as defective (failed at least one of the 10 tests). How can I estimate the total true defect rate for the entire lot of parts (it will be higher than 3.6% because some parts slipped by the 10 inspection tests)?
Since a defective part will fail an individual test 5% of the time there is a 40.1% chance that it will fail at least 1 of the 10 tests. (Binomial CDF with P(X>=1)).
Can I now do:
29/0.401 = 72.3 units are defective in the true state of nature 72.3/800 = 0.0904 percentage of units defective in the true state of nature
I should assume that 9.04% of units coming off the line are really defective.
Is this a correct way to approach the problem?
 A: It seems more direct to use the Law of Total Probability:
Use $F$ for fail test, $G$ for good part, and $D$ for defective part. Then
$$P(F) = P(FG) + P(FD) = P(G)P(F|G) + P(D)P(F|D).$$
Because $P(F|G) = 0,$ you estimate $P(F) \approx 29/800 = 0.03625,$
and $P(F|D) =  0.4012631,$ we have $0.03625 \approx .40126P(D).$
Hence $P(D) \approx .0625/.4013 = 0.0903,$ which agrees with
your original speculation.
 > 1-dbinom(0, 10, .05)
 [1] 0.4012631 

Trivial simulation as check:
 > d = rbinom(10^6, 1, .09)            # 1 if defective part
 > f = d*(rbinom(10^6, 10, .05) >= 1)  # TRUE if fails test
 > mean(f==1)                          # failure rate
 [1] 0.036089

A: If we let $F=\text{fail 10 tests}$, $D=\text{defective}$, $\sim\! F=\text{not }F$, $\sim\! D=\text{not }D$, then you have
$$\Pr[\,\sim\!F\mid D\,]=(1-5\%)^{10}=59.9\%$$
which is the probability that a defective part passes all 10 tests. (This corresponds to your calculation of $\Pr[F\mid D\,]=40.1\%$.)

Update: As noted in the answer by BruceET, your approach is reasonable, and can be expressed in two steps.
Using the law of total probability, the failure rate is
\begin{align}
\Pr[F] &= \Pr[F\vert D] \times \Pr[D] + \Pr[F\vert\sim\!D] \times \Pr[\sim\!D] \\ &= 40.1\% \times \Pr[D] \\
\end{align}
assuming $\Pr[F\vert\sim\!D]=0$.
Your approach corresponds to taking
$$\Pr[F]\approx\frac{n_{\text{fail}}}{N}=\frac{29}{800}\approx{3.6\%}$$
which is the most likely value given the data (i.e. a MLE).
My old answer was trying to incorporate a prior for $\Pr[D]$, so effectively assumed that the MLE failure rate above was unreliable. I now agree with your original analysis and that of BruceET, and think that your approach is the most unbiased.

Now if you have $N=800$ parts, and $n_{\text{fail}}=29$ fail the test, then the number of defective parts is bounded by $n\geq N-n_{\text{fail}}=771$ (assuming the tests give no false positives, i.e. a non-defective part will never fail the test).
The expected number of additional failures is then
$$\mathbb{E}[\Delta n_{\text{fail}}]=\Pr[\,D\mid\,\sim\! F\,]\times n$$
if we assume that the failure rates for the $n$ parts are independent.
From Bayes rule we have
\begin{align}\Pr[\,D\mid\,\sim\! F\,] &= \frac{\Pr[\,\sim\!F\mid D\,]\,\Pr[D]}{\Pr[\sim\! F\,]} \\ &=\frac{\Pr[\,\sim\!F\mid D\,]\,\Pr[D]}{\Pr[\,\sim\!F\mid D\,]\,\Pr[D]+\Pr[\,\sim\!F\mid  \sim\!D\,]\,\Pr[\sim\!D]} \\ &=\frac{59.9\%\times\Pr[D]}{59.9\% \times \Pr[D]+100\%\times(1-\Pr[D])}\end{align}
So you need an estimate for the prior probability that a part is defective, $\Pr[D]$. Normally the idea is that this is determined independently of your current data.
However, if you use $\Pr[D]\approx n_{\text{fail}}/N=3.6\%$ as an estimate, then the result would be $\Pr[\,D\mid\,\sim\! F\,]\approx 2.2\%$, giving $\mathbb{E}[\Delta n_{\text{fail}}]\approx 17$, for a total of $\mathbb{E}[n+\Delta n_{\text{fail}}]\approx 46$ expected defects. This would come out to a defect rate of $46/800\approx 5.8\%$.
