# Bayes theorem : Exercises

# Introduction

# Example problems

Click on the problems to reveal the solution

#### Problem 1

**not**independent. With these symbols in place we can now state clearly what it we are trying to calculate. We are trying to calculate the conditional probability $P(D=1|T=1)$. In addition, the question tells us that: $$ P(D=1)=0.001 \qquad \qquad P(T=1|D=1)=0.990 \qquad \qquad P(T=1|D=0)=0.005 $$ From these quantities we can the probability of getting a positive test result, $P(T=1)$ using the partition theorem as shown below: $$ P(T=1) = P(T=1|D=1)P(D=1) + P(T=1|D=0)P(D=0) = P(T=1|D=1)P(D=1) + P(T=1|D=0)[1-P(D=1)] = 0.99 \times 0.1 + 0.005 \times ( 1 - 0.001 ) = 0.005985 $$ We can now insert this result into Bayes theorem to get the desired conditional probability. $$ P(D=1|T=1) = \frac{P(T=1|D=1)P(D=1)}{P(T=1)} = \frac{0.99 \times 0.001}{0.005985} \approx 0.165 $$