# 6.1 - An Example

6.1 - An Example

## Example 6-1

A desk lamp produced by The Luminar Company was found to be defective ($$D$$). There are three factories ($$A, B, C$$) where such desk lamps are manufactured. A Quality Control Manager (QCM) is responsible for investigating the source of found defects. This is what the QCM knows about the company's desk lamp production and the possible source of defects:

 Factory % of total production Probability of defective lamps $$A$$ $$0.35=P(A)$$ $$0.015=P(D|A)$$ $$B$$ $$0.35=P(B)$$ $$0.010=P(D|B)$$ $$C$$ $$0.30=P(C)$$ $$0.020=P(D|C)$$

The QCM would like to answer the following question: If a randomly selected lamp is defective, what is the probability that the lamp was manufactured in factory $$C$$?

Now, if a randomly selected lamp is defective, what is the probability that the lamp was manufactured in factory $$A$$? And, if a randomly selected lamp is defective, what is the probability that the lamp was manufactured in factory $$B$$?

In our previous work, we determined that $$P(D)$$, the probability that a lamp manufactured by The Luminar Company is defective, is 0.01475. In order to find $$P(A|D)$$ and $$P(B|D)$$ as we are asked to find here, we need to perform a similar calculation to the one we used in finding $$P(C|D)$$. Our work here will be simpler, though, since we've already done the hard work of finding $$P(D)$$. The probability that a lamp was manufactured in factory A given that it is defective is:

$$P(A|D)=\dfrac{P(A\cap D)}{P(D)}=\dfrac{P(D|A)\times P(A)}{P(D)}=\dfrac{(0.015)(0.35)}{0.01475}=0.356$$

And, the probability that a lamp was manufactured in factory $$B$$ given that it is defective is:

$$P(B|D)=\dfrac{P(B\cap D)}{P(D)}=\dfrac{P(D|B)\times P(B)}{P(D)}=\dfrac{(0.01)(0.35)}{0.01475}=0.237$$

Note that in each case we effectively turned what we knew upside down on its head to find out what we really wanted to know! We wanted to find $$P(A|D)$$, but we knew $$P(D|A)$$. We wanted to find $$P(B|D)$$, but we knew $$P(D|B)$$. We wanted to find $$P(C|D)$$, but we knew $$P(D|C)$$.It is for this reason that I like to say that we are interested in finding "reverse conditional probabilities" when we solve such problems.

The probabilities $$P(A), P(B),\text{ and }P(C)$$ are often referred to as prior probabilities, because they are the probabilities of events $$A$$, $$B$$, and $$C$$ that we know prior to obtaining any additional information. The conditional probabilities $$P(A|D)$$, $$P(B|D)$$, and $$P(C|D)$$ are often referred to as posterior probabilities, because they are the probabilities of the events after we have obtained additional information.

As a result of our work, we determined:

• $$P(C | D) = 0.407$$
• $$P(B | D) = 0.237$$
• $$P(A | D) = 0.356$$

Calculated posterior probabilities should make intuitive sense, as they do here. For example, the probability that the randomly selected desk lamp was manufactured in Factory $$C$$ has increased, that is, $$P(C|D)>P(C)$$, because Factory $$C$$ generates the greatest proportion of defective lamps ($$P(D|C)=0.02$$). And, the probability that the randomly selected desk lamp was manufactured in Factory $$B$$ has decreased, that is, $$P(B|D)<P(B)$$, because Factory $$B$$ generates the smallest proportion of defective lamps ($$P(D|B)=0.01$$). It is, of course, always a good practice to make sure that your calculated answers make sense.

Let's now go and generalize the kind of calculation we made here in this defective lamp example .... in doing so, we summarize what is called Bayes' Theorem.

 [1] Link ↥ Has Tooltip/Popover Toggleable Visibility