1.4 Computing Probability by Conditioning
Let \(E\) be an event. We will find \(P(E)\). We define a random variable \(X\) as follows \[X = \begin {cases} 0 & \text {if}\hspace {0.2cm} E\hspace {0.2cm}\text {does not occur}\\ 1 & \text {if}\hspace {0.2cm} E\hspace {0.2cm} \text {occurs}\\ \end {cases} \]
\[E(X) = 0\times P(E) + 1\times P(E) = P(E).\]
Let \(Y\) be a discrete random variable. Then \begin {align*} P(E) & = E(X) = E\left (E\left (X/Y\right )\right ) = \sum _y E(X/Y = y)\, P(Y = y).\hspace {0.5cm}\cdots \cdots \hspace {0.5cm} (1) \end {align*}
But \begin {align*} E(X/Y = y) & = 0\times P(X = 0\, /\, Y = y) + 1\times P(X = 1\, /\, Y = y)\\ & = P(X = 1\, /\, Y = y)\\ & = P(E/Y=y). \end {align*}
Hence from \((1)\) we get \[P(E) = \sum _y P(E/Y = y)\, P(Y=y).\] If \(Y\) is continuous random variable, then \[P(E) = \int _{-\infty }^{\infty } P(E\, /\, Y = y)\, f_Y(y)\, dy.\]
Example 1.4.1. An insurance company suppose that the number of accidents that each of
its policy holders will have in a year is Poisson distributed, with the mean of the Poisson
depending on the policy holder (age, gender etc).
If the Poison mean of a randomly chosen policy holder has a gamma distribution with density
function.
\[g(\lambda ) = \lambda \, e^{-\lambda }\hspace {0.3cm}, \hspace {0.3cm} \lambda \geq 0\]
What is the probability that a randomly chosen policy holder has a exactly \(n\) accidents per
year.
Solution. Let \(X\) be the number of accidents that a randomly chosen policy holder may have in a year. \begin {align*} P(X = n) & = \int ^{\infty }_0P(X = n\, /\, \text {mean of}\hspace {0.2cm} X \hspace {0.2cm} \text {is}\hspace {0.2cm}\lambda )\, \lambda \, e^{-\lambda }\, d\lambda \\ & = \int _0^{\infty } \frac {e^{-\lambda }\, \lambda ^n}{n!}\, \lambda \, e^{-\lambda }\, d\lambda \\ & = \frac {1}{n!}\int ^{\infty }_0 e^{-2\lambda }\, \lambda ^{n+1}\, d\lambda \hspace {1.5cm}\text {let}\hspace {0.5cm} \frac {m}{2} = \lambda \hspace {0.2cm}\implies \frac {dm}{2} = d\lambda \\ & = \frac {1}{n!}\int ^{\infty }_0 e^{-m}\, \frac {m^{n + 1}}{2^{n + 1}}\, \frac {dm}{2}\\ & = \frac {1}{n!}\,\cdot \, \frac {1}{2^{n + 2}}\int _0^{\infty } e^{-m}\, m^{n + 1} \, dm\\ & = \frac {1}{n!}\cdot \frac {1}{2^{n + 2}}\, \Gamma (n + 2)\\ & = \frac {1}{n!}\cdot \frac {1}{2^{n + 2}}\, (n + 1)!\\ & = \frac {1}{n!}\cdot \frac {1}{2^{n + 2}}\cdot (n+1)\, n!\\ & = \frac {n + 1}{2^{n + 2}}. \end {align*} □
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.