Once you have grasped the notion of a discrete random variable, it should be clear that all random variables need not be discrete. For example, consider measuring the atmospheric temperature at some prescribed location. The measured temperature would be random and could take on a continuum of values (theoretically speaking). Under these circumstances, we say that the random variable is continuous. All the machinery developed for discrete random values (such as expected value, variance, and mean) must be elevated to continuous random variables to handle this situation. The uniform distribution (which you have programmed using the random module) is an example of a continuous probability distribution.
Continuous Probability Functions
We begin by defining a continuous probability density function. We use the function notation f(x). Intermediate algebra may have been your first formal introduction to functions. In the study of probability, the functions we study are special. We define the function f(x) so that the area between it and the x-axis is equal to a probability. Since the maximum probability is one, the maximum area is also one. For continuous probability distributions, PROBABILITY = AREA.
Example 5.1
Consider the function for 0 ≤ x ≤ 20. x = a real number. The graph of
is a horizontal line. However, since 0 ≤ x ≤ 20, f(x) is restricted to the portion between x = 0 and x = 20, inclusive.
Figure 5.5
for 0 ≤ x ≤ 20.
The graph of is a horizontal line segment when 0 ≤ x ≤ 20.
The area between where 0 ≤ x ≤ 20 and the x-axis is the area of a rectangle with base = 20 and height =
.
Suppose we want to find the area between and the x-axis where 0 < x < 2.
Figure 5.6
Reminder
The area corresponds to a probability. The probability that x is between zero and two is 0.1, which can be written mathematically as P(0 < x < 2) = P(x < 2) = 0.1.
Suppose we want to find the area between and the x-axis where 4 < x < 15.
Figure 5.7
(15 – 4) = 11 = the base of a rectangle
The area corresponds to the probability P(4 < x < 15) = 0.55.
Suppose we want to find P(x = 15). On an x-y graph, x = 15 is a vertical line. A vertical line has no width (or zero width). Therefore,
Figure 5.8
P(X <= x), which can also be written as P(X < x) for continuous distributions, is called the cumulative distribution function or CDF. Notice the less than or equal to symbol. We can also use the CDF to calculate P(X > x). The CDF gives area to the left and P(X > x) gives area to the right. We calculate P(X > x) for continuous distributions as follows: P(X > x) = 1 – P (X < x).
Figure 5.9
Label the graph with f(x) and x. Scale the x and y axes with the maximum x and y values. ,
.
To calculate the probability that x is between two values, look at the following graph. Shade the region between x = 2.3 and x = 12.7. Then calculate the shaded area of a rectangle.
Figure 5.10
Try It 5.1
Consider the function for
. Draw the graph of f(x) and find P(2.5 < x < 7.5).
Source: OpenStax, https://openstax.org/books/statistics/pages/5-introduction
This work is licensed under a Creative Commons Attribution 4.0 License.