# Thread: Law of total probability - need some clarification

1. ## Law of total probability - need some clarification

Two machines, A and B, operate in some factory.
Machine A produces 10% of the factory's products.
Machine B produces 90% of the factory's products.

1% of machine A's products are flawed.
5% of machine B's products are flawed.

One product randomly selected.
what is the probability that it's flawed?

So, this is what I did:
let $C=\left \{ product\hspace{4} x\hspace{4} is\hspace{4} flawed \right \}$
let $A=\left \{ x\hspace{4} produced\hspace{4} in\hspace{4} A \right \}$
let $B=\left \{ x\hspace{4} produced\hspace{4} in\hspace{4} B \right \}$
Now, according to the law of total probability, we'll get that:
$P(C)=P(A)\cdot P(C|A)+P(B)\cdot P(C|B)=10\%\cdot (10\%\cdot 1\%)+90\%\cdot (90\%\cdot 5\%)=4.05\%$

but the answer is:
$P(C)=P(A)\cdot P(C|A)+P(B)\cdot P(C|B)=(10\%\cdot 1\%)+(90\%\cdot 5\%)=4.6\%$

Why were $P(A)$ and $P(B)$ omitted?

2. ## Re: Law of total probability - need some clarification

Originally Posted by Stormey
Two machines, A and B, operate in some factory. Machine A produces 10% of the factory's products. Machine B produces 90% of the factory's products.
1% of machine A's products are flawed. 5% of machine B's products are flawed.
One product randomly selected.
what is the probability that it's flawed?
So, this is what I did:
let $C=\left \{ product\hspace{4} x\hspace{4} is\hspace{4} flawed \right \}$
let $A=\left \{ x\hspace{4} produced\hspace{4} in\hspace{4} A \right \}$
let $B=\left \{ x\hspace{4} produced\hspace{4} in\hspace{4} B \right \}$
$P(C)=P(A)\cdot P(C|A)+P(B)\cdot P(C|B)=(10\%\cdot 1\%)+(90\%\cdot 5\%)=4.6\%$
$P(C)=P(C\cap A)+P(C\cap B)$
$P(C\cap A)=P(C|A)P(A)=(0.1)(0.01)$,
That is, probability it is flawed given A made it times probability that A made it.

3. ## Re: Law of total probability - need some clarification

Hi Plato, thanks for the help.

Originally Posted by Plato
That is, probability it is flawed given A made it times probability that A made it.
that is exactly my question...
I'll try to rephrase.

the probability tree looks like this:

"probability it is flawed given A made it" (meaning P(C|A) ), if we follow the tree from its root along its branches, is $0.1\times 0.01$

"probability that A made it" (meaning P(A) ), again, according the tree it's $0.1$

so "probability it is flawed given A made it times probability that A made it" should be $(0.1\times 0.01)\times 0.1$

4. ## Re: Law of total probability - need some clarification

Originally Posted by Stormey
Hi Plato, thanks for the help.

that is exactly my question...
I'll try to rephrase.

the probability tree looks like this:

"probability it is flawed given A made it" (meaning P(C|A) ), if we follow the tree from its root along its branches, is $0.1\times 0.01$

"probability that A made it" (meaning P(A) ), again, according the tree it's $0.1$

so "probability it is flawed given A made it times probability that A made it" should be $(0.1\times 0.01)\times 0.1$
I really don’t understand what you are asking.
While in general I am no fan of probability trees, your's makes the answer quite clear.
In order for a part to be flawed is must come from either machine A or machine B.

\begin{align*} \mathcal{P}(C)&=\mathcal{P}(C\cap A)+ \mathcal{P}(C\cap B)\\ &= \mathcal{P}(A)\mathcal{P}(C|A)+ \mathcal{P}(B)\mathcal{P}(C|B)\\&=(0.1)(0.01)+(0.9 )(0.05)\end{align*}

5. ## Re: Law of total probability - need some clarification

Originally Posted by Plato
I really don’t understand what you are asking.
While in general I am no fan of probability trees, your's makes the answer quite clear.
In order for a part to be flawed is must come from either machine A or machine B.

\begin{align*} \mathcal{P}(C)&=\mathcal{P}(C\cap A)+ \mathcal{P}(C\cap B)\\ &= \mathcal{P}(A)\mathcal{P}(C|A)+ \mathcal{P}(B)\mathcal{P}(C|B)\\&=(0.1)(0.01)+(0.9 )(0.05)\end{align*}
OK, I get it now,
I misunderstood the law of total probability, and it confused me.

Thanks.

6. ## Re: Law of total probability - need some clarification

Here's how I would do it:

Assume the machines produce 1000 products

Machine A produces 10% of the factory's products.
so machine A produces 100 of the products.

Machine B produces 90% of the factory's products.
And machine B produces 900.

1% of machine A's products are flawed.
1% of 100 is 1. Machine A produces 1 flawed product.

5% of machine B's products are flawed.
5% of 900 is 45. Machine B produces 45 flawed products.

One product randomly selected.
what is the probability that it's flawed?
Of the 1000 products 45+ 1= 46 are flawed. The probability any one is flawed is $\frac{46}{1000}= 0.046$.