Events E1, E2, E3 and S be the events defined as follows:
E1: The patient had disease d1
E2: The patient had disease d2
E3: The patient had disease d3
S: The patient showed the symptom
E1, E2, and E3 are mutually exclusive and exhaustive events.
\[P\left( E_1 \right) = \frac{1800}{5000} = \frac{18}{50}\]
\[P\left( E_2 \right) = \frac{2100}{5000} = \frac{21}{50}\]
\[P\left( E_3 \right) = \frac{1100}{5000} = \frac{11}{50}\]
Now,
\[P\left( \frac{S}{E_1} \right)\] = Probability that the patient showed symptom given that patient had disease d1 =
\[\frac{1500}{5000} = \frac{15}{50}\]
\[P\left( \frac{S}{E_2} \right)\] = Probability that the patient showed symptom given that patient had disease d2 = \[\frac{1200}{5000} =\frac{12}{50}\]
\[P\left( \frac{S}{E_3} \right)\] = Probability that the patient showed symptom given that patient had disease d3 = \[\frac{900}{5000} = \frac{9}{50}\]
Using Bayes theorem, we have probability that patient had disease d1 such that symptom of d1 showed = \[P\left( \frac{E_1}{S} \right) =
\frac{P\left( E_1 \right)P\left( \frac{S}{E_1} \right)}{P\left( E_1 \right)P\left( \frac{S}{E_1} \right) + P\left( E_2 \right)P\left( \frac{S}{E_2} \right) + P\left( E_3 \right)P\left( \frac{S}{E_3} \right)} = \frac{\frac{18}{50} \times \frac{15}{50}}{\frac{18}{50} \times \frac{15}{50} + \frac{21}{50} \times \frac{12}{50} + \frac{11}{50} \times \frac{9}{50}} = \frac{270}{621}\]
Probability that patient had disease
d2 such that symptom of
d2 showed =
\[P\left( \frac{E_2}{S} \right) = \frac{P\left( E_2 \right)P\left( \frac{S}{E_2} \right)}{P\left( E_1 \right)P\left( \frac{S}{E_1} \right) + P\left( E_2 \right)P\left( \frac{S}{E_2} \right) + P\left( E_3 \right)P\left( \frac{S}{E_3} \right)} = \frac{\frac{21}{50} \times \frac{12}{50}}{\frac{18}{50} \times \frac{15}{50} + \frac{21}{50} \times \frac{12}{50} + \frac{11}{50} \times \frac{9}{50}} = \frac{252}{621}\]
Probability that patient had disease d3 such that symptom of d3 showed = \[P\left( \frac{E_3}{S} \right) = \frac{P\left( E_3 \right)P\left( \frac{S}{E_3} \right)}{P\left( E_1 \right)P\left( \frac{S}{E_1} \right) + P\left( E_2 \right)P\left( \frac{S}{E_2} \right) + P\left( E_3 \right)P\left( \frac{S}{E_3} \right)} = \frac{\frac{11}{50} \times \frac{9}{50}}{\frac{18}{50} \times \frac{15}{50} + \frac{21}{50} \times \frac{12}{50} + \frac{11}{50} \times \frac{9}{50}} = \frac{99}{621}\]
Thus, the patient is most likely to have the disease d1.