29.7k views
4 votes
Usually, errors are found in 10% of lines of code written by software engineers at Error Free Code, Inc. What is the probability that in a randomly selected sample of 5 lines of code 2 of them have errors?

1 Answer

3 votes

Answer: The required probability is 0.008.

Explanation:

Since we have given that

Probability of getting codes having no error = 10% = q

Probability of getting codes having error = 100-10=90%.= q

So, sample n = 5

X = 2 (i.e. code 2 of them have errors)

Using "Binomial theorem":


P(X=n)^nC_xp^xq^(n-x)


P(X=2)=^5C_2(0.9)^2(0.10)^3=0.008

Hence, the required probability is 0.008.

User Vanmelle
by
3.7k points