Next, we want to talk about a really important probability distribution because it comes up all the
time in statistics, and that is the continuous uniform distribution.
Now it looks like this.
It's really simple.
This is a simple distribution where the probability density function associated with this distribution
is completely off or at zero for all values of x until we get to a So everything to the left of x equals
a here is it zero.
And then at x equals A, suddenly we see the distribution jump up to this level here.
Then it b it immediately instantaneously drops down back to zero again and remains at zero.
These vertical dashed lines are not part of the distribution.
The reason they're there is to show us that this part of the distribution up here starts exactly at
a and ends exactly at B, But the distribution itself just has this zero value to the left of A, then
this value up here between A and B and then again becomes zero at B and stays at zero for all other
values of X one.
Application of this kind of continuous uniform distribution is this idea of voltage.
Think about turning on a light switch When the light is off, the voltage being supplied is zero, and
then suddenly if we flip the light switch on at a the voltage jumps up to this level here and then if
we turn the light switch off at B, it drops down again to zero.
That's kind of one way to remember this off, on off kind of pattern.
Now, before we go further with this uniform distribution, let's compare and contrast this distribution
with the one that we looked at before when we talked about discrete uniform distributions.
If you remember, this is the probability mass function that is associated with rolling a six sided
die one time.
And this represents the discrete uniform distribution of that die roll.
So when we have a discrete random variable and its probability mass function and we want to sketch its
probability distribution, it's going to look like this where we have these vertical bars or columns,
all of equal height at each of the values that X can take on.
So all of these bars or columns in red that represent the probability are vertical, whereas with a
continuous random variable where we have a continuous uniform distribution, all of the pieces of our
probability density function are horizontal.
This section of the probability density function between x equals zero and x equals a is horizontal.
This piece of it here between A and B is horizontal.
This piece here starting at B and extending to the right of B is also horizontal.
And that makes sense because when we have a continuous random variable, remember we can always define
smaller and smaller increments of this continuous random variable x, so we can define X at A or at
B, but we can also define X halfway between A and B, and then halfway between those values again and
then halfway again.
And we can continue measuring smaller and smaller increments of X.
And so when we're talking about the probability distribution of a continuous random variable like that,
we need to model probability along all of these values of X along this horizontal axis.
And so we have to have these horizontal sections of the graph that can represent the value of the probability
density function F of X at all of these different values of X along the axis, whereas it would never
make sense to sketch a continuous uniform distribution for a discrete random variable because it would
have to look something like this where we're showing that the probability that these values of X occurs
is always 0.167 always consistent, but that only works at this exact value.
X equals one right here at this exact value x equals two.
Here at this exact value x equals three here, it doesn't make sense to show this horizontal section
of graph in between one and two or in between two and three.
Because with a die role where we're rolling a six sided die, of course we're never going to find the
value one and one half or the value two and a half.
We'll never get values in between these six discrete countable values.
So we would never have a horizontal graph that stretches along parallel to this horizontal axis as if
it was defining probability at all of these different values of x along the horizontal axis.
Instead, we have to use this vertical measure to show the probability just at exactly x equals one
and at exactly x equals to exactly x equals three, etc. Whereas up here when we have that continuous
random variable, we need these horizontal pieces of graph to show probability all along the x axis.
Now, with that in mind, let's.
Talk about the probability density function for this continuous random variable x, because in the case
of a continuous uniform distribution, we do have a continuous random variable and every continuous
random variable has a probability density function.
So the probability density function in the case of a continuous uniform distribution is going to be
this function.
Here it's always this function.
Exactly.
So the probability density function F of x is going to be given by one divided by B minus A when the
continuous random variable takes on values between A and B, otherwise the function is going to be zero
everywhere else.
So that means zero when X is less than a so over here to the left of A or when x is greater than B,
So over here to the right of B, so we're zero to the left of A, we're zero to the right of B, but
between A and B, the probability density function is given by this probability here one over B minus
A, and we can figure out why we have one over B minus A.
If we think about what we know about probability density functions, remember that under the curve of
a probability density function, the total area everywhere under the curve has to be equal to one.
That was one of the requirements for something to qualify as a probability density function, which
means that the area all this area under here.
Has to sum up geometrically to one.
And of course, we can see that this is a rectangular shape here.
So the area of this rectangle has to be equal to one.
Well, we know from geometry that the area of a rectangle is equal to the length times the height.
Well, if we look at the length of the rectangle in this case, let's call that the base here of the
rectangle between A and B, We know that this width, this length is going to be B minus A.
Imagine that A is three and that B is five.
We can see right away that the length of this base here is two, because to get from 3 to 5, that's
a width there of two.
So to get the width of two we can see that we just have to take five minus three.
Well, even if we don't know the values of A and B, we can just say that that width, the width of
the base there is B minus A.
So we can say here that this length is.
B minus A, and we don't know the height yet, but we know that the area of this rectangle has to be
one in order for us to have a probability density function, which means that when we divide both sides
of this equation by B minus A, we're just left with height over here on the right hand side and we
get one over B minus A is equal to the height.
And so what that says is that in order for this to be a probability density function, the height of
this rectangle here has to be one over B minus A, and that's why we see the height over here along
the vertical axis given as one over B minus A, and that's why our probability density function gives
this value here as one over B minus A.
So if we have a continuous uniform distribution with this kind of probability density function, where
the height here of this distribution is one over B minus A.
Keep in mind that this is such a simple distribution that will often see this continuous random variable
x written this way with a capital U as the uniform distribution.
Over A to B this interval here A to B, And so then if we have values of A and B, let's say that in
this case A is three and B is five, then we could describe the continuous random variable capital X
as given by the continuous uniform distribution on the interval 3 to 5.
Once we know that we have a continuous uniform distribution for our continuous random variable, then
of course, because this is a standard distribution that we're used to seeing all the time in statistics,
we can unlock mean variance and standard deviation formulas for this kind of distribution.
Which are these values here?
The mean of a continuous uniform distribution is always given by B plus A over two.
So in this case, if A is three and B is five, the mean would be given by five, plus three is eight,
eight divided by two is four.
So the mean the expected value is four, which makes sense because the entire distribution is located
here on this interval A to B and because of the uniform height of the distribution, we expect that
mean to occur right in the center of this rectangle, which in our case is halfway between three and
five or write it for the variance is always given by B minus a quantity squared divided by 12.
This is a fact that we know about all continuous uniform distributions, and so we can use that formula
to quickly find variance.
In our case, that's five minus three is two, two squared is four, four divided by 12 is one over
three.
So the variance is one third or approximately 0.33.
And then of course the standard deviation is always the square root of variance.
So in our case, that's approximately equal to the square root of zero.
.33.
And just because of the fact that we know that this is a continuous uniform distribution for a continuous
random variable, and these are formulas for the mean variance and standard deviation that have already
been established for this kind of distribution.
Once we know we have that kind of distribution, we unlock these and we can quickly get to mean variance
in standard deviation for this continuous random variable.
So that's the idea of a continuous uniform distribution.
We just wanted to make sure that we understood this so that we could contrast it with what we learned
earlier about the discrete uniform distribution when we were talking about discrete random variables
versus this continuous uniform distribution when we're talking about continuous random variables.