Part (a)
Consider a town of 30,000 people.
The virus infects one out of every 300 people, which means (1/300)*(30000) = 100 is the expected number of people with the virus.
The test is able to catch 90% of these cases, so the test will say "positive" for 90 of these people with the virus. These are true positives.
The remaining 100-90 = 10 people with the virus will get false negatives.
The 30,000 - 100 = 29,900 people who don't have the virus will have the test give a false positive 8% of the time, so 0.08*29900 = 2392 people will get a false positive, and the remaining 29900-2392 = 27508 people will get true negatives.
Check out the chart in the diagram below. It shows all the values mentioned but in a more organized fashion.
Now we're told that "given that they have tested positive". So we'll focus solely on the people that tested positive. That would be the 90+2392 = 2482 in the first column.
We have 90 people who actually have the virus out of 2482 positive tests. Those values divide to 90/2482 = 0.03626 approximately
This converts to 3.626% and then that rounds to 3.6%
So about 3.6% of the positive test cases are correct (in stating the person has the virus).
Answer: 3.6
You won't need to type in the percent sign.
=======================================================
Part (b)
We'll refer to the chart made in part (a) earlier.
This time we're told that "given they tested negative". Focus solely on the "negative test" column.
We have 27508 people who don't have the virus out of 27518 people who tested negative.
The probability of not having the virus, given the test was negative, is 27508/27518 = 0.9996 approximately
This converts over to 99.96% and then rounds to 100.0% or 100% when rounding to the nearest tenth of a percent
Of course, it's impossible to have 100% of the negative cases where no one got the virus, since 10 people with the virus tested negative (false negatives). This is one drawback of rounding and why it could be misleading.
Answer: 100