Exercise on conditional probability (Bayes' Theorem)

N1loon

New Member
Hey all!
My homework relates to the following scenario:
• A disease has a 2% prevelance rate in country X
• A test for the disease has a true positive rate of 0.999 and a false positive rate of 0.01
• Country X has a population of 50 million people with the two largest cities having a population of 2 million and 1 million, respectively.
Question 1) Assuming you live in country X, what is the probability you actually have the disease if you test positive?
Question 2) Assume that if a person tests positive, then there is a 10% chance the person is from one of the two largest cities. What is the probability that if s.o. is from one of the two largest cities that the person will test positive?
Question 3) What is the probability that a person in country X has the disease given that the person is from one of the two largest cities?
Question 4) Suppose that it is winter of 2021, by which time only 0.0001% of country X's population has the disease. A close friend of yours has just tested positive, even though she has no symptoms. You also feel fine but, given your contact with her and the positive test result, you also get tested and your test comes back positive. What is the chance that both of you actually have the disease? (Make judicious assumptions as needed)

I didn't have any problems with question 1. Chapter 3.2.8 of the OpenStatistics textbook has an excellent explanation of almost the identical scenario.
My solution for question 1)
P(B|A)P(A) / P(B|A)P(A) + P(B|A')*P(A') which results in: 0.01998 / 0.01998 + 0.0098 ≈ 67.1%

I'm lost when it comes to the other three questions though. Now that we have another conditional probability (10% chance of being from one of the two largest cities when testing positive), I don't know how to apply the formular of bayes' theorem anymore. My goal is to fully understand the logic of bayes' theorem and how to apply it to various scenarios. But so far when looking up resources (either chapters of stats books or video tutorials), I find it extremely hard to grasp the whole concept and apply the theorem to a scenario where multiple conditions are at play.
Any help on this is really highly appreciated. Thanks!