In the tree, the first branch will be person has virus or person doesn't have the virus.
P(virus) = 1/300
P(not virus) = 299/300
Now,
Then we branch out from each option. These branches would be positive or negative.
If they have virus:
P(positive) = 0.8
P(negative) = 0.2
If don't have virus:
P(positive) = 0.1
P(negative) = 0.9
Now, solving the question of probability that a person has the virus given that they have tested positive:
We find:
P(A|B)
P(has virus | positive test) = P(positive and has virus) / P(positive test)
P(positive and has virus) = 4/5 * 1/300 = 4/1500
P(positive test) = 1/300 * 4/5 + 1/10 * 299/300
= (4/1500)+(299/3000)
=(8/3000) + (299/3000) = 307/3000
= 0.10233
So,
P(positive and has virus) / P(positive test) = 4/1500 divided by 299/3000 = 0.02675