Another two examples will illustrate how integration can be used to find probabilities for continuous random variables.
Example
If a continuous random variable, \(X\), has probability density function
\[ f(x) = \begin{cases} 1 - \dfrac x 2 & \quad \text{for } 0 \lt x \lt 2 \\[0.2em] 0 & \quad \text{otherwise} \end{cases} \]what is the probability of getting a value less than 1?
From the probability density function, \(X\) cannot be less than zero.
\[ \begin{align} P(0 \lt X \lt 1) \;\; &= \; \; \int_0^1 {1 - \frac x 2}\; dx \\ &= \; \; \left[x - \frac {x^2} 4 \right]_0^1 \\ &=\;\; \frac 3 4 \end{align} \]Our next example involves a distribution called an exponential distribution. There is no upper limit to the possible values of an exponential random variable. Practical applications of exponential distributions will be described in the next chapter.
Example
If a continuous random variable, \(X\), has probability density function
\[ f(x) = \begin{cases} 4\;e^{-4x} & \quad \text{for } x \ge 0\\[0.2em] 0 & \quad \text{otherwise} \end{cases} \]what is the probability of getting a value less than 1?
Again \(X\) cannot be less than zero so:
\[ \begin{align} P(0 \lt X \lt 1) \;\; &= \; \; \int_0^1 {4\;e^{-4x}}\; dx \\ &= \; \; \left[ -e^{-4x} \right]_0^1 \\[0.5em] &=\;\; -e^{-4} + 1 \\[0.4em] &= 0.9817 \end{align} \]