Let A = Set of students who received medals in volleyball
B = Set of students who received medals in football
C = Set of students who received medals in basketball
n(A) = 38, n(B) = 15, n(C) = 20, n(A ∪ B ∪ C) = 58, n(A ∩ B ∩ C) = 3
n(A ∪ B ∪ C) = n(A) + n(B) + n(C) – n(A ∩ B) – n(B ∩ C) – n(A ∩ C) + n(A ∩ B ∩ C)
58 = 38 + 15 + 20 – n(A ∩ B) – n(B ∩ C) – n(A ∩ C) + 3
∴ n(A ∩ B) + n(B ∩ C) + n(A ∩ C) = 18 ……(i)
Number of players who got exactly two medals
= p + q + r
Here, s = n(A ∩ B ∩ C) = 3
n(A ∩ B) + n(B ∩ C) + n(A ∩ C) = 18 …..[From (i)]
∴ p + s + s + r + q + s = 18
∴ p + q + r + 3s = 18
∴ p + q + r + 3(3) = 18
∴ p + q + r = 18 – 9 = 9
∴ Number of players who received exactly two medals = 9.