Calculating the conditional probability

1.3k Views Asked by At

A new computer program consists of two modules, A and B. First model contains an error with probability 0.2 and second contains an error with probability 0.4. An error in the first module alone cause the program to crash with probability 0.5, and for the second module, it is 0.8. If there are errors in both modules, the programs crashes with a probability of 0.9. Suppose the program crashed, what is the probability of error in both the modules?

1

There are 1 best solutions below

0
On

The program crashes, event C, iff there is (error in A and not in B) or (error in B and not in A) or (errors in both A and B). Thus, P(C) = P(C n A n not B) + P(C n not A n B) + P(C n A n B).

P(C n A n not B) = P( C | A n not B) P(A n not B) = P( C | A n not B) P(A)P(not B) = 0.5(0.2)(0.6) = 0.06. This is because A and B are independent ( the fact that there is error in module A does not determine whether there is error in B).

In similar way, P(C n not A n B) = P( C | not A n B) P(not A n B) = P( C | not A n B) P(not A)P(B) = 0.8(0.8)(0.4) = 0.256.

And P(C n A n B) = P(C | A n B)P(A n B) = P(C | A n B)P(A)P(B) = 0.9(0.2)(0.4) = 0.072. Hence

P(C) = 0.06 + 0.256 + 0.072 =0.388.

Now, what you are to find is

P(A n B | C) = P(C| A n B) P(A n B) / P(C) = P(C| A n B) P(A)P(B) / P(C) = 0.9(0.2)(0.4)/(0.388) = 0.1856.