← 1. Continuous Random Variables Section 2 Exercises 3. Exponential, Normal, and Beta Distributions → All online text Español Applied calculus on-line chapter: calculus applied to probability and statistics
 Section 2. Probability Density Functions and the Uniform Distribution

We have seen that a histogram is a convenient way to picture the probability distribution associated with a continuous random variable X and that if we use subdivisions of 1 unit, the probability P(c \leq X \leq d) is given by the area under the histogram between X = c and X = d. But we have also seen that it is difficult to calculate probabilities for ranges of X that are not a whole number of subdivisions. To motivate the solution to this problem, let us look at the following example, based on Example 2 in Section 1:

### Example 1 Car Rentals

A survey finds the following probability distribution for the age of a rented car.

 Age (Years) 0-1 1-2 2-3 3-4 4-5 5-6 6-7 Probability

The histogram of this distribution is shown on the left of the figure below, and it suggests a curve something like the one given on the right. (There are many similarly shaped curves suggested by the bar graph. The question of finding the most appropriate curve is one we shall be considering below.)

The curve on the right is the graph of some function f, which we call a probability density function. We take the domain of f to be [0,+\infty), since this is the possible range of values X can take (in principle). Also, we use x to refer to specific values of X, so it is no coincidence that these values are shown on the x-axis. In general, a probability density function will have some (possibly unbounded) interval as its domain.

Suppose now that as in the previous section, we wanted to calculate the probability that a rented car is between 0 and 4 years old. Referring to the table,

P(0 \leq X \leq 4) = .10 + .26 + .28 + .20 = .84.

Referring to the left-hand graph of the following figure, notice that we can obtain the same result by adding the areas of the corresponding bars, since each bar has a width of 1 unit.

 P(0 \leq x \leq 4) = Shaded Area P(0 \leq x \leq 4) = \int_0^4f(x)\ dx
Ideally (see the right-hand graph of the figure above), our probability density curve should have the property that the area under it for 0 \leq X \leq 4 is the same, that is,

P(0 \leq X \leq 4) = \int_0^4 f(x)\ dx = .84

Now what happens if we want to find P(2 \leq X \leq 3.5)? In Section 1 we estimated this by using half of the rectangle between 3 and 4 (see the next figure).

 P(2 \leq x \leq 3.5) = Shaded Area P(2 \leq x \leq 3.5) = \int_2^{3.5} f(x)\ dx

Instead, we could use the definite integral

P(2 \leq x \leq 3.5) = \int_2^{3.5} f(x)\ dx

Before we go on... Although we haven't given you a formula for f(x), we would like f(x) to behave as described above. Here is something else we would like: Since a car has probability 1 of having an age between 0 and \infty, we want

P(0 \leq X < +\infty) = \int_0^{+\infty} f(x)\ dx = 1

Top of Page

Example 1 motivates the following:

 Probability Density Function A probability density function is a function f defined on an interval (a, b) and having the following properties. (a) f(x) \geq 0 for every x (b) \displaystyle \int_a^b f(x)\ dx = 1 We allow a, b, or both to be infinite, as in the above example. This would make the integral in (b) an improper one. Using a Probability Density Function to Compute Probability A continuous random variable X admits a probability density function f if, for every c and d, \displaystyle P(c \leq X \leq d) = \int_c^d f(x)\ dx. Example Let f(x) = \frac{2}{x^2} on the interval [a, b] = [1, 2]. Then property (a) holds, since \frac{2}{x^2} is positive on the interval [1, 2]. For property (b), \int_a^b f(x)\ dx = \int_1^2\frac{2}{x^2}\ dx = \Bigl[-\frac{2}{x}\Bigr]_1^2 = -1 + 2 = 1 If X admits this probability density function, then P(1.5 \leq X \leq 2) = Note If X admits a probability density function f, then

P(X = c) = P(c \leq X \leq c) = \int_c^c{f(x)\ dx} = 0
,

showing that there is a zero probability that X will assume any specified value.

Top of Page

### Example 2 Normalizing

For what constant k is f(x) = ke^{-x} a probability density function on [0,1]?

Solution We need to choose a k that makes requirements (a) and (b) of the definition true. Since e^{-x} > 0 for all x, all we need for (a) is to make sure that we choose k > 0. For (b), we calculate

\begin{align*} \int_0^1{ke^{-x}}\ dx &= -\Bigl[ ke^{-x}\Bigr]_0^1\\ &= k\Bigl(1-\frac{1}{e}\Bigr) = \frac{k(e-1)}{e} \end{align*}

Since this must equal 1, we get

\begin{align*} &\frac{k(e-1)}{e} = 1 \qquad \text{giving}\\ &k = \frac{e}{e-1} \approx 1.582 \end{align*}

Therefore, the function

f(x) = \Bigl(\frac{e}{e-1}\Bigr) e^{-x}

is a probability density function on [0,1].

Before we go on... If f is any nonnegative function with domain some interval (a, b), then the process of choosing a suitable constant k to make \int_a^b {kf(x) \ dx} = 1 is called normalizing the function f.

Top of Page

## Uniform Density Function

A uniform density function f is a density function that is constant, making it the simplest kind of density function. Since we require f(x) = k for some constant k, requirement (b) in the definition of a probability density function tells us that

1 = \int_a^b f(x)\ dx = \int_a^b k\ dx = (b-a)k

Thus we must have

k = \frac{1}{b-a}

In other words, a uniform density function must have the following form.

Uniform Density Function

The uniform density function on the interval \pmb{[a, b]} is the constant function defined by

f(x) = \frac{1}{b-a}.

Its graph is a horizontal line:

If a random variable X admits a uniform density function, we say that X is uniformly distributed, or that X has the uniform distribution.

Calculating Probability with a Uniform Density Function

Because probability is given by area, it is not hard to compute probabilities based on a uniform distribution:

 P(c \leq X \leq d) = \text{ Area of shaded rectangle } = \frac{d-c}{b-a}
Example

Let X be a random real number between 0 and 5. Then X has a uniform distribution given by

f(x) = \frac{1}{5-0} = \frac{1}{5}
Therefore,
P(2 \leq X \leq 4.5) = ### Example 3 Spinning a Dial

Suppose that you spin the dial shown in the figure so that it comes to rest at a random position. Model this with a suitable probability density function, and use it to find the probability that the dial will land somewhere between 5° and 300°. Solution

We take X to be the angle at which the pointer comes to rest, so we use the interval [0, 360] as its range. Since all angles are equally likely, the probability density function should not depend on x and therefore should be constant. That is, we take f to be uniform.

f(x) = \frac{1}{b-a} = \frac{1}{360-0} = \frac{1}{360}

Thus,

P(5 \leq X \leq 300) = \int_5^{300} \frac{1}{360}\ dx = \frac{300-5}{360} = \frac{295}{360} \approx .8194.

Before we go on... Check the following probabilities. Why are these the answers you expect?

P(0 \leq X \leq 90) = 1/4
P(90 \leq X \leq 180) = 1/4
P(0 \leq X \leq 180) = 1/2
P(0 \leq X \leq 270) = P(0 \leq X \leq 120) = Top of Page

Last Updated: March, 2008