A certain defect (D) is present in about 1 out of 1000 cars during production [P(D)=0.001], and a program of testing is to be carried out using a detection device which gives a positive reading with probability 0.99 for a defective car [P(+/D)=0.99] and with probability 0.05 for a non-defective car [P(+/ND)=0.05]. Then if a randomly selected car has a positive reading, find the probability that it actually does have the defect [P(D/+)].

To find the probability that a randomly selected car actually has the defect given a positive reading, we can use Bayes' theorem. Bayes' theorem allows us to update our initial probability based on new evidence.

P(D/+) = (P(+/D) * P(D)) / P(+)

Let's calculate the values we need:

P(D) = 0.001 (Given: the probability that a car has the defect during production)
P(+/D) = 0.99 (Given: the probability of getting a positive reading given that the car has the defect)

Now, we need to find P(+), which is the probability of getting a positive reading regardless of whether the car has the defect or not. This can be calculated using the law of total probability:

P(+) = P(+/D) * P(D) + P(+/ND) * P(ND)

We know that P(D) = 0.001, but we still need to find P(ND) (the probability that a car does not have the defect during production). Since P(D) and P(ND) are mutually exclusive and together make up the entire probability space, we can conclude that P(ND) = 1 - P(D) = 1 - 0.001 = 0.999.

Substituting the given values:

P(+) = (0.99 * 0.001) + (0.05 * 0.999) = 0.00199 + 0.04995 = 0.05194

Now, we can substitute the values back into Bayes' theorem:

P(D/+) = (0.99 * 0.001) / 0.05194 ≈ 0.019

Therefore, the probability that a randomly selected car actually has the defect given a positive reading is approximately 0.019, or 1.9%.