If a computer code is correctly programmed, it gives 90% acceptable results. But if it is not correctly programmed, it gives only 40% acceptable results. From previous experience, it is observed that only 80% of codes are correctly programmed. If after a certain programming, the code gives 2 acceptable results, then the approximate probability that the code is correctly programmed is
Answer & explanation
Correct answer: option 1
The correct answer is Option (1) → $\frac{81}{85}$
Let:
- $C$ = event that code is correctly programmed
- $\neg C$ = event that code is not correctly programmed
- $A$ = event that code gives 2 acceptable results
Given:
- $P(C) = 0.8$, $P(\neg C) = 0.2$
- $P(A \mid C) = (0.9)^2 = 0.81$
- $P(A \mid \neg C) = (0.4)^2 = 0.16$
Using Bayes’ Theorem:
$P(C \mid A) = \frac{P(A \mid C) \cdot P(C)}{P(A \mid C) \cdot P(C) + P(A \mid \neg C) \cdot P(\neg C)}$
$= \frac{0.81 \cdot 0.8}{0.81 \cdot 0.8 + 0.16 \cdot 0.2} = \frac{0.648}{0.648 + 0.032} = \frac{0.648}{0.68}$
$= \frac{648}{680} = \frac{81}{85} ≈ 0.9529$
Final Answer: Approximately 0.953