Application of Bayes' Rule Suppose that chips for an integrated circuit are tested and that the probability that they are detected if they are defective is $.95$. The probability that they are declared sound if in fact they are sound is $.97$. If $5\%$ of the chips are faulty, what is the probability that a chip that is declared faulty is sound? For some reason I got $0.97$. Is that correct? 
 A: I will deliberately use a "solution" that is excessively sloppy, and does not use Bayes's Rule. For a formal argument, I prefer to use the definition of conditional probability. 
Imagine testing a large number of chips, say $10000$. Then "roughly" $5\%$ of these, so about $500$, are defective, and the remaining $9500$ are good.
Of the $500$ or so defectives, about $95\%$, so $475$, are declared defective. 
Of the $9500$ good chips, $3\%$, so $285$, are declared defective. 
Thus $760$ chips were declared defective. Of these, $285$ were actually good. 
It follows that the probability that a chip is good given that it is declared defective is $\frac{285}{760}$.
Added: We now give a formal argument. Let $A$ be the event the chip is good, and let $B$ be the event the chip is declared defective. We want $\Pr(A\mid B)$. By the definition of conditional probability we have 
$$\Pr(A\mid B)=\frac{\Pr(A\cap B)}{\Pr(B)}.\tag{1}$$ 
We have $\Pr(A\cap B)=(0.95)(0.03)$. For the probability that a chip is good is $0.95$, and given that it is good, the probability it is declared defective is $1-0.97$, that is, $0.03$.
We now find $\Pr(B)$. Note that the event  a chip is declared bad can happen in two disjoint  ways: (i) It is good, but declared bad or (ii) it is bad, and declared bad.
We already saw that the probability of (i) is $(0.95)(0.03)$. A similar calculation shows that the probability of (ii) is $(0.05)(0.95)$. Thus $\Pr(B)=(0.95)(0.03)+(0.05)(0.95)$. 
Finally, to find $\Pr(A\mid B)$, use Formula (1). The answer happens to simplify to $\frac{3}{8}$, that is, $0.375$, since the $0.95$'s in top and bottom happen to cancel. 
Note that the formal calculation mirrors the informal one that we did earlier.
A: Bayes' Rule states, when expanded with total probability, that:
$$P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B \mid \neg A)P(\neg A) + P(B \mid A)P(A)}$$
Let's designate $A$ as the event that a chip is sound, and $B$ as the odds that it is declared faulty. Note that $P(B \mid A)$ is $1 - P(\neg B \mid A) = 1 - 0.97 = 0.03$, as $P(A\mid B)$ and $P(B\mid A)$ are complimentary probabilities (if one happens, the other doesn't). Since 5% of the chips are faulty, 95% are not and therefore $P(A) = 0.95$. Filling in, we get:
$$P(A \mid B) = \frac{0.03 \cdot 0.95}{0.97 \cdot 0.05 + 0.03 \cdot 0.95} = 0.02718$$
Therefore, about $2.718\%$ of the chips declared faulty will be sound.
A: \begin{align}
& \Big(\Pr(\text{faulty}\mid\text{declared faulty}),\ \Pr(\text{sound}\mid\text{declared faulty})\Big) \\[10pt]
\propto {}& (\Pr(\text{faulty},\ \Pr(\text{sound}))\times(\Pr(\text{declared faulty} \mid \text{faulty}),\ \Pr(\text{declared faulty} \mid \text{sound})) \\[10pt]
= {} & (0.05,\ 0.95) \times (0.95,\ 0.03) \\[10pt]
\propto {} & (5,95)\times(95,3) = (475,\ 285) = 95\times (5,\ 3) \\[10pt]
\propto {} & \left(\frac 5 8,\ \frac 3 8 \right) = (0.625,\ 0.375).
\end{align}
Saving normalization for the LAST step is often more efficient.
