A Problem on Conditional Probability 
A patient is thought to have one of three diseases $A_1$, $A_2$ and $A_3$ whose probabilities under the given conditions are $1/2$, $1/6$ and $1/3$, respectively. A test is carried out to help the diagnosis and it yields a positive result with a probability of $0.1$ for disease $A_1$, a probability of $0.2$ for disease $A_2$ and a probability of $0.9$ for disease $A_3$. A(nother) test is conducted 5 times and the results are positive 4 times and negative once. What is the probability of each disease after testing?

Let $P(P_1) = 0.1$. I can't decide whether $P(P_1)$ is $P(P_1|A_1)$. A positive result for $A_1$ does not necessarily mean the person has disease $A_1$, the results could be incorrect. Furthermore, I am not sure what I am supposed to find here: the probability of each disease after testing?? Is it the probability of each disease given that the results are positive or negative? Or a total probability? Should I use Bayes' rule here?
 A: Let us assume we have prior probabilities for the three diseases $p(A_1)$, $p(A_2)$, and $p(A_3)$ of $1/2, 1/6, 1/3$ respectively.
The test has probabilities $p_i = 0.1, 0.2, $and $0.9$ of detecting the three diseases respectively.  Under the assumption that the test results are independent from one trial to the other, the results of running the test five times given that the patient has disease $A_i$ are distributed Binomial with probability parameter $p_i$.  Consequently, the probability of observing four positive test results out of five trials given each of the diseases is:
$$P(\text{observed test results}|A_i) = P_{\text{binomial}}(4; n=5, p_i) = \{0.00045, 0.0064, 0.328\}$$
for the three diseases respectively.
Using Bayes' Rule, $P(A_i | \text{observed test results}) \propto P(\text{observed test results}|A_i)P(A_i)$.  This calculation results in unnormalized probabilities equal to $\{0.000225, 0.00107, 0.109\}$ for the three diseases.  Normalizing gives us:
$$P(A_i | \text{observed test results}) = \{0.002, 0.01, 0.988\}$$
respectively.
