We've already talked about how we use a probability math function to model the probability associated
with a discrete random variable.
We'll use a probability density function to model the probability associated with a continuous random
variable.
So if you remember, we looked at the probability mass function for a DAI role, and when we graphed
that probability mass function, we showed that the probability associated with rolling a one, two,
three, four, five or six was always one out of six or approximately 0.167.
And so the sketch of that probability mass function looked like this, where we have a uniform distribution
because the probability remains uniform, it's always the same.
The probability is equal for rolling each of these values.
When we roll a six sided DAI one time, what we notice here is that if we look at the graph of this
probability mass function, we're only defining probabilities for these exact values here, the exact
value one, the exact value to the exact value three etc. We don't define a probability for one and
a half or two and a half or any value between one, two, three, four, five and six.
And of course that's because with the probability mass function, we're dealing with a discrete random
variable where we have those discrete countable values and no values in between.
Remember that a continuous random variable in contrast, can be defined for an infinite set of values,
not just a discrete set of values like this.
One, two, three, four, five, six.
In other words, if we were to sketch the graph of a probability density function for a continuous random
variable as opposed to a probability mass function for a discrete random variable, we would use a similar
set of axes like this, the horizontal axis x and the vertical axis indicating probability.
But the sketch of our probability density function might be a curve that looks something like this.
And then what we would do is identify values of X.
So maybe this value here, x one, this value here x two.
But in theory, for this continuous random variable, we could define an infinite number of values in
between x one and x two, and we could think about the probability of each of those values.
And remember, with a continuous random variable, we can always get more and more granular with these
values as long as we continue measuring out to a larger number of decimal places.
So really there are an infinite number of values along this horizontal axis for the continuous random
variable, in contrast with this discrete random variable where we just have this discrete countable
value set.
So this is the kind of variable, the kind of scenario we're trying to model with a probability function.
And in this case we can say that every continuous random variable x has a probability density function
F of X.
And what we can say about this probability density function is that the probability that the continuous
random variable x takes on some value on the interval A to B is given by this expression.
Over here on the right, where this notation here is called the integral.
This is the integral from A to B of the function F of x.
This notation here is like the other side of the integral notation, the integral and the d sandwich,
whatever is between them and tells us to perform a specific operation with this function F of x which
we'll talk about.
Notice here also that now that we're switching to a continuous random variable, when we're calculating
probability, we have to calculate probability over an interval A to B, whereas with the discrete random
variable we calculated the probability of a specific value one value at a time.
So here we have the probability of rolling a one, the probability of rolling it to the probability
of rolling a three.
When we transition to the continuous random variable and the probability density function, we are no
longer going to calculate the probability that X takes on a specific value.
And the reason for that is because it's essentially impossible for us to measure the probability that
X takes on an exact value when we're dealing with a continuous random variable.
So let's say, for instance, that the continuous random variable that the probability density function
associated with this continuous random variable here, we've sketched it and maybe it model's finishing
times for a standardized test.
Let's say here that this is the mean finishing time for the test.
And that mean finishing time, let's say, is 71.
Minutes such that let's say here this X to value is a finishing time of we'll call it.
80 minutes.
Well, if we want to calculate the probability that a student's finishing time is exactly 71 minutes,
that's virtually impossible for us to do because they might finish at 71 minutes and 0.0000000 1 seconds.
In other words, they might be off of 71 minutes by a value of time so small that it's almost immeasurable.
And because of that theoretical idea where it's basically impossible for us to measure that, they finished
truly at exactly 71 minutes because remember, we can always divide time into smaller and smaller and
smaller slices.
We can't really ever say the probability that a student finished at exactly one minute.
And so with a continuous random variable and its probability density function, the probability of any
specific exact value in the range of the continuous random variable, the probability of any exact value
is actually zero.
So for a variable like this one, the probability that x is exactly equal to 71 minutes is zero.
The probability that X is exactly equal to 80 minutes is also zero.
The probability that the variable takes on any specific exact value is always zero, because in theory,
for a continuous random variable, we can't pinpoint exactly 71 minutes.
We're always going to be off by some infinitely small fraction of a second.
However, we can calculate probability over some interval A to B, for instance, we could think about
the probability that the student's finishing time is somewhere between 71 minutes and 80 minutes.
And in the same way over here with the probability mass function for a discrete random variable, the
probability of one specific value is given by this column or this bar with a continuous random variable
and the probability density function.
The probability that the discrete random variable takes on a value in some interval is given by the
area under this probability density curve over that particular interval.
So if we're interested here in the probability that the student's finishing time is between 71 and 80
minutes, that probability can be represented by all of the area under this curve, over this interval.
In other words, if we could geometrically calculate the area under this curve here, we would find
some value between zero and one, and that value for the area would be equivalent to the probability
that the variable takes on some value in that interval.
So to summarize here, instead of using a probability mass function to calculate that a discrete random
variable takes on an exact value, we'll now use a probability density function to calculate the probability
that a continuous random variable takes on some value within a specific interval.
Now, when it comes to the probability density function, there are a couple of things we need to remember.
So it has to be true that the probability density function f or f of X is greater than or equal to zero
for all possible values of X that the continuous random variable can take on.
So that means for all of the values of x between here and here, under the curve of the probability
density function, all of these values of X on this interval have to produce a positive value for F
of X.
And we can think about this curve here as the graph of f of x, which just means that this curve, if
we were to sketch F of x, this curve, the sketch of f of x has to sit above the horizontal axis anywhere.
We can't have any negative values.
This curve can't dip below the horizontal axis at any point in this interval.
So that's our first requirement.
And then our second requirement is that the total area under this curve when we add it all up, has
to be equal to one.
Because remember, our vertical axis here represents probability.
So the area under this curve is the total probability for all possible values of our continuous random
variable.
And probability always has to add to one, which means that all of the area under this curve has to
add to one.
And that's what this means here, this integral notation.
And then from negative infinity to positive infinity just means everywhere under the curve of F of X,
to integrate means to find the area under the curve.
So the area under the curve F of X everywhere underneath it.
When we add all that together, that has to be equal to one.
So that's our second requirement.
So that being said, let's go ahead and look at an example.
We'll say here that.
This function f of x is a probability density function as long as we define it over the interval 0 to
1.
So under this definition, before we move forward, we need to check to see that we meet both of these
criteria here.
That F of X is greater than or equal to zero for all X, and that the total area under the curve is
equal to one.
So there's a couple of ways that we can go about this.
But one easy way to verify this first criteria is to sketch the graph of F.
So if we use a calculator or any computer algebra system, any graphing software to sketch F of X,
we see this graph here.
We're told that we're only looking at the values of X on the interval 0 to 1.
So here this is x equals zero, this is x equals one.
And so we're only interested in this section of the graph between these two points and we can see that
everywhere between zero and one.
The graph here is at or above the horizontal axis.
And so we meet this first criteria.
If we had been given an interval, for instance, of negative one to positive one, we can see that
over here between negative one and zero, the graph sits below the horizontal axis.
And so we would not meet this first criteria and we could not call this a probability density function.
But because the interval has been limited to 0 to 1 and we can see that the graph is at or above the
horizontal axis, everywhere in that interval we meet this first criteria.
Now for the second criteria, in order to figure this out by hand, we're going to need to know how
to evaluate integrals.
And that only comes up in calculus one or calculus two.
But that's okay.
We don't have to know calculus.
We don't have to know how to evaluate an integral because we can still use calculators or computers
to help us verify this fact really quickly.
So all we have to do is substitute here for F of X for x cubed.
So this is what we would plug into a computer algebra system, software, computer to get this integral
evaluated for us, we would say here the integral and then instead of from negative infinity to infinity
in the definition here, the interval has been limited to 0 to 1.
So we'll say 0 to 1.
And then instead of F of x here we'll put in for x cubed our F of x function and then D x again, we
can plug this into any calculator or computer and it will tell us the value of this integral if we don't
know how to do integration.
The value of this integral is in fact one.
And so we meet this criteria.
If we wanted to evaluate this integral by hand, the way that we would do it is by adding one to this
exponent here to get X to the fourth instead of x cubed.
So we would have X to the fourth and then we would divide by this new exponent of four.
So when we divide this function by four, it'll cancel this coefficient of four.
And so the integral of four x cubed is x to the fourth.
And then we would evaluate that result, that integrated result on the given interval 0 to 1.
And when we do, when we evaluate over this interval, we always plug in this upper limit here of one
first.
So we get one to the four.
And then we always subtract whatever we get when we plug in this lower limit of integration.
So when we plug in zero, we get zero to the fourth here.
And of course, when we evaluate that, we get one -0 or one.
And so we see that the value of that integral over this interval 0 to 1 is in fact one.
And so we can double check that we do in fact meet this requirement.
But again, we don't need to know integration.
If we haven't taken calculus, we can use a computer to help us calculate any integral, the integral
of any function F of x over any interval, just to verify that this is one and therefore that we have
a probability density function.
So once we've verified that we have a probability density function, we can answer probability questions
about the continuous random variable, like what is the probability that the continuous random variable
x takes on some value between, let's say, one half and three fourths?
So looking at this curve here, that's this interval here, this is one half and this is three over
four.
So that interval, if we want to calculate that probability, what we're looking for is this area here,
geometrically this physical area.
If we can calculate this area, that will give us the probability that X takes on a value between one
half and three fourths.
And so here's what that would look like if we actually plugged into this formula here, we would say
that the probability that X is between A and B, we said one half and three fourths.
So one half less than or equal to X less than or equal to three over four is equal to the integral from
one half to three fourths of the function F of x, which we were already told was for x cubed and then
D x.
And again, this is the same thing we just did here.
We can use any computer or calculator to help us find this value if we don't know how to integrate or
if we want to integrate.
Remember we said that the integral of four x cubed was x to the fourth.
So the integral here is x to the fourth, and then we just evaluate that integral over this interval,
one half to three quarters, we plug in our upper limit of integration first three over four, so we
get three over four.
To the fourth power, and then we subtract whatever we get when we plug in our lower limit of integration,
which is one half.
So we get one half.
To the fourth power.
And then if we do this math by hand here, we'll get three to the four is 81, and four to the four
is 256, minus one to the four is one, and two to the four is 16.
If we find a common denominator by multiplying this second fraction by 16 over 16, then we can call
this fraction here 16 over 256 instead of this.
And the result then there is 81 -16 is 65.
So 65 over 256, which when we convert to a decimal and round, is approximately 25.4%.
And so what that tells us then is that the probability that our continuous random variable will have
a value between one half and three fourths is just over 25%.
Given that this is the probability density function that models our continuous random variable over
this interval 0 to 1.
So again, the biggest takeaway here is that we use probability mass functions to model discrete random
variables, and we calculate probability of exact values.
When we have a continuous random variable, we instead use a probability density function and we only
calculate probabilities over intervals.
We look for the probability that the continuous random variable falls between A and B.
Instead of that, the random variable takes on a specific value like A or B, And in order to calculate
that probability, we first check that we meet these two conditions to verify that we do in fact have
a probability density function.
And then we calculate this integral in order to find the probability over that interval.
If we've taken calculus one and calculus two and we're comfortable with integration, we can, of course
do that by hand, or if not, no problem at all.
We can use any calculator, online calculator, computer algebra system, etc. to calculate this integral
for us.
The result that we get when we integrate the function f of x over the interval A to B should always
be a value between zero and one.
We might get a fraction, but even if we do, we can convert that to a decimal value.
In this case, we got approximately 0.254.
We can also convert that to a percentage to say there's an approximately 25.4% chance.
Or we could just say the probability is about 0.254 and make the conclusion that that is the probability
that the continuous random variable takes on a value in the interval that we defined.
In this particular example, the interval one half to three fourths.