Answer:
(i) The probability that there is a bug in the program given that the de-bugging program has detected the bug is 0.3333.
(ii) The probability that the bug is actually present given that the de-bugging program claims that bugs are present on both the first and second tests is 0.1111.
(iii) The probability that the bug is actually present given that the de-bugging program claims that bugs are present on all three tests is 0.037.
Step-by-step explanation:
Denote the events as follows:
<em>B</em> = bugs are present in a computer program.
<em>D</em> = a de-bugging program detects the bug.
The information provided is:
(i)
The probability that there is a bug in the program given that the de-bugging program has detected the bug is, P (B | D).
The Bayes' theorem states that the conditional probability of an event <em>E </em>given that another event <em>X</em> has already occurred is:
Use the Bayes' theorem to compute the value of P (B | D) as follows:
Thus, the probability that there is a bug in the program given that the de-bugging program has detected the bug is 0.3333.
(ii)
The probability that a bug is actually present given that the de-bugging program claims that bug is present is:
P (B|D) = 0.3333
Now it is provided that two tests are performed on the program A.
Both the test are independent of each other.
The probability that the bug is actually present given that the de-bugging program claims that bugs are present on both the first and second tests is:
P (Bugs are actually present | Detects on both test) = P (B|D) × P (B|D)
Thus, the probability that the bug is actually present given that the de-bugging program claims that bugs are present on both the first and second tests is 0.1111.
(iii)
Now it is provided that three tests are performed on the program A.
All the three tests are independent of each other.
The probability that the bug is actually present given that the de-bugging program claims that bugs are present on all three tests is:
P (Bugs are actually present | Detects on all 3 test)
= P (B|D) × P (B|D) × P (B|D)
Thus, the probability that the bug is actually present given that the de-bugging program claims that bugs are present on all three tests is 0.037.