Bayes' formula problem In a certain village, 20% of the population has some disease. A test is administered which has the property that if a person is sick, the test will be positive 90% of the time and if the person is not sick, then the test will still be positive 30% of the time.  All people tested positive are prescribed a drug which always cures the disease but produces a rash 25% of the time. Given that a random person has the rash,  what is the probability that this person had the disease to start with?
I am looking for $P(S|R)$ given that a person tested positive where $S$ denotes a sick person $R$ denotes a person with a rash, given that they tested positive. If $+$ denotes a person who tested positive and I use Baye's formula and the data to calculate $P(S|+)$ would $P(S|R)=\frac{P(R|+)P(S|+)}{P(R|+)}=P(S|+)$? Or would the answer be $P(S|R)=P(R)P(S|+)$?Or are both of these answers wrong? Also, I cannot tell if in the problem statement $P(R)=.25$ or $P(R|+)=.25$.
 A: Assuming that the rash occurs only due to the medicine and not for other reasons,
First, $P(S) = 0.2, P(S^c) = 0.8$

*

*What is the probability that a sick person tests positive and finally develops rashes after taking medicine? $P(R|S) = 0.9 \times 0.25$


*Similarly, find $P(R|S^c)$
Now $$ \displaystyle P(S|R) = \cfrac{P(R|S) \cdot P(S)}{P(R)} $$
$$ \displaystyle = \cfrac{P(R|S) \cdot P(S)}{P(R|S) \cdot P(S) + P(R|S^c) \cdot P(S^c)} $$
A: We want $$P(S|R)=\frac{P(R|S)P(S))}{P(R)}$$
We are given $P(S)$, $P(+|S)$ and $P(+|\lnot S)$ and, indirectly, $P(R|+)$. I say indirectly because we are actually given the probability that a person gets a rash given that he is administered the drug but this only happens when a person tests positive.
We must use the given probabilities and $P(+)$ to calculate the unknowns $P(R|S)$ and $P(R)$.
$P(+)=P(+|S)P(S) + P(+|\lnot S)P(\lnot S) = 0.9*0.2 + 0.3*0.8=0.42\\
P(R)=P(R|+)P(+)+P(R|\lnot +)P(\lnot +)= 0.25*0.42 + 0*0.58=0.105\\
P(R|S)=P(R|+)P(+|S)=0.25*0.9=0.225$
Plugging in the values above gives $P(S|R)=\frac{0.225*0.2}{0.105}=\frac{3}{7}$
