9 Continuous Random Variables
We now turn our attention to continuous random variables.
9.1 Distribution Functions
Definition 9.1 (Distribution Function of a Random Variable) Let X be a random variable. The distribution function of X, denoted F(x), is the function defined on all real numbers x such that F(x)=P(X≤x).
Example 9.1 Suppose X is the discrete random variable given by density function x0123p(x)1/83/83/81/8 Note F(−2.7)=P(X≤−2.7)=0, and F(1.3)=P(X≤1.3)=1/8+3/8=4/8 (since the only X values less than or equal to 1.3 with positive probability are X=0 or X=1).
The distribution function for X is the following step function:
F(x)={0 if x<01/8 if 0≤x<14/8 if 1≤x<27/8 if 2≤x<31 if x≥3
Figure 9.1: Distribution function for X
Observe that this function F(x) is defined for all −∞<x<∞ (check out those arrows :)). The jumps in the graph indicate that the function F is not continuous, and the points of discontinuity occur exactly at the values of X in the probability table for X.
Theorem 9.1 (Properties of any distribution function) If F(x) is a distribution function, then
- limx→−∞F(x)=0;
- F is non-decreasing. That is, if x1≤x2 then F(x1)≤F(x2); and
- limx→∞F(x)=1.
Definition 9.2 (Continuous Random Variable) A random variable is called a continuous random variable if its distribution function F is continuous for all x.
So the distribution function for any continuous random variable has the following sort of look, descriptively (as in Figure 9.2):
- it is continuous,
- its domain is (−∞,∞)
- as x progresses away from −∞ toward ∞, the values of F(x) rise from 0 to 1, never decreasing along the way.
Definition 9.3 Let F be the distribution for a continuous random variable X. Then the derivative of F, wherever it exists is called the probability density function for X. When continuous X has a probability density function, we usually denote it as f(x).
The density function f(x) is a theoretical curve for the frequency distribution of a population of measurements. We’ll look at examples shortly.
Theorem 9.2 (Properties of a density function) If f(x) is a density function for a continuous random variable X, then
- f(x)≥0 for all x, and
- ∫∞−∞f(x) dx=1.
Sketch of Proof:
For a) Recall f(x)=F′(x). One feature of any distribution function is that it is never decreasing, so its slope (derivative) is never negative. Since f(x) gives the slope of F, f(x)≥0.
For b) F is the antiderivative of f, which is useful to know when we integrate f. Also, ∫∞−∞f(x) dx is an improper integral, which we can tackle by splitting it into two integrals, assuming each of these new integrals converges:
∫∞−∞f(x) dx=∫0−∞f(x) dx+∫∞0f(x) dx=lima→−∞∫0af(x) dx+limb→∞∫b0f(x) dx=lima→−∞[F(0)−F(a)]+limb→∞[F(b)−F(0)]=(F(0)−0)+(1−F(0)) by limit properties of F=1.
Example 9.2 Consider distribution function F pictured below, where c>0 is a fixed constant.

Figure 9.2: Piece-wise linear distribution function
This function is piece-wise linear, continuous, and it is differentiable everywhere except the sharp corners at x=0 and x=c. At any other point, f(x)=F′(x) equals the slope of the segment running through the point (x,F(X)).
So the probability density function for this random variable is f(x)={0 if x<01/c if 0<x<c0 if x>c, and the graph of f looks like this:

Figure 9.3: probability density function for X
Note that f(x)≥0 for all x. Also, ∫∞−∞f(x) dx=∫c0f(x) dx (we only have to integrate over intervals in which f(x)>0), and this later integral is the area of a rectangle of width c and height 1/c, so it has area 1. Thus, we have a valid pdf!
Example 9.3 Find the value of k that makes the following function a valid pdf. f(x)={kx8 if 0≤x≤10 else. We need k≥0 os that f(x)≥0 for all x. We also need 1=∫∞−∞f(x) dx=∫10kx8 dx=k9x9 |10. It follows that k=9.
Definition 9.4 (Quantiles) Let X denote a random variable. If 0<p<1, the pth quantile of X, denoted ϕp, is the smallest value such that F(ϕp)≥p. If X is continuous, ϕp is the smallest value such that F(ϕp)=p.
Some special quantiles:
- ϕ.25, denoted Q1, is called the first quartile,
- ϕ.5, denoted M, is called the median of the random variable,
- ϕ.75, denoted Q3, is called the third quartile
Theorem 9.3 If X is a continuous random variable with density function f, then for any real numbers a<b, P(a≤X≤b)=∫baf(x) dx.
Proof Idea: The distribution function F is an antiderivative of the density function f, so using the Fundamental Theorem of Calculus,
∫baf(x) dx=F(b)−F(a)=P(X≤b)−P(X≤a)=P(a<X≤b) since a<b=P(a≤X≤b) since P(X=a)=0
Note: For any continuous random variable X, and a<b,
P(a<X<b)=P(a≤X<b)=P(a<X≤b)=P(a≤X≤B) since P(X=c)=0 for any real number c.
Example 9.4 (A quadratic density function) Suppose X has density function f(x)={38x2 if 0≤x≤20 else.
Wait! Is this actually a valid density function?
- Ok, yes, f(x)≥0 for all x.
- And…
∫∞−∞f(x) dx=∫2038x2 dx=18x3|20=1.
Ok, now to the question: Find P(1≤X≤2):
P(1≤X≤2)=∫2138x2 dx=18x3 |21=1−18=78.
Even though X can take any value between 0 and 2, the probability is 7/8 that X will be between 1 and 2. Most of the area under the density curve is at the high end of the X range:

Figure 9.4: A quadratic density function
Example 9.5 Suppose X has density function f(x)={0 if x<11x2 if x≥1.
a) Check that this gives a valid density function:
∫∞−∞f(x) dx=∫∞1x−2 dx=limb→∞[∫b1x−2 dx]=limb→∞[−1x|b1]=limb→∞[−1b+1]=1. The limit equals 1 in the end since 1/b→0 as b→∞.
b) Find F(x), the cumulative probability distribution function.
By definition, for any real number x, F(x)=∫x−∞f(t) dt, which, of course, gives the area under f over the interval (−∞,x]. Since f is piece-wise defined, the integrand used in the integral to evaluate F depends on the bounds of the integral.
F(x)={∫x−∞0 dt if x<1∫1−∞0 dt+∫x11t2 dt if x≥1. We leave it to the reader to integrate these expressions to obtain F(x)={0 if x<11−1x if x≥1.

Figure 9.5: Distribution function for X
c) Find P(1<X<3).
Well, P(1<X<3)=∫31f(x) dx=F(3)−F(1), by the Fundamental Theorem of Calculus (FTC), so P(1<X<3)=(1−1/3)−(1−1/1)=2/3.
9.2 Expected Value for Continuous Random Variables
Definition 9.5 If X is a continuous random variable with probability density function f(x), then the expected value of X, denoted E(X), is E(X)=∫∞−∞x⋅f(x) dx, provided this integral exists. The expected value E(X) is also called the mean of X, and is often denoted as μX, or μ if the random variable X is understood.
The expected value of the function g(X) of X is E(g(X))=∫∞−∞g(x)⋅f(x) dx, provided this integral exists.
The variance of X is V(X)=E((X−μX)2), provided this integral exists.
As in the discrete case, one can show V(X)=E(X2)−E(X)2, a working formula for variance which is sometimes easier to use to calculate variance.
Example 9.6
Find E(X) and V(X) where X is the continuous random variable from Example 9.4.
Recall X has density function f(x)=3x2/8 for 0≤x≤2.
Expected Value: E(X)=∫20x⋅3x2/8 dx=38∫20x3 dx=3814x4 |20=32.
Variance: We first find E(X2): E(X2)=∫20x2⋅3x2/8 dx=38∫20x4 dx=3815x5 |20=125.
Then, V(X)=E(X2)−E(X)2=(12/5)−(3/2)2=0.15.
The properties of expected value that held for discrete random variables also hold for continuous random variables.
Theorem 9.4 Suppose X is a continuous random variable, c∈R is a constant, and g, g1, and g2 are functions of X.
- E(c)=c.
- E(c⋅g(X))=cE(g(X)).
- E(g1(X)±g2(X))=E(g1(X)±g2(X)).
These results follow immediately from properties of integration. For instance, to prove property 1 we observe that for constant c, E(c)=∫∞−∞c⋅f(x) dx=c∫∞−∞f(x) dx, and the integral in the last expression equals 1 by definition of a valid probability density function.
Theorem 9.5 Let X be a random variable (discrete or continuous) with E(X)=μ and V(X)=σ2, and let a,b be constants. Then
- E(aX+b)=aE(X)+b=aμ+b.
- V(aX+b)=a2V(X)=a2σ2.
Proof.
Example 9.7 (Ore Sample Impurities) For certain ore samples, the proportion X of impurities per sample is a random variable with density function f(x)={1.5x2+x if 0≤x≤10 else. The dollar value of each sample is W=5−0.5X.
Find the mean, variance, and standard deviation of W.
First, let’s consider the variable X itself.
E(X)=∫10x⋅(1.5x2+x) dx=∫101.5x3+x2 dx=1.54x4+13x3 |10=1724.
Also, E(X2)=∫10x2⋅(1.5x2+x) dx=∫101.5x4+x3 dx=1.55x5+14x4 |10=1120.
Thus, V(X)=(11/20)−(17/24)2≈0.0483.
Then, by Theorem 9.5,
E(W)=E(5−0.5X)=5−0.5E(X)=5−0.5⋅(17/24)=4.65, and V(W)=V(5−0.5X)=0.25V(X)≈0.012, so that the standard deviation is σ=√V(W) ≈0.11 (about 11 cents).
:::