# Lesson Video: Continuous Random Variables Mathematics

In this video, we will learn how to describe the probability density function of a continuous random variable and use it to find the probability for some event.

14:43

### Video Transcript

In this video, we’ll learn how to describe the probability density function of a continuous random variable and use it to find the probability of an event. We’ll begin by reminding ourselves of the properties of discrete random variables and then define those of continuous random variables. We’ll then use the properties of continuous random variables in some examples to find an unknown constant and probabilities for events given a probability density function.

We recall that a discrete random variable is a random variable that can take only discrete values. There may be a finite number of these possible values or a countably infinite number of possible values. We can find the probability that 𝑋 is a particular value, and this is defined by a probability distribution function 𝑓 of 𝑥. And the sum of the probabilities is equal to one. Suppose, for example, that 𝑋 is the number thrown on one toss of a fair die. Then the possible 𝑥-values are one, two, three, four, five, and six. Then the probability that 𝑋 is equal to one of these values is one over six. And that’s the value of the probability distribution function 𝑓 of 𝑥 for 𝑋 equal to 𝑥𝑖. The sum of all of the 𝑓 of 𝑥𝑖 is equal to one.

For a discrete random variable then, the variable values are discrete. The variable values for a continuous random variable, on the other hand, can take any value within a given range. And this means that between any two of our values of 𝑥, there’s an infinite number of other values of 𝑥. A continuous random variable 𝑋 is characterized by a probability density function 𝑓 of 𝑥. That is where 𝑓 of 𝑥 is greater than or equal to zero for all values of 𝑥. And the total area under the graph of 𝑦 is equal to 𝑓 of 𝑥 is equal to one. So for a continuous random variable, the function is never negative and the total area under the graph is equal to one. In our first example, we’ll see how we can use this definition to find an unknown constant in a given function.

Let 𝑋 be a continuous random variable with probability density function 𝑓 of 𝑥 is equal to 𝑎𝑥 if one is less than or equal to 𝑥 is less than or equal to five and zero otherwise. Determine the value of 𝑎.

In this example, we’re given that 𝑓 of 𝑥 is a probability density function of a continuous random variable. And we’re asked to find the constant 𝑎. To do this, let’s recall the properties of a probability density function. 𝑓 of 𝑥 is a probability density function if 𝑓 of 𝑥 is greater than or equal to zero for all values of 𝑥 and the total area under the graph of 𝑦 is equal to 𝑓 of 𝑥 is equal to one. So let’s begin by examining the first condition; that’s the positivity condition.

We know that 𝑓 of 𝑥 is equal to zero outside of the interval one to five. And this means that our first condition is satisfied for 𝑥 not in the interval one to five. For 𝑥 inside the interval one to five, we know that 𝑓 of 𝑥 is equal to 𝑎𝑥. We know that 𝑥 is greater than zero in this interval. And so 𝑎 also must be greater than or equal to zero, since 𝑓 is a probability density function. Our first condition then requires that 𝑎 is greater than or equal to zero. Now let’s look at our second condition, which tells us that the total area under the graph of 𝑦 is 𝑓 of 𝑥 is one. In order to satisfy this condition, we see that 𝑎 cannot be equal to zero, since if 𝑎 is equal to zero, 𝑓 of 𝑥 is equal to zero for all 𝑥. This in turn means that the area would be equal to zero.

Hence, to satisfy the second condition that the total area is equal to one, we cannot have 𝑎 equal to zero. This means that 𝑎 must be greater than zero. And since 𝑓 of 𝑥 is equal to 𝑎𝑥 for 𝑥 between one and five, the graph of 𝑓 of 𝑥 over the interval one to five must be a straight line with a positive slope. Now, from this graph, we see that the area under the graph is a trapezoid. And we recall that the area of a trapezoid is one over two multiplied by the sum of the lengths of the base and the top multiplied by the height. And so to find the area of this trapezoid, that’s the area under the curve, we must find the lengths of the base, the top, and the height.

To do this, we begin by finding the coordinates of the vertices of the trapezoid. And to do this, we substitute 𝑥 is equal to one and 𝑥 is equal to five into our function 𝑓 of 𝑥. 𝑓 of one is equal to 𝑎 multiplied by one, which is equal to 𝑎. And 𝑓 of five is equal to 𝑎 multiplied by five, which is five 𝑎. And this gives us the coordinates of our vertices, which are one, 𝑎 and five, five 𝑎. And so the top of our trapezoid has a length 𝑎 and the base has a length five 𝑎.

The height of our trapezoid is the length that lies along the 𝑥-axis. That is five minus one, which is four. And so we have the top 𝑎, the base five 𝑎, and the height four, which we can now substitute into the formula for the area of the trapezoid. And so we have the area is one over two multiplied by five 𝑎 plus 𝑎 multiplied by four. That is two multiplied by six 𝑎, which is 12𝑎.

Now to satisfy our second condition, 12𝑎 must be equal to one because that’s the area. Dividing both sides by 12, we can solve for 𝑎. And so the value of 𝑎 is equal to one over 12.

In this example, we found an unknown constant in a probability density function. Let’s turn our attention now to calculating probabilities for continuous random variables.

When calculating probabilities for a continuous random variable 𝑋, we consider the probability that 𝑋 lies within a particular interval. And if we call this interval 𝐼, then the probability that 𝑥 one is less than or equal to 𝑋 is less than or equal to 𝑥 two is equal to the area under the curve 𝑓 of 𝑥 on the interval with boundaries 𝑥 one and 𝑥 two. So the probability is the area under the probability density function 𝑓 of 𝑥.

Now we recall that the total area under the probability density curve is equal to one. And in the sample space, the sum of all the probabilities must be one. Unlike for a discrete random variable, however, for a continuous random variable, we cannot specify the probability that 𝑋 is a particular value. And that’s because the area under the curve for a specific value of 𝑋 doesn’t really exist. It corresponds to the area carved out by an infinitesimally thin line. So instead, we calculate the probability that 𝑋 is between two values. That is the area under the curve between two values of 𝑥.

Now, when the graph of a probability density function forms a simple geometric shape, such as a triangle, a trapezoid, or a rectangle, we can use geometric formulae for the area to find the probabilities of events. Let’s look at an example.

Let 𝑋 be a continuous random variable with the probability density function 𝑓 of 𝑥 represented by the following graph. Find the probability that four is less than or equal to 𝑋 is less than or equal to five.

In this example, we need to find the probability of an event for a continuous random variable, where the event is given by four is less than or equal to 𝑋 is less than or equal to five. Now we recall that the probability of the event 𝑥 one is less than or equal to 𝑋 is less than or equal to 𝑥 two for a continuous random variable is the area under the probability density function 𝑓 of 𝑥 on the interval with boundaries 𝑥 one and 𝑥 two. Since our interval is bounded by 𝑥 is equal to four and 𝑥 is equal to five, we begin by highlighting the region under the curve over this interval.

To find the probability of our event, we must find the area of the highlighted region, which is a trapezoid. Recalling that the area of a trapezoid is one over two multiplied by the sum of the lengths of the base and top multiplied by the height, so we’ll need to find the lengths of our base, top, and height. We can see straight away from the graph that the length of the base is one-quarter. The height is given by five minus four; that is one unit. And it remains to find the length of the top of the trapezoid. And this is the 𝑦-coordinate of the point on the graph at 𝑥 is equal to five.

Now this point lies on a straight line between the points with coordinates four, one-quarter and six, zero. Now, since 𝑥 is equal to five is exactly halfway between 𝑥 is equal to four and 𝑥 is equal to six, the 𝑦-coordinate at 𝑥 is equal to five must be the average of the 𝑦-coordinates of the two endpoints. That is the average of one-quarter and zero. And so we have 𝑦 is equal to one over two times one-quarter plus zero, which is one over eight. And so the length of the top of the trapezoid is one over eight units. And so the base of our trapezoid is one over four units, the top is one over eight units, and the height is one unit.

Now we have everything we need to calculate the area of our trapezoid. And that’s one over two multiplied by one over four plus one over eight multiplied by one. And this evaluates to three over 16 units squared. And so for the probability density function 𝑓 of 𝑥 represented by the graph, the probability that four is less than or equal to 𝑋 is less than or equal to five is three over 16.

In this example, we were given the graph of a probability density function. In our next example, we will find the probability of an event when the probability density function is given in its algebraic form.

Let 𝑋 be a continuous random variable with the probability density function 𝑓 of 𝑥 is equal to one over 63 when 𝑥 is greater than or equal to nine and less than or equal to 72 and zero otherwise. Find the probability that 𝑋 is greater than 64.

In this example, we need to find the probability of an event for a continuous random variable when the event is 𝑋 is greater than 64. We’re given a probability density function, so let’s begin by graphing this function. The function takes the value one over 63 when 𝑥 is between nine and 72 and a zero otherwise.

We recall that the probability of an event for a continuous random variable is given by the area under the graph of the probability density function 𝑓 of 𝑥 over the interval representing the event. In our case then, we need to find the area under this graph over the interval 64 to ∞. However, since we know that this function is equal to zero for 𝑥 greater than 72, we need only find the area under the curve for 𝑋 between 64 and 72. That is the area of the highlighted area on the graph, which is a rectangle. And this area gives us the probability of the given event.

We see that the base of the rectangle has length 72 minus 64; that is eight units. And the height of the rectangle is one over 63. And we know, of course, that the area of a rectangle is the base times the height, which in our case is eight multiplied by one over 63. And that’s eight over 63 squared units. Hence, the probability that 𝑋 is greater than 64 is eight over 63. And we note that this is a reasonable answer for a probability, since eight over 63 lies between zero and one.

Sometimes the graph of a probability density function is a piecewise-defined function consisting of numerous subfunctions. In such cases, to find the probability of an event, we only need to draw the portion of the graph relevant to the given event. Let’s see how this works in our final example.

Let 𝑋 be a continuous random variable with the probability density function 𝑓 of 𝑥 is equal to 𝑥 over eight for 𝑥 between two and three, 𝑓 of 𝑥 is one over 48 for 𝑥 between three and 36, and 𝑓 of 𝑥 is zero otherwise. Find the probability that 𝑋 is between 11 and 24.

In this example, we need to find the probability of an event for a continuous random variable when the event is 𝑋 is between 11 and 24. Now we recall that the probability of an event for a continuous random variable is given by the area under the graph of the probability density function 𝑓 of 𝑥 over the interval representing the event, that is, with boundaries 𝑥 one and 𝑥 two.

In our case then, this means that we need to find the area under the graph over the interval with boundaries 11 and 24. And since we do only need to find the area over this interval, we don’t need to find the graph of the function outside of this region. In particular, the smallest possible 𝑥 in our region is 11 and the largest is 24. And both of these values lie within the range of the second subfunction for 𝑓 of 𝑥. That is the function defined between three and 36.

And so we need to only draw the graph for this subfunction. For values of 𝑥 between three and 36 then, 𝑓 of 𝑥 is the constant function one over 48. Now highlighting the region under the curve between 𝑥 is 11 and 24, we see that our area is that of a rectangle. And the area of this rectangle is the probability of the given event.

We see that the base of our rectangle has length 24 minus 11; that is 13 units. And the height of the rectangle is one over 48 units. And we know that the area of a rectangle is its base times its height. And so the area of our rectangle is 13 multiplied by one over 48; that is 13 over 48 units squared. And so we find that, with the probability density function as shown, the probability that 𝑋 is between 11 and 24 is 13 over 48. And we know that this is a reasonable answer for a probability, since 13 over 48 lies between zero and one.

Let’s complete this video by recapping a few of the important concepts we’ve covered. We know that a continuous random variable takes values in a continuum. A function 𝑓 of 𝑥 is a probability density function if 𝑓 of 𝑥 is greater than or equal to zero for all values of 𝑥 and the total area under the graph 𝑦 is equal to 𝑓 of 𝑥 is equal to one. And finally, the probability of the event that 𝑋 lies between 𝑥 one and 𝑥 two is the area under the curve 𝑦 is equal to 𝑓 of 𝑥 on the interval 𝐼 with boundaries 𝑥 one and 𝑥 two.