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) → \(\displaystyle\frac{81}{85}\)
Let C be the event that the code is correctly programmed and E the event that it gives 2 acceptable results.
\(P(C) = 0.8,\quad P(C') = 0.2\)
The two results are taken as independent runs of the code, so the probability of two acceptable results is the square of the probability of one:
\(P(E \mid C) = (0.9)^2 = 0.81\)
\(P(E \mid C') = (0.4)^2 = 0.16\)
By Bayes’ theorem:
\(\displaystyle P(C \mid E) = \frac{P(C)P(E \mid C)}{P(C)P(E \mid C) + P(C')P(E \mid C')}\)
\(\displaystyle = \frac{0.8 \times 0.81}{0.8 \times 0.81 + 0.2 \times 0.16}\)
\(\displaystyle = \frac{0.648}{0.648 + 0.032} = \frac{0.648}{0.68} = \frac{81}{85}\)
Why the other options are incorrect
Option (2) \(\displaystyle\frac{9}{10}\) — Incorrect. This is the answer for one acceptable result: \(\frac{0.8 \times 0.9}{0.8 \times 0.9 + 0.2 \times 0.4} = \frac{0.72}{0.8} = \frac{9}{10}\). The code gives 2 acceptable results, so each likelihood must be squared.
Option (3) \(\displaystyle\frac{17}{20}\) — Incorrect. \(\frac{17}{20} = 0.85\), but the probability is \(\frac{81}{85} \approx 0.953\).
Option (4) \(\displaystyle\frac{13}{20}\) — Incorrect. \(\frac{13}{20} = 0.65\), far below \(\frac{81}{85} \approx 0.953\).
NCERT (2026-27 edition):
Bayes' Theorem
