3.5: Continuous Random Variables and the Probability Density Function
- Page ID
- 47236
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\ket}[1]{\left| #1 \right>}\)
\(\newcommand{\bra}[1]{\left< #1 \right|}\)
\(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
\(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
\(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
\(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
\(\newcommand{\expect}[1]{\langle #1 \rangle}\)
\(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)
Let us suppose now the random event has infinitely many outcomes: for example, the random variable \(x\) occurs anywhere in the range of [0, 1]. Clearly the probability of hitting any specific point is zero (although not impossible). We proceed this way:
\[p(x \, \textrm {is in the range} [x_o, x_o + dx]) = \underline{p}(x_o) dx, \]
where \(\underline{p} (x_o)\) is called the probability density function. Because all the probabilities that comprise it have to add up to one, we have
\[ \int\limits_{-\infty}^{\infty} \underline{p}(x) \, dx = 1. \]
With this definition, we can calculate the mean of the variable \(x\) and of a function of the variable, \(f(x)\):
\begin{align} E[x] \, &= \int\limits_{-\infty}^{\infty} x \underline{p}(x) \, dx, \\[4pt] E[f(x)] \, &= \int\limits_{-\infty}^{\infty} f(x) \underline{p}(x) \, dx. \end{align}
Here are a few examples.
Consider a random variable that is equally likely to occur at any value between zero and \(2\pi\). Considering that the area under \(\underline{p}\) has to be one, we know then that \(\underline{p}(x) = 1/2 \pi\) for \(x = [0, 2 \pi]\) and it is zero everywhere else.
\begin{align*} E(x) &= \pi \\[4pt] \sigma^2 (x) &= \pi^2 /3 \\[4pt] \sigma (x) &= \pi / \sqrt{3} \\[4pt] E \cos (x) &= \int\limits_{0}^{2 \pi} \dfrac{1}{2\pi} \cos x \, dx = 0 \\[4pt] E \cos ^2 (x) &= \dfrac{1}{2}. \end{align*}
The earlier concept of conditional probability carries over to random variables. For instance, considering this same example we can write
\begin{align*} E[x | x>\pi] &= \int\limits_{0}^{2 \pi} x \underline{p} (x | x>\pi) \, dx \\[4pt] &= \int\limits_{\pi}^{2 \pi} x \dfrac{\underline{p} (x)} {p(x > \pi)} \, dx = \dfrac{3 \pi}{2}. \end{align*}
The denominator in the integral inflates the original pdf by a factor of two, and the limits of integration cause only values of \(x\) in the range of interest to be used.

