Example 1
Question: Three bags P, Q, and R contain coloured balls as follows: Bag P: 3 red, 2 blue Bag Q: 1 red, 4 blue Bag R: 4 red, 1 blue One bag is chosen at random and one ball is drawn from it. The ball turns out to be red. Find the probability that the red ball was drawn from (i) Bag P, (ii) Bag Q, and (iii) Bag R.
Solution: Let \( E_P \), \( E_Q \), and \( E_R \) denote the events of selecting Bag P, Bag Q, and Bag R respectively. Let \( A \) be the event that the ball drawn is red. Since one bag is chosen at random: \[ P(E_P) = P(E_Q) = P(E_R) = \frac{1}{3} \] Now, the conditional probabilities of drawing a red ball from each bag: Bag P has 3 red out of 5 total: \[ P(A \mid E_P) = \frac{3}{5} \] Bag Q has 1 red out of 5 total: \[ P(A \mid E_Q) = \frac{1}{5} \] Bag R has 4 red out of 5 total: \[ P(A \mid E_R) = \frac{4}{5} \] By the Law of Total Probability: \[ P(A) = P(E_P) \cdot P(A \mid E_P) + P(E_Q) \cdot P(A \mid E_Q) + P(E_R) \cdot P(A \mid E_R) \] \[ P(A) = \frac{1}{3} \cdot \frac{3}{5} + \frac{1}{3} \cdot \frac{1}{5} + \frac{1}{3} \cdot \frac{4}{5} \] \[ P(A) = \frac{1}{15} \left(3 + 1 + 4\right) = \frac{8}{15} \] Now applying Bayes' Theorem: (i) Probability that the red ball came from Bag P: \[ P(E_P \mid A) = \frac{P(E_P) \cdot P(A \mid E_P)}{P(A)} = \frac{\dfrac{1}{3} \cdot \dfrac{3}{5}}{\dfrac{8}{15}} \] \[ P(E_P \mid A) = \frac{\dfrac{3}{15}}{\dfrac{8}{15}} = \frac{3}{8} \] (ii) Probability that the red ball came from Bag Q: \[ P(E_Q \mid A) = \frac{P(E_Q) \cdot P(A \mid E_Q)}{P(A)} = \frac{\dfrac{1}{3} \cdot \dfrac{1}{5}}{\dfrac{8}{15}} \] \[ P(E_Q \mid A) = \frac{\dfrac{1}{15}}{\dfrac{8}{15}} = \frac{1}{8} \] (iii) Probability that the red ball came from Bag R: \[ P(E_R \mid A) = \frac{P(E_R) \cdot P(A \mid E_R)}{P(A)} = \frac{\dfrac{1}{3} \cdot \dfrac{4}{5}}{\dfrac{8}{15}} \] \[ P(E_R \mid A) = \frac{\dfrac{4}{15}}{\dfrac{8}{15}} = \frac{4}{8} = \frac{1}{2} \] Verification: \( \dfrac{3}{8} + \dfrac{1}{8} + \dfrac{1}{2} = \dfrac{3}{8} + \dfrac{1}{8} + \dfrac{4}{8} = 1 \). Correct.
Answer: (i) \( P(E_P \mid A) = \dfrac{3}{8} \), (ii) \( P(E_Q \mid A) = \dfrac{1}{8} \), (iii) \( P(E_R \mid A) = \dfrac{1}{2} \)
Example 2
Question: A factory has four machines W, X, Y, and Z producing items. The machines produce 20%, 30%, 25%, and 25% of the total output respectively. The defect rates for each machine are: W produces 2% defective, X produces 4% defective, Y produces 1% defective, and Z produces 3% defective. An item is picked at random and found to be defective. Find the probability that it was produced by (i) Machine W, (ii) Machine X, (iii) Machine Y, and (iv) Machine Z.
Solution: Let \( E_W \), \( E_X \), \( E_Y \), \( E_Z \) be the events that an item is produced by machine W, X, Y, Z respectively, and let \( D \) be the event that the item is defective. The prior probabilities (proportion of output) are: \[ P(E_W) = 0.20, \quad P(E_X) = 0.30, \quad P(E_Y) = 0.25, \quad P(E_Z) = 0.25 \] The conditional probabilities of a defective item from each machine: \[ P(D \mid E_W) = 0.02, \quad P(D \mid E_X) = 0.04, \quad P(D \mid E_Y) = 0.01, \quad P(D \mid E_Z) = 0.03 \] By the Law of Total Probability: \[ P(D) = P(E_W) \cdot P(D \mid E_W) + P(E_X) \cdot P(D \mid E_X) + P(E_Y) \cdot P(D \mid E_Y) + P(E_Z) \cdot P(D \mid E_Z) \] \[ P(D) = (0.20)(0.02) + (0.30)(0.04) + (0.25)(0.01) + (0.25)(0.03) \] \[ P(D) = 0.004 + 0.012 + 0.0025 + 0.0075 = 0.026 \] Expressing in fractions for clarity: \( P(D) = \dfrac{26}{1000} = \dfrac{13}{500} \) Now applying Bayes' Theorem: (i) Probability that the defective item came from Machine W: \[ P(E_W \mid D) = \frac{P(E_W) \cdot P(D \mid E_W)}{P(D)} = \frac{(0.20)(0.02)}{0.026} = \frac{0.004}{0.026} \] \[ P(E_W \mid D) = \frac{4}{26} = \frac{2}{13} \] (ii) Probability that the defective item came from Machine X: \[ P(E_X \mid D) = \frac{P(E_X) \cdot P(D \mid E_X)}{P(D)} = \frac{(0.30)(0.04)}{0.026} = \frac{0.012}{0.026} \] \[ P(E_X \mid D) = \frac{12}{26} = \frac{6}{13} \] (iii) Probability that the defective item came from Machine Y: \[ P(E_Y \mid D) = \frac{P(E_Y) \cdot P(D \mid E_Y)}{P(D)} = \frac{(0.25)(0.01)}{0.026} = \frac{0.0025}{0.026} \] \[ P(E_Y \mid D) = \frac{2.5}{26} = \frac{5}{52} \] (iv) Probability that the defective item came from Machine Z: \[ P(E_Z \mid D) = \frac{P(E_Z) \cdot P(D \mid E_Z)}{P(D)} = \frac{(0.25)(0.03)}{0.026} = \frac{0.0075}{0.026} \] \[ P(E_Z \mid D) = \frac{7.5}{26} = \frac{15}{52} \] Verification: \( \dfrac{2}{13} + \dfrac{6}{13} + \dfrac{5}{52} + \dfrac{15}{52} = \dfrac{8}{52} + \dfrac{24}{52} + \dfrac{5}{52} + \dfrac{15}{52} = \dfrac{52}{52} = 1 \). Correct.
Answer: (i) \( P(E_W \mid D) = \dfrac{2}{13} \), (ii) \( P(E_X \mid D) = \dfrac{6}{13} \), (iii) \( P(E_Y \mid D) = \dfrac{5}{52} \), (iv) \( P(E_Z \mid D) = \dfrac{15}{52} \)