From the past experience of software quality testing, it is known that the probability of the presence of an error in coding is 0.05. If the probability of a tester detecting an error when the error is present is 0.78 and the probability of incorrectly detecting an error when the error is present is 0.78 and the probability of incorrectly detecting an error when the error is not present is 0.06 (a) What is the probability that a code is tested as having an error? (b) What is the probability that a code tested as having an error when the error is present?
Let "C" be the event that a tester correctly detects an error in a code. Also, let "P" be the event that an error is present in a code.
We are given that,
"p(P)=0.05\\implies p(P')=1-p(P)=1-0.05=0.95\\\\ p(C|P)=0.78\\\\p(C'|P)=0.78\\\\p(C'|P')=0.06\\implies p(C|P')=1-p(C'|P')=1-0.06=0.94"
a")"
The probability that a code is tested as having an error is given as,
"p(C)=p(C|P)\\times p(P)+p(C|P')\\times p(P')=(0.78\\times0.05)+(0.94\\times0.95)=0.932"
Therefore, the probability that a code is tested as having error is 0.932.
"b)"
The probability that a code tested as having an error when the error is present is given as,
"p(P|C)={p(C|P)\\times p(P)\\over p(C)}={0.78\\times0.05\\over0.932}=0.04185."
Thus, the probability that a code tested as having an error when the error is present is 0.04185.
Comments
Leave a comment