WEBVTT mathematics/probability/murray
00:00:00.000 --> 00:00:04.500
Hi, welcome back to the probability lectures here on www.educator.com.
00:00:04.500 --> 00:00:09.800
My name is Will Murray, we are learning about continuous probability right now.
00:00:09.800 --> 00:00:15.200
Today, we are going to study the mean and variance for continuous distributions.
00:00:15.200 --> 00:00:18.100
I will teach you how to calculate the mean and variance.
00:00:18.100 --> 00:00:23.000
I also mentioned standard deviation.
00:00:23.000 --> 00:00:25.600
Usually, we do not look at standard deviation so often for the continuous distributions,
00:00:25.600 --> 00:00:29.600
but I will go ahead and show you how to calculate it, if you need to.
00:00:29.600 --> 00:00:33.800
I'm going to spend most of the time though on the mean and variance.
00:00:33.800 --> 00:00:35.800
Let me get started here.
00:00:35.800 --> 00:00:44.500
I will remind you how we calculated the mean for discrete distributions which was as follows.
00:00:44.500 --> 00:00:53.700
For discrete distributions, we calculated the mean, the expected value of our random variable
00:00:53.700 --> 00:01:01.000
was the sum of all possible values of Y of Y × P of Y.
00:01:01.000 --> 00:01:06.400
The mean for continuous distributions is essentially the same thing.
00:01:06.400 --> 00:01:11.300
You still have a Y, instead of P of Y, you have the density function F of Y.
00:01:11.300 --> 00:01:16.600
By the way, remember, there is a density function which we use f to denote the density function.
00:01:16.600 --> 00:01:22.800
There is also a cumulative distribution function for which we use F.
00:01:22.800 --> 00:01:29.800
This is definitely the density function not the cumulative distribution function.
00:01:29.800 --> 00:01:33.700
It is essentially the same formula that we had for discrete distributions.
00:01:33.700 --> 00:01:42.400
The Y is the same, the P of Y is turned into F of Y, and the summation has turned into an integral.
00:01:42.400 --> 00:01:46.200
Really, you do not need to memorize a new formula.
00:01:46.200 --> 00:01:52.200
If you can remember one, it is just kind of translating it into the language of continuous distributions
00:01:52.200 --> 00:01:56.200
to find the expected value for a continuous distribution.
00:01:56.200 --> 00:02:02.100
Remember that, mean and expected value are the same thing, those are completely synonymous.
00:02:02.100 --> 00:02:08.100
If someone asks for the mean, they are asking you for the expected value, and vice versa.
00:02:08.100 --> 00:02:16.800
It is very useful to know that just like with discreet distributions, expectation is linear.
00:02:16.800 --> 00:02:20.800
The expected value of a constant is just a constant.
00:02:20.800 --> 00:02:26.600
If you have two things added together, you can split them up and calculate their expected values separately.
00:02:26.600 --> 00:02:33.300
If you have a constant × a random variable then you can pull a constant outside.
00:02:33.300 --> 00:02:36.500
It is a very useful property of expectation.
00:02:36.500 --> 00:02:41.100
We will be using it again and again, the linearity of expectation.
00:02:41.100 --> 00:02:44.300
By the way, that does not work for variance.
00:02:44.300 --> 00:02:50.500
Variance is not linear, you have to be very careful not to assume that variance is linear.
00:02:50.500 --> 00:02:53.400
You can get yourself in a lot of trouble that way.
00:02:53.400 --> 00:02:57.400
I will go ahead and show you the definition of variance.
00:02:57.400 --> 00:03:03.400
The definition of variance is the same definition that we had for discrete distributions.
00:03:03.400 --> 00:03:11.400
It is the expected value of Y - μ², where that μ was the mean of the distribution,
00:03:11.400 --> 00:03:15.200
same as the expected value of the original variable.
00:03:15.200 --> 00:03:27.000
If you want to calculate that, you would multiply y × μ² × the density function F of Y, and calculate an integral.
00:03:27.000 --> 00:03:34.100
Now, that is not usually how you are going to calculate the variance of a continuous distribution.
00:03:34.100 --> 00:03:40.400
This version of the formula is not usually very useful.
00:03:40.400 --> 00:03:50.800
What is usually easier is to calculate this little formula, the expected value of Y² - the expected value of (Y).
00:03:50.800 --> 00:03:55.500
That is just like we had with the discreet distributions.
00:03:55.500 --> 00:04:02.000
It works the exact same way and it is usually easier to calculate that way.
00:04:02.000 --> 00:04:06.000
The way you calculate it, remember the expected value of Y is just the mean,
00:04:06.000 --> 00:04:13.100
which hopefully you already knew or you already calculated before you are worrying about the variance.
00:04:13.100 --> 00:04:21.100
The expected value of Y², what you do is you multiply Y² × the density function, and then you have to integrate that.
00:04:21.100 --> 00:04:26.600
You do have to do an integral but it is usually a simpler one than you would have done,
00:04:26.600 --> 00:04:31.500
if you had calculated this Y - μ² × F of Y.
00:04:31.500 --> 00:04:41.100
This is usually the better way to find the variance of a continuous distribution is, to use this formula down here.
00:04:41.100 --> 00:04:44.100
We will practice that and you will see in the examples.
00:04:44.100 --> 00:04:51.000
We will probably be using this version of the variance formula.
00:04:51.000 --> 00:04:56.200
Usually, it seems to me when the variance problems, with continuous problems,
00:04:56.200 --> 00:05:00.200
you are used to calculating the variance and not often the standard deviation.
00:05:00.200 --> 00:05:04.400
Let me go ahead and give you the formula for standard deviation, because it is very easy.
00:05:04.400 --> 00:05:10.200
It is exactly like the discrete case, if you know the variance, the standard deviation by definition,
00:05:10.200 --> 00:05:12.400
is just the square root of the variance.
00:05:12.400 --> 00:05:16.700
Basically, you just calculate the variance and at the end, if you want standard deviation,
00:05:16.700 --> 00:05:18.900
you calculate the square root of that.
00:05:18.900 --> 00:05:23.600
There is really nothing more and nothing less than that.
00:05:23.600 --> 00:05:29.600
That is possibly why all the problems that you encountered in probability classes just say,
00:05:29.600 --> 00:05:33.800
calculate the variance and I do not even bother to ask you to calculate the standard deviation.
00:05:33.800 --> 00:05:41.900
But if we do ask you to calculate the standard deviation, just calculate the variance first and then take its square root.
00:05:41.900 --> 00:05:43.400
Let us try some examples.
00:05:43.400 --> 00:05:51.200
First example here, it is the same density function that we had in example 3 of the previous video.
00:05:51.200 --> 00:05:55.600
I do not think you really need to understand example 3 of the previous.
00:05:55.600 --> 00:06:01.200
Just in case this looks familiar, this is the density function that you saw before.
00:06:01.200 --> 00:06:08.100
Let Y have the function 1/3 between 0 and 1, 2/3 between 1 and 2.
00:06:08.100 --> 00:06:14.800
That is not a good vertical line at all, I will do a little graph here.
00:06:14.800 --> 00:06:23.900
There is 1, there is 2, and what we have is a density function like that.
00:06:23.900 --> 00:06:30.300
There is our density function and we want to find the expected value of Y.
00:06:30.300 --> 00:06:32.300
We are just going to use the definition of this.
00:06:32.300 --> 00:06:39.900
The expected value of Y is equal to, for any continuous distribution,
00:06:39.900 --> 00:06:47.900
it is equal to the integral from -infinity to infinity of Y × the density function F of Y DY.
00:06:47.900 --> 00:06:58.100
Now, I set the integral from infinity to -infinity but here, there is really no density anywhere outside of the range between 0 and 2.
00:06:58.100 --> 00:07:00.400
I’m just going to integrate from 0 to 2.
00:07:00.400 --> 00:07:05.700
And then, I'm going to break it up from 0 to 1 and 1 to 2 because
00:07:05.700 --> 00:07:09.100
we have two different density functions on those two ranges.
00:07:09.100 --> 00:07:20.600
It is Y × 1/3 DY from 0 to 1 and Y × 2/3 DY from 1 to 2.
00:07:20.600 --> 00:07:26.200
Those are both easy integrals, in fact, you know I'm going to pull out 1/3 from everything because
00:07:26.200 --> 00:07:32.200
that just makes me have to write now less fractions, fewer fractions.
00:07:32.200 --> 00:07:37.600
The integral of Y DY is Y²/2.
00:07:37.600 --> 00:07:41.300
I have to write with that from 0 to 1.
00:07:41.300 --> 00:07:45.200
The integral of 2Y DY is just Y².
00:07:45.200 --> 00:07:52.200
I have to evaluate that from 1 to 2.
00:07:52.200 --> 00:08:12.000
I will keep going here, 1/3 Y²/2, when Y is 1 is 1, Y0 is nothing, + Y² from 1 to 2 is 2² is 4 -1² is 1, 7 + 4 - 1 is 3.
00:08:12.000 --> 00:08:23.800
My mistake, the Y²/2 should have been a ½ not 1, when I plug in Y = 1 before.
00:08:23.800 --> 00:08:31.600
I get 1/3 × 3 1/2 is 7/2.
00:08:31.600 --> 00:08:38.700
I get my expected value of that distribution is 7/6.
00:08:38.700 --> 00:08:44.800
By the way, we can check this, you will get at least an approximate check, if we look at the graph.
00:08:44.800 --> 00:08:55.300
If you look at this graph up here, you will notice that most of the density is concentrated over there between 1 and 2.
00:08:55.300 --> 00:09:03.800
What we found here is that the mean or the expected value is just a little bit bigger than 1, about 1/6.
00:09:03.800 --> 00:09:05.600
It is about right there.
00:09:05.600 --> 00:09:09.100
That is kind of the balancing point of that function.
00:09:09.100 --> 00:09:16.500
It is not surprising that it is a little bit bigger than 1 because there is a little more area to the right of 1 than to the left of 1.
00:09:16.500 --> 00:09:22.500
Our average there or expected value μ = 7/6.
00:09:22.500 --> 00:09:27.400
To recap the steps there, I just used my definition of expected value.
00:09:27.400 --> 00:09:32.300
The integral of Y × the density function F of Y.
00:09:32.300 --> 00:09:37.700
I have to split that up into two different ranges, the range from 0 to 1 and the range from 1 to 2.
00:09:37.700 --> 00:09:46.800
Factor the 1/3 out of everything and I dropped in my two different functions for the density functions.
00:09:46.800 --> 00:09:56.400
Factor out a 1/3, did a couple of easy integrals, plug in the values, the limits, and simplify it down to a number of 7/6.
00:09:56.400 --> 00:10:00.400
When I got that number, it really was a surprise looking at the graph because
00:10:00.400 --> 00:10:08.000
it seem to balance a bit bigger than 1 because more of the area is concentrated bigger than 1 there.
00:10:08.000 --> 00:10:13.700
Let us move on, example 2, we got θ1 and θ2 are constants.
00:10:13.700 --> 00:10:21.200
I guess θ2 is the bigger one, I will go ahead and graph this, as we introduce the problem.
00:10:21.200 --> 00:10:25.000
There is θ1 and there is θ2.
00:10:25.000 --> 00:10:33.500
And then, we are going to consider the uniform density function F of Y is just the constant 1/θ2 – θ1.
00:10:33.500 --> 00:10:36.300
It was just constant because there is no Y in there.
00:10:36.300 --> 00:10:41.200
From Y going from θ1 to θ2.
00:10:41.200 --> 00:10:43.400
There is our density function.
00:10:43.400 --> 00:10:48.300
By assumption, that means that it is 0 everywhere else.
00:10:48.300 --> 00:10:53.700
That is our density function, our density is uniformly distributed.
00:10:53.700 --> 00:10:56.700
We will talk more about the uniform distribution, later on.
00:10:56.700 --> 00:11:04.700
We have us some more videos that you will see, if you scroll down about to the different continuous distributions,
00:11:04.700 --> 00:11:07.100
the continuous probability distributions.
00:11:07.100 --> 00:11:13.300
Uniform will be one of them, this is kind of a warm up to that video later on.
00:11:13.300 --> 00:11:18.900
The value here is the constant value 1/θ2 – θ1.
00:11:18.900 --> 00:11:24.100
By the way, it has to be that constant value, in order to make the total area equal to 1.
00:11:24.100 --> 00:11:30.500
Because the width is θ2 – θ1, that means the height must be 1/θ2 – θ1.
00:11:30.500 --> 00:11:36.700
You have to know that, that is the constant value there, if it is going to be constant.
00:11:36.700 --> 00:11:41.100
Let us find E of Y.
00:11:41.100 --> 00:11:47.100
Μ is our expected value, or mean of our distribution.
00:11:47.100 --> 00:11:58.900
E of Y, now I'm going to use again, the generic formula for expected value of -infinity to infinity of Y F of Y DY.
00:11:58.900 --> 00:12:07.100
In this case, the only place where we have positive density is from θ1 to θ2.
00:12:07.100 --> 00:12:13.800
I will fill those in as limits and not worry about everything else, that infinity of Y.
00:12:13.800 --> 00:12:22.300
F of Y is just the constant, it is 1/θ2 – θ1 DY.
00:12:22.300 --> 00:12:25.500
I will pull out our constant out.
00:12:25.500 --> 00:12:28.700
I will just go ahead and do the integral because it is an easy integral.
00:12:28.700 --> 00:12:35.600
Y²/2 × θ2 – θ1.
00:12:35.600 --> 00:12:40.000
I have to evaluate that from θ1 to θ2.
00:12:40.000 --> 00:12:44.300
It is a form the algebra works out with this, stick with me on this.
00:12:44.300 --> 00:12:54.700
I get θ2² – θ1²/2 × θ2 – θ1.
00:12:54.700 --> 00:13:06.700
The numerator factors θ2 + θ1 and θ2 – θ, that is a difference of squares.
00:13:06.700 --> 00:13:11.300
On the bottom, we just get θ2 – θ1.
00:13:11.300 --> 00:13:16.200
That factors cancel and I’m going to write this in a different order.
00:13:16.200 --> 00:13:28.900
I will just write it as θ1 + θ2/2, that is my expected value of the uniform distribution.
00:13:28.900 --> 00:13:37.100
It is nice to work that out arithmetically, but it is also nice to realize that that is a completely intuitive result,
00:13:37.100 --> 00:13:39.200
if you look at the graph.
00:13:39.200 --> 00:13:45.700
Because if you look at the graph, exactly half the area is to the left and exactly half of the area is to the right.
00:13:45.700 --> 00:13:47.400
It is a uniform distribution.
00:13:47.400 --> 00:13:55.400
You are really not surprised at all, to find that the mean is just halfway between θ1 and θ2.
00:13:55.400 --> 00:13:59.600
It is the average of the two values.
00:13:59.600 --> 00:14:02.200
Let me write that a little bigger so you can actually see it.
00:14:02.200 --> 00:14:12.000
Θ1 + θ2/2, it is not surprising at all to get that mean to be halfway between the two endpoints.
00:14:12.000 --> 00:14:16.700
But, because it is uniformly distributed, the density is uniformly distributed, if they were not uniformly distributed,
00:14:16.700 --> 00:14:21.800
we might not expect the mean to fall exactly on the halfway mark.
00:14:21.800 --> 00:14:26.500
But since, it is uniformly distributed, not at all surprising that
00:14:26.500 --> 00:14:32.700
we end up with our mean being just halfway down the middle θ1 + θ2.
00:14:32.700 --> 00:14:35.000
Let me show you how we calculated that quickly.
00:14:35.000 --> 00:14:42.300
Use the definition of the mean or expected value, same thing by the way, of a continuous distribution
00:14:42.300 --> 00:14:49.500
which is the integral from -infinity to infinity of Y × the density function DY.
00:14:49.500 --> 00:15:01.900
Since, our only positive density was between θ1 and θ2, I through away those infinities and just looked at the range from θ1 to θ2.
00:15:01.900 --> 00:15:06.400
I filled in my F of Y is 1/θ2 – θ1.
00:15:06.400 --> 00:15:09.500
That is a constant, it easily comes through the integral.
00:15:09.500 --> 00:15:12.600
The integral of Y is Y²/2.
00:15:12.600 --> 00:15:18.400
Plug in θ2 as Y² and θ1 as Y.
00:15:18.400 --> 00:15:20.900
We get θ2² – θ1².
00:15:20.900 --> 00:15:24.900
It is a nice algebra here, we factored a difference of squares formula.
00:15:24.900 --> 00:15:35.600
We get θ2 – θ1 canceling, we end up with θ1 + θ2/2 which completely confirms the suspicion that I hope you had when I first graph this,
00:15:35.600 --> 00:15:42.300
which is that the mean would come out to be right in the middle, because the density is uniformly distributed.
00:15:42.300 --> 00:15:47.600
In the next example, we are going to calculate the variance of the uniform distribution.
00:15:47.600 --> 00:15:51.000
Part of that calculation, we will be using the mean.
00:15:51.000 --> 00:15:56.300
I want you to remember this mean.
00:15:56.300 --> 00:16:07.000
We will just plug it right in, when we get to the right point in the formula for the variance on the next problem.
00:16:07.000 --> 00:16:11.700
In example 3 here, it is kind of a continuation of example 2.
00:16:11.700 --> 00:16:15.700
We are still looking at 2 constant values, θ1 and θ2.
00:16:15.700 --> 00:16:22.600
We have the uniform density function between θ1 and θ2.
00:16:22.600 --> 00:16:24.400
We are finding the variance.
00:16:24.400 --> 00:16:28.300
In example 2, we found the expected value E of Y.
00:16:28.300 --> 00:16:29.600
Now, we are finding V of Y.
00:16:29.600 --> 00:16:35.400
We are going to be using the answer from example 2 in examples 3.
00:16:35.400 --> 00:16:41.000
If you did not just watch example 2, if you are just joining us for today for example 3,
00:16:41.000 --> 00:16:46.300
you really want to go back and watch example 2, and make sure you understand the answer to example 2.
00:16:46.300 --> 00:16:51.200
We will be using it at a key step here in examples 3.
00:16:51.200 --> 00:16:54.300
For example 3, we want to find the variance.
00:16:54.300 --> 00:17:00.800
The first step of that is to find the expected value of Y².
00:17:00.800 --> 00:17:11.700
By definition, that means the integral from -infinity to infinity of Y² F of Y DY.
00:17:11.700 --> 00:17:19.000
Just like in example 2, the only range we have here for Y is θ1 to θ2.
00:17:19.000 --> 00:17:23.300
Everywhere else, we can assume that the density function is 0.
00:17:23.300 --> 00:17:34.200
I'm going to cut off those infinities and just integrate from θ1 to θ2.
00:17:34.200 --> 00:17:40.000
My Y², my F of Y is 1/θ2 – θ1.
00:17:40.000 --> 00:17:44.400
Those are all constants, 1/θ2 – θ1 DY.
00:17:44.400 --> 00:17:54.000
That is a pretty easy integral, I get Y³/3 is the integral of Y².
00:17:54.000 --> 00:17:59.600
I still have that constant θ2 – θ1.
00:17:59.600 --> 00:18:06.000
I'm integrating this from Y = θ1 to Y = θ2.
00:18:06.000 --> 00:18:07.800
Let me plug those in.
00:18:07.800 --> 00:18:16.900
Θ2³ – θ1³/3 × θ2 – θ1.
00:18:16.900 --> 00:18:26.400
Just like in example 2, there is a really nice algebra that works out here, if you remember your difference of cubes formula.
00:18:26.400 --> 00:18:30.000
In example 2 was, the difference of squares formula which everybody remembers.
00:18:30.000 --> 00:18:38.500
In example 3, it is the difference of cubes formula which is not quite as well known, it is θ2 – θ1.
00:18:38.500 --> 00:18:41.600
I will remind you A³ – B³.
00:18:41.600 --> 00:18:53.800
A² + AB, not 2AB, + B².
00:18:53.800 --> 00:18:56.900
That is the difference of cubes formula.
00:18:56.900 --> 00:19:02.800
I will write that up here because you might not be so familiar, people who are a little rusty on algebra.
00:19:02.800 --> 00:19:09.800
A - B × A² + AB + B².
00:19:09.800 --> 00:19:12.800
That is what I use right here to factor this.
00:19:12.800 --> 00:19:19.700
That is really nice because in the denominator, we also have θ2 – θ1.
00:19:19.700 --> 00:19:35.200
Those cancel, E of Y² here is equal to θ2² + θ1 θ2 + θ1².
00:19:35.200 --> 00:19:38.500
Let me switch the roles of θ1 and θ2.
00:19:38.500 --> 00:19:43.800
I will write θ1² + θ1 θ2 + θ2².
00:19:43.800 --> 00:19:47.400
That will be a little easier to keep track of in the next step.
00:19:47.400 --> 00:19:51.100
I did say there is a next step, we have not yet found the variance.
00:19:51.100 --> 00:19:55.600
Let me remind you that there is a 2 step procedure for finding the variance.
00:19:55.600 --> 00:20:15.200
The variance of Y which is the same as σ² is always the expected value of Y² - the expected value of (Y)².
00:20:15.200 --> 00:20:30.600
We figure out the expected value of Y² right here, it is θ1² + θ1 θ2 + θ2² ÷ 3.
00:20:30.600 --> 00:20:34.600
The expected value of Y, we figured this out in example 2.
00:20:34.600 --> 00:20:37.000
That is why I said go back and watch example 2.
00:20:37.000 --> 00:20:41.500
Let me remind you of the answer from example 2, I will not work it out again.
00:20:41.500 --> 00:20:50.600
But example 2, we figured out that E of Y is θ1 + θ2/2.
00:20:50.600 --> 00:20:57.700
That is not surprising for the uniform distribution because you just get the average of the 2 endpoints.
00:20:57.700 --> 00:21:03.500
Let me plug that in, θ1 + θ2/2.
00:21:03.500 --> 00:21:06.400
We want to square that whole thing.
00:21:06.400 --> 00:21:12.000
I accidentally changed my - to +.
00:21:12.000 --> 00:21:16.900
Let me quickly correct that before anybody notices.
00:21:16.900 --> 00:21:25.000
Let me expand this θ1 + θ2² because we are going to do some algebra and combine this.
00:21:25.000 --> 00:21:29.300
This is going to work out really nicely, I practiced this and it worked out just great.
00:21:29.300 --> 00:21:43.800
This is θ1² + 2θ1 θ2 + θ2²/4 because we have to square both top and bottom here.
00:21:43.800 --> 00:21:49.800
We want to combine these two, it looks like it is going to be really messy but it will simplify nicely, I promise.
00:21:49.800 --> 00:21:52.000
I have a common denominator, I got a 3 and 4.
00:21:52.000 --> 00:21:59.800
My common denominator is going to be a 12 and that means I have to multiply the first set of terms by 4.
00:21:59.800 --> 00:22:01.000
I will go ahead and do that.
00:22:01.000 --> 00:22:10.600
4 θ1² + 4 θ1 θ2 + 4 θ2².
00:22:10.600 --> 00:22:15.300
The next sets of terms are all negative and I need to multiply them all by 3.
00:22:15.300 --> 00:22:27.800
-3 θ1² – 3 × 2 is 6 θ1 θ2 – 2 θ2².
00:22:27.800 --> 00:22:35.300
I did not multiply that by 3, not a 2 there but 3 θ2².
00:22:35.300 --> 00:22:38.600
I can simplify this down, I get 4.
00:22:38.600 --> 00:22:44.000
Θ1² – 3 θ1², I got θ1² σ of θ1².
00:22:44.000 --> 00:23:00.200
4 θ1 θ2 – 6 θ1 θ2 – 2 θ1 θ2 + θ2²/12.
00:23:00.200 --> 00:23:11.300
What you will notice is that numerator is exactly the perfect square of either θ1 - θ2 or θ2 – θ1.
00:23:11.300 --> 00:23:16.200
I’m going to say θ2 – θ1.
00:23:16.200 --> 00:23:22.000
It does not matter but I like that, because I have been told that θ1 is less than θ2.
00:23:22.000 --> 00:23:24.500
Θ2- θ1 is positive, let us keep it positive.
00:23:24.500 --> 00:23:42.900
Θ2 – θ1²/12 is my variance, that is quite a nice formula.
00:23:42.900 --> 00:23:45.300
I like the fact that it simplifies that way.
00:23:45.300 --> 00:23:50.800
Unlike the mean, the answer from example 2, I do not think the variance is totally obvious.
00:23:50.800 --> 00:23:58.200
I could not have just look at that and told you off the top of my head that that was going to be the variance.
00:23:58.200 --> 00:24:07.100
It is not totally surprising because it is dependent on the distance from θ1 to θ2.
00:24:07.100 --> 00:24:10.900
Remember, the variance kind of measures how spread out your distribution is.
00:24:10.900 --> 00:24:15.100
If θ1 and θ2 are far apart, then, we get a bigger variance here.
00:24:15.100 --> 00:24:19.900
That makes intuitive sense but I do not think I could have looked at that and just say,
00:24:19.900 --> 00:24:23.200
it is definitely going to be θ2 – θ1²/12.
00:24:23.200 --> 00:24:24.900
That would not have been so obvious.
00:24:24.900 --> 00:24:28.700
Whereas with the expected value, if you are really on top of your game,
00:24:28.700 --> 00:24:35.600
you could probably eyeball that distribution and say, I know it is going to be θ1 + θ2/2.
00:24:35.600 --> 00:24:38.600
Let me show you the steps that we use for that.
00:24:38.600 --> 00:24:42.200
We started out finding E of Y².
00:24:42.200 --> 00:24:51.300
The reason I did that was because I was looking forward to this formula for the variance, E of Y² – E of (Y)².
00:24:51.300 --> 00:24:53.800
I’m going to find me E of (Y)² first.
00:24:53.800 --> 00:25:00.000
By definition, that is Y² × the density function and we will integrate that.
00:25:00.000 --> 00:25:03.800
The range we want to integrate on is θ1 and θ2.
00:25:03.800 --> 00:25:07.600
The density function is just this constant 1/θ2 – θ1.
00:25:07.600 --> 00:25:19.000
That integrates easily Y² integrates to Y³/3, drop in the values of θ, the values of Y at the endpoints.
00:25:19.000 --> 00:25:25.700
Using this nice difference of cubes formula, it expands out and cancels.
00:25:25.700 --> 00:25:29.900
We get θ2 – θ1 canceling from the top and bottom.
00:25:29.900 --> 00:25:35.700
We get a fairly nice little expression for the expected value of Y².
00:25:35.700 --> 00:25:42.100
But that is not the variance yet, you have to subtract off the expected value of (Y)².
00:25:42.100 --> 00:25:49.400
And the expected value of Y is what we figure out in example 2, that is θ1 + θ2/2.
00:25:49.400 --> 00:25:53.000
That is where I’m getting this from.
00:25:53.000 --> 00:25:58.900
Because I want to put everything over a common denominator, I expanded this out.
00:25:58.900 --> 00:26:03.600
It is quite a mess here, especially when we put it over a common denominator of 12,
00:26:03.600 --> 00:26:12.300
and in particular, it simplify down to this very nice formula θ2 – θ1²/12.
00:26:12.300 --> 00:26:19.100
I could have said θ1 – θ2² as well, but I use θ2 – θ1 because that will be a positive number,
00:26:19.100 --> 00:26:22.500
that is because θ2 is the bigger one.
00:26:22.500 --> 00:26:24.900
That is the variance of the uniform distribution.
00:26:24.900 --> 00:26:28.000
We are going to do a whole video on the uniform distribution later on,
00:26:28.000 --> 00:26:31.300
if you just scroll down you should be able to see that.
00:26:31.300 --> 00:26:41.800
You will see that we will be using this mean and variance, that we worked out here in examples 2 and 3.
00:26:41.800 --> 00:26:44.200
Let us look at example 4 here.
00:26:44.200 --> 00:26:52.900
We have Y has density function ½ × 2 - Y on the range 0 to 2, and 0 elsewhere.
00:26:52.900 --> 00:26:55.600
We want to find the expected value of Y.
00:26:55.600 --> 00:27:00.700
In example 5, we are going to keep going with the same random variable.
00:27:00.700 --> 00:27:03.900
We will find the variance of Y.
00:27:03.900 --> 00:27:08.900
You want to make sure that you watch these two examples in tandem because
00:27:08.900 --> 00:27:12.100
we are going to be using the results from one in the next one.
00:27:12.100 --> 00:27:15.600
Let us find the expected value of Y.
00:27:15.600 --> 00:27:23.700
The expected value of Y by definition, remember, it is always the integral from -infinity to infinity of Y ×
00:27:23.700 --> 00:27:27.000
the density function f of Y DY.
00:27:27.000 --> 00:27:35.900
In this case, I do not need to integrate from infinity to infinity because the only place where the density is positive is from 0 to 2.
00:27:35.900 --> 00:27:39.800
I’m just going to integrate from 0 to 2 of Y.
00:27:39.800 --> 00:27:46.300
I will fill in the density function ½ × 2 – Y DY.
00:27:46.300 --> 00:27:50.200
I think I will distribute that to make it a little easier to integrate.
00:27:50.200 --> 00:27:59.800
Y × ½ × 2 is just Y – Y × ½ × Y.
00:27:59.800 --> 00:28:04.700
That is ½ Y², just distributing those.
00:28:04.700 --> 00:28:22.000
I cannot put off the calculus any longer, integrate those, I get Y²/2 - the integral of Y² is Y³/3 × ½ is Y³/6.
00:28:22.000 --> 00:28:28.300
I need to evaluate that from Y = 0 to Y = 2.
00:28:28.300 --> 00:28:39.600
I will plug those values in, I get 2²/2 is 4/2 is 2 – Y³/6 is 8/6.
00:28:39.600 --> 00:28:59.700
That is 2 - 4/3 and that is 2 and 6/3 - 4/3 is 2/3.
00:28:59.700 --> 00:29:02.100
That is my answer for the expected value.
00:29:02.100 --> 00:29:06.400
That was fairly straightforward, it came straight out of the definition here.
00:29:06.400 --> 00:29:17.700
The expected value of a random variable is, you integrate Y × the density function from -infinity to infinity.
00:29:17.700 --> 00:29:24.000
But in practice, you end up integrating your density function is defined to be positive.
00:29:24.000 --> 00:29:28.900
That is on this range right here 0 to 2 because everywhere else, it is 0.
00:29:28.900 --> 00:29:34.400
Let me integrate Y ×, I just plug in the densely function from here.
00:29:34.400 --> 00:29:39.500
I do not need to worry about the region on which it is 0.
00:29:39.500 --> 00:29:46.200
Plug that in, distribute the terms to make it easier to integrate, do a little integral,
00:29:46.200 --> 00:29:50.200
drop in the numbers and I get my expected value of 2/3.
00:29:50.200 --> 00:29:54.000
You want to hang onto this value for the next example.
00:29:54.000 --> 00:30:00.900
In example 5, we are going to come back to the same density function and we are going to calculate the variance.
00:30:00.900 --> 00:30:06.000
Remember, a key step in calculating the variance is using the expected value.
00:30:06.000 --> 00:30:13.600
Remember this value of 2/3, we are going to use it again in the next example.
00:30:13.600 --> 00:30:18.000
In example 5, we are looking at the same density function that we had in example 4,
00:30:18.000 --> 00:30:24.900
F of Y is ½ × 2 – Y on the range from 0 to 2, and at 0 everywhere else.
00:30:24.900 --> 00:30:27.200
We want to find the variance.
00:30:27.200 --> 00:30:31.900
Let me remind you of the useful way to calculate the variance.
00:30:31.900 --> 00:30:42.300
The variance is E of Y² – E of (Y)².
00:30:42.300 --> 00:30:49.900
What we will do first is we will calculate E of (Y)², and then we will come back and + it into this formula.
00:30:49.900 --> 00:30:54.700
E of Y², by itself here, I’m not calculating the whole variance yet.
00:30:54.700 --> 00:30:57.200
I’m just finding E of Y².
00:30:57.200 --> 00:31:08.500
By definition, that is the integral from -infinity to infinity of Y² × whatever density function we have for this variable.
00:31:08.500 --> 00:31:14.000
In this case, our density function is 0 everywhere outside the range is 0 to 2.
00:31:14.000 --> 00:31:18.900
I just need to integrate from 0 to 2 Y².
00:31:18.900 --> 00:31:28.300
We look at that density function is ½ × 2 – Y DY, that is the integral from 0 to 2.
00:31:28.300 --> 00:31:36.600
If I distribute that Y² and ½, Y² × ½ × 2 is just Y².
00:31:36.600 --> 00:31:43.300
And then, Y² × ½ × Y is ½ Y³.
00:31:43.300 --> 00:31:47.500
I have to integrate all that with respect to Y.
00:31:47.500 --> 00:31:53.100
My integral is, Y² integrates to Y³/3.
00:31:53.100 --> 00:31:59.100
Y³ integrates to Y⁴/4, but I also got a ½ here.
00:31:59.100 --> 00:32:03.100
I have to make that Y⁴/8.
00:32:03.100 --> 00:32:13.700
I want to integrate all of that from 0 to 2, Y = 2.
00:32:13.700 --> 00:32:24.200
I get to Y³/3 that is 8/3 – y⁴/8 that is 16/8.
00:32:24.200 --> 00:32:28.000
If I plug in 0 nothing happens there, I do not need to worry about that.
00:32:28.000 --> 00:32:40.400
That is 8/3 -2, 2 is 6/3, the expected value Y² is just 2/3.
00:32:40.400 --> 00:32:44.700
That is not the answer to the problem yet, we are supposed to find the variance.
00:32:44.700 --> 00:32:48.600
The expected value of Y² is just one step in finding the variance.
00:32:48.600 --> 00:32:50.400
Here is the rest of it.
00:32:50.400 --> 00:32:55.500
E of Y² is 2/3, we just calculated that.
00:32:55.500 --> 00:33:01.500
The expected value of Y, I would have to do another whole calculation to find that.
00:33:01.500 --> 00:33:05.300
But I did that calculation in example 4, I hope you did it with me.
00:33:05.300 --> 00:33:13.500
If you have not watched example 4, now is the time when we are using the answer.
00:33:13.500 --> 00:33:21.200
It came out to be the same thing, it was 2/3 by example 4.
00:33:21.200 --> 00:33:25.700
That is really coincidence, the fact that it came out to be the same as E of Y².
00:33:25.700 --> 00:33:32.600
I would not put too much stock in the fact that those numbers came out to be the same.
00:33:32.600 --> 00:33:37.700
It is not going to happen usually, there is no sort of property that made those the same.
00:33:37.700 --> 00:33:40.600
It is just the way that the integrals worked out.
00:33:40.600 --> 00:33:49.000
This is to 2/3 - E of Y², -2/3².
00:33:49.000 --> 00:33:57.000
This is 2/3 – 4/9, 2/3 is 6/9.
00:33:57.000 --> 00:34:06.800
Multiply top and bottom by 3 - 4/9 and I finally get my answer here for the variance is 2/9,
00:34:06.800 --> 00:34:15.500
the variance of this random variable.
00:34:15.500 --> 00:34:21.400
In case you are a little fuzzy on any of the steps, let us check those out again.
00:34:21.400 --> 00:34:28.800
My generic formula for the variance is always E of Y² – E of (Y)².
00:34:28.800 --> 00:34:33.200
The E of Y by itself, I figure it out in example 4.
00:34:33.200 --> 00:34:36.600
You can go back and see the video in example 4, where that came from.
00:34:36.600 --> 00:34:41.300
We figure out that it was 2/3, that is where I dropped that in for E of Y.
00:34:41.300 --> 00:34:43.700
This E of Y² takes more work.
00:34:43.700 --> 00:34:50.400
E of Y², we actually have to calculate that using an integral of Y² × the density function.
00:34:50.400 --> 00:34:56.200
I put in Y², I put in the density function that came from right here.
00:34:56.200 --> 00:35:05.500
These bounds from 0 to 2 that came from these limits right here, because everywhere else the function is 0.
00:35:05.500 --> 00:35:10.000
I really only need to do my integral from 0 to 2.
00:35:10.000 --> 00:35:18.200
Once I got in that form, it is relatively easy algebra to distribute the terms to do the calculus there.
00:35:18.200 --> 00:35:25.100
It is just the power rule, drop in the limits 0 and 2, and simplify it down to 2/3.
00:35:25.100 --> 00:35:31.600
That 2/3 gives me that 2/3 for E of Y².
00:35:31.600 --> 00:35:34.900
The other 2/3 came from E of Y, that was from example 4.
00:35:34.900 --> 00:35:38.100
It is really a coincidence that those numbers were both 2/3.
00:35:38.100 --> 00:35:44.000
That is not any property manifesting itself here, do not read too much into that.
00:35:44.000 --> 00:35:46.900
Those could easily have been different numbers.
00:35:46.900 --> 00:35:50.200
Now, I just simplify the fractions 2/3 - 4/9 simplifies down to 2/9.
00:35:50.200 --> 00:35:56.400
That is my variance for that random variable.
00:35:56.400 --> 00:36:01.800
That wraps up this lecture on mean and variance for continuous distributions.
00:36:01.800 --> 00:36:11.100
This is part of the chapter on continuous probability which is part of our larger lecture series on probability.
00:36:11.100 --> 00:36:16.700
You are watching the probability lectures here on www.educator.com, with your host Will Murray.
00:36:16.700 --> 00:36:18.000
Thank you very much for joining me today, bye.