A certain virus infects one in every 400 people. A test used to detect the virus in a person is positive 90% of the time if the person has the virus and 10% of the time if the person does not have the virus. Let A be the event "the person is infected" and B be the event "the person tests positive."

(a) Find the probability that a person has the virus given that they have tested positive.

(b) Find the probability that a person does not have the virus given that they have tested negative.

Given:

P(A)=1/400
P(B|A)=9/10
P(B|~A)=1/10

By the law of complements,
P(~A)=1-P(A)=399/400
By the law of total probability,
P(B)=P(B|A)*P(A)+P(B|A)*P(~A)
=(9/10)*(1/400)+(1/10)*(399/400)
=51/500
Note: get used to working in fraction when doing probability.

(a) Find P(A|B):
By Baye's Theorem,
P(A|B)
=P(B|A)*P(A)/P(B)
=(9/10)*(1/400)/(51/500)
=3/136

(b) Find P(~A|~B)
We know that
P(~A)=1-P(A)=399/400
P(~B)=1-P(B)=133/136
P(A∩B)
=P(B|A)*P(A) [def. of cond. prob.]
=9/10*(1/400)
=9/4000

P(A∪B)
=P(A)+P(B)-P(A∩B)
=1/400+51/500-9/4000
=409/4000

P(~A|~B)
=P(~A∩~B)/P(~B)
=P(~A∪B)/P(~B)
=(1-P(A∪B)/(1-P(B)) [ law of complements ]
=(3591/4000) ÷ (449/500)
=3591/3592

The results can be easily verified using a contingency table for a random sample of 4000 persons (assuming outcomes correspond exactly to probability):
===....B...~B...TOT
..A . 9 . . 1 . . 10
.~A .399 .3591 . 3990
Tot .408 .3592 . 4000

So P(A|B)=9/408=3/136
P(~A|~B)=3591/3592
As before.

Note:

The numbers in the contingency table can also be obtained by a tree diagram
considering a sample of 4000 people.

400--A-->10--B-->9
-------------~B->1
----~A-->3990--B-->399
--------------~B-->3591

Probability of 1/300 8/80 1/8

A certain virus infects one in every 400 people. A test used to detect the virus in a person is positive 90% of the time if the person has the virus and 10% of the time if the person does not have the virus. Let A be the event "the person is infected" and B be the event "the person tests positive."

(a) To find the probability that a person has the virus given that they have tested positive, we can use Bayes' theorem:

P(A|B) = (P(B|A) * P(A)) / P(B)

P(B|A) = 0.90 (The probability of testing positive given that the person has the virus)
P(A) = 1/400 (The probability of a person being infected)
P(B) = (P(B|A) * P(A)) + (P(B|not A) * P(not A))
P(B|not A) = 0.10 (The probability of testing positive given that the person does not have the virus)
P(not A) = 1 - P(A) = 399/400 (The probability of a person not being infected)

Now we can plug the values into the formula:

P(A|B) = (0.90 * 1/400) / [(0.90 * 1/400) + (0.10 * 399/400)]
P(A|B) ≈ 0.00225

Therefore, the probability that a person has the virus given that they have tested positive is approximately 0.00225, or 0.225%.

(b) To find the probability that a person does not have the virus given that they have tested negative, we can use the complement rule:

P(not A|not B) = 1 - P(A|not B)

P(A|not B) = 1 - P(not A|not B)

We know that P(A|not B) = 0 (since the person tests negative), so:

P(not A|not B) = 1 - 0

Therefore, the probability that a person does not have the virus given that they have tested negative is 1.

To find the probabilities in this scenario, we can use Bayes' theorem. Bayes' theorem provides a way to calculate conditional probabilities using background information and the probabilities of related events.

Let's break down the problem using Bayes' theorem:

(a) To find the probability that a person has the virus given that they have tested positive, we need to calculate P(A|B), which represents the probability of event A (the person is infected) given event B (the person tests positive).

Using Bayes' theorem, we have the following formula:

P(A|B) = (P(B|A) * P(A)) / P(B)

P(B|A) represents the probability of testing positive given that the person is infected. In this case, it is given as 90%, or 0.9.

P(A) represents the probability of a person being infected. It is given in the problem as one in every 400 people, which can be written as 1/400.

P(B) represents the probability of testing positive. We can calculate it using the law of total probability. It can be calculated as the sum of two scenarios:

1. The person is infected and tests positive (P(B|A) * P(A)), which is (0.9 * 1/400).
2. The person is not infected and tests positive. Let's call this event A' (not A). The probability of testing positive given that the person is not infected is given as 10%, or 0.1. The probability of a person not being infected is 1 - P(A), which is 1 - 1/400.

So, P(B) = (P(B|A) * P(A)) + (P(B|A') * P(A')) = (0.9 * 1/400) + (0.1 * 399/400).

Now we can calculate P(A|B) using Bayes' theorem:

P(A|B) = (0.9 * 1/400) / [(0.9 * 1/400) + (0.1 * 399/400)]

Simplifying this expression will give us the probability that a person has the virus given that they have tested positive.

(b) To find the probability that a person does not have the virus given that they have tested negative, we need to calculate P(!A|!B), which represents the probability of event !A (the person is not infected) given event !B (the person tests negative).

Using Bayes' theorem again, we will follow similar steps as in part (a), taking into account the complement of events.

P(!B|!A) represents the probability of testing negative given that the person is not infected. It is given as 90%, or 0.9.

P(!A) represents the probability of a person not being infected. It is 1 - P(A), which is 1 - 1/400.

P(!B) represents the probability of testing negative. We can calculate it using the law of total probability. It can be calculated as the sum of two scenarios:

1. The person is not infected and tests negative (P(!B|!A) * P(!A)).
2. The person is infected and tests negative. Let's call this event !A'. The probability of testing negative given that the person is infected is given as 10%, or 0.1. The probability of a person being infected is P(A).

So, P(!B) = (P(!B|!A) * P(!A)) + (P(!B|!A') * P(A)).

Once you have evaluated P(!B), you can calculate P(!A|!B) using Bayes' theorem.

Note: In both parts of the problem, we assume independence between the events, i.e., a person either has the virus or does not have the virus, and the test result is independent of other factors. However, in reality, such independence may not always hold, and the given probabilities may vary.