An oil well is to be drilled in a certain location. The soil there is either rock (probability 0.53), clay (probability 0.21), or sand. If it is rock, a geological test gives a positive result with 35% accuracy; if it is clay, this test gives a positive result with 48% accuracy; and if it is sand, the test gives a positive result with 75% accuracy. Given that the test is positive, what is the probability the soil is rock? What is is the probability the soil is clay? What is is the probability the soil is sand?
Can't figure out which formula to use
let us use these notations: $R$ is the event there is rock, $C$ is the event there is clay, $S$ is the event there is sand and $T^+$ is the event the test is positive. What your statement says is the following:
$ P(R) = 0.53,\ P(C) = 0.21,\ P(S) = 0.26. $
Then, the probability that your test is positive given that there is rock is 35%, which gives
$ P(T^+|R) = 0.35. $ and for clay and sand $P(T^+|C) = 0.48$ and $P(T^+|S) = 0.75$.
Using Bayes Theorem, we can find the probability that there is rock given that the test is positive: $$ P(R|T^+) = \frac{P(T^+|R)P(R)}{P(T^+)}. $$
Then, by the law of total probability, you can find $P(T^+)$: $$ P(T^+) = P(T^+|R)P(R) + P(T^+|C)P(C) + P(T^+|S)P(S). $$
With this it is now simple to find the answers.