12 Continuous Random Variables
- A continuous random variable can take any value within some uncountable interval.
- Simulated values of a continuous random variable are usually plotted in a histogram which groups the observed values into “bins” and plots densities or frequencies for each bin.
- In a histogram areas of bars represent relative frequencies; the axis which represents the height of the bars is called “density”.
- The continuous analog of a probability mass function (pmf) for a discrete random variable is a probability density function (pdf) However there are some fundamental differences between discrete and continuous random variables, and pmfs and pdfs.
- The distribution of a continuous random variable can be described by a probability density function (pdf), for which areas under the density curve determine probabilities.
Example 12.1 Suppose that in your office everyone arrives to work between 8am and 9am. Randomly select an employee and let \(X\) be employee’s arrival time measured in minutes after 8am, including fractions of a minute, so that \(X\) takes a value in the continuous interval [0, 60].
Data on many randomly selected employees suggests that the distribution of \(X\) is described by this probability density function (pdf), where \(c\) is a constant that we’ll determine soon.
\[ f_X(x) = \begin{cases} c x, & 0<x<60\\ 0, & \text{otherwise.} \end{cases} \]
- Sketch a plot of the pdf. Roughly, what does this say about arival times?
- Find the value of \(c\) and specify the pdf of \(X\).
- Compute and interpret \(\text{P}(X<15)\).
- Compute and interpret \(\text{P}(X>45)\).
- The continuous analog of a probability mass function (pmf) is a probability density function (pdf).
- However, while pmfs and pdfs play analogous roles, they are different in one fundamental way; namely, a pmf outputs probabilities directly, while a pdf does not.
- A pdf of a continuous random variable must be integrated to find probabilities of related events.
- The probability density function (pdf) (a.k.a. density) of a continuous RV \(X\) is the function \(f_X\) which satisfies \[\begin{align} \text{P}(a \le X \le b) & =\int_a^b f_X(x) dx, \qquad \text{for all } -\infty \le a \le b \le \infty \end{align}\]
- For a continuous random variable \(X\) with pdf \(f_X\), the probability that \(X\) takes a value in the interval \([a, b]\) is the area under the pdf over the region \([a,b]\).
- The axioms of probability imply that a valid pdf must satisfy \[\begin{align} f_X(x) & \ge 0 \qquad \text{for all } x,\\ \int_{-\infty}^\infty f_X(x) dx & = 1 \end{align}\]
Example 12.2 Continuing Example 12.1, recall that \(X\) has pdf
\[ f_X(x) = \begin{cases} (2/3600)x, & 0\le x \le 60,\\ 0, & \text{otherwise.} \end{cases} \]
- Consider the probability that an employee arrives within 1 minute after 8:15. Compute \(\text{P}(15 < X < 16)\), the probability that \(X\), truncated to the nearest minute, is 15. How is the probability related to \(f(15)\)?
- Consider the probability that an employee arrives within 1 minute after 8:45. Compute \(\text{P}(45 < X < 46)\), the probability that \(X\), truncated to the nearest minute, is 45. How is the probability related to \(f(45)\)?
- Compute and interpret the ratio of the two previous probabilities.
- Consider the probability that an employee arrives within 1 second after 8:15. Compute \(\text{P}(15 < X < 15 + 1/60)\), the probability that \(X\), truncated to the nearest second, is 15. (The measurement units of \(X\) are minutes, so 1/60 minutes is 1 second.) How is the probability related to \(f(15)\)?
- Consider the probability that an employee arrives within 1 second after 8:45. Compute \(\text{P}(45 < X < 45 + 1/60)\), the probability that \(X\), truncated to the nearest second, is 45. How is the probability related to \(f(45)\)?
- Compute and interpret the ratio of the two previous probabilities.
- Consider the probability that an employee arrives within 1 millisecond after 8:15. Compute \(\text{P}(15 < X < 15 + 1/60000)\), the probability that \(X\), truncated to the nearest millisecond, is 15. (The measurement units of \(X\) are minutes, so 1/60000 minutes is 1 millisecond.) How is the probability related to \(f(15)\)?
- Consider the probability that an employee arrives within 1 millisecond after 8:45. Compute \(\text{P}(45 < X < 45 + 1/60000)\), the probability that \(X\), truncated to the nearest millisecond, is 45. How is the probability related to \(f(45)\)?
- Compute and interpret the ratio of the two previous probabilities.
- Compute and interpret \(\text{P}(X = 15)\).
- Compute and interpret \(\text{P}(X = 45)\).
- In practical terms, is any employee more likely to arrive “at 8:15” or “at 8:45”? Explain.
- The probability that a continuous random variable \(X\) equals any particular value is 0. That is, if \(X\) is continuous then \(\text{P}(X=x)=0\) for all \(x\).
- For a continuous random variable \(X\), \(\text{P}(X\le x) = \text{P}(X<x)\).
- Be careful: for a discrete random variable \(X\), \(\text{P}(X\le x)\) can be different than \(\text{P}(X<x)\).
- Even though any specific value of a continuous random variable has probability 0, intervals still can have positive probability.
- For continuous random variables, it doesn’t really make sense to talk about the probability that the random value is equal to a particular value. In practical applications involving continuous random variables, “equal to” really means “close to”, and “close to” probabilities correspond to intervals which can have positive probability.
- The density \(f_X(x)\) at value \(x\) is not a probability.
- Rather, the density \(f_X(x)\) at value \(x\) is related to the probability that the RV \(X\) takes a value “close to \(x\)” in the following sense \[ \text{P}\left(x-\frac{\epsilon}{2} \le X \le x+\frac{\epsilon}{2}\right) \approx f_X(x)\epsilon, \qquad \text{for small $\epsilon$} \]
- The quantity \(\epsilon\) is a small number that represents the desired degree of precision. For example, rounding to two decimal places corresponds to \(\epsilon=0.01\).
- Roughly, \[ \text{P}(X \text{ is close to }x) \approx f_X(x)\times(\text{what counts as close to}) \]
- What’s important about a pdf is relative heights. For example, if \(f_X(x_2)= 2f_X(x_1)\) then \(X\) is roughly “twice as likely to be close to \(x_2\) than to be close to \(x_1\)” in the above sense. \[ \frac{f_X(x_2)}{f_X(x_1)} = \frac{f_X(x_2)\epsilon}{f_X(x_1)\epsilon} \approx \frac{\text{P}\left(x_2-\frac{\epsilon}{2} \le X \le x_2+\frac{\epsilon}{2}\right)}{\text{P}\left(x_1-\frac{\epsilon}{2} \le X \le x_1+\frac{\epsilon}{2}\right)} \approx \frac{\text{P}(X \text{ is close to }x_2) }{\text{P}(X \text{ is close to }x_1) } \]
Example 12.3 Suppose that \(X\) is a claim amount in excess of the decuctible for a car insurance policy that incurs a claim, measured in thousands of dollars. Assume that \(X\) has pdf \[ f_X(x) = (1/4.3) e^{-x/4.3}, \qquad x >0 \]
- Sketch the pdf of \(X\) and interpret, roughly, its shape in context.
- Without integrating, approximate the probability that \(X\) rounded to the nearest hundred dollars is $500.
- Compute and interpret the ratio \(f(0.5)/f(5)\).
- Compute and interpret \(\text{P}(X < 5)\).
- Compute and interpret \(\text{P}(X > 10)\).
12.1 Exercises
Exercise 12.1 In a certain population, household income \(X\) ($ thousands) follows the pdf \[ f_X(x) = c x^{-2.5}, \quad x \ge 30 \] for an appropriate constant \(c\). Note that the measurement units are $ thousands, so 1 represents 1 thousand dollars. (This is not a super realistic example, but just go with it.)
- What are the possible values of \(X\)? Sketch the pdf of \(X\).
- Without integrating, find the probability that a household has an income, rounded to the nearest thousand dollars, of $200K.
- Without integrating, find the probability that a household has an income, rounded to the nearest hundred dollars, of $200K.
- Without integrating, determine how many times more likely it is for a household to have an income, rounded to the nearest hundred dollars, of $100K than $200K.
- Compute the value of \(c\). (For this and the following parts, set up any calculations you would need to perform, but you can use a calculator or software to do the computations.)
- Compute the probability that a household has an income under $100K.
- Compute the probability that a household has an income over $200K.
- Find the probability that a household has an income exactly equal to $200K.
Exercise 12.2 In Example 12.1, assume instead that employees are “equally likely” to arrive at any time between 8am and 9am. Let \(X\) be the arrival time of a randomly selected employee, measured in minutes after 8am. We’ll assume that \(X\) has a “Uniform distribution” on [0, 60].
- What shape would you want the pdf to have? Sketch that shape and then determine the pdf.
- Compute and interpret \(\text{P}(X <15)\).
- Compute and interpret \(\text{P}(X >45)\).
- How do the two previous parts compare to each other? Why? How do they compare to the corresponding parts in Example 12.1? Why?
- Compute \(\text{P}(X = 15)\).
- Replace the previous part with a more sensible question, then solve it.
- Make an educated guess for \(\text{E}(X)\).
- Make an educated guess for \(\text{SD}(X)\). (We’ll see how to compute expected value and variance for continuous random variables later, but for this example you should be able to make reasonable guesses without doing much computation.)
- A continuous random variable \(X\) has a Uniform distribution with parameters \(a\) and \(b\), with \(a<b\), if its probability density function \(f_X\) satisfies \[\begin{align} f_X(x) & \propto \text{constant}, \quad & & a<x<b\\ & = \frac{1}{b-a}, \quad & & a<x<b. \end{align}\]
- If \(X\) has a Uniform(\(a\), \(b\)) distribution then \[\begin{align} \text{E}(X) & = \frac{a+b}{2}\\ \text{Var}(X) & = \frac{|b-a|^2}{12}\\ \text{SD}(X) & = \frac{|b-a|}{\sqrt{12}} \approx 0.289|b-a| \end{align}\]