 This is a video about the continuous uniform distribution, also known as the rectangular distribution. You can see why it has these names from the graph of its probability density function. The probability density is uniform, i.e. constant, across a range of values. An overall graph looks like a rectangle. Now there are various things that you should know and understand about the continuous uniform distribution. The first is its probability density function. Now let's look at the graph again. It's normal to say that the minimum possible value of the random variable is alpha, and the maximum possible value is beta. In that case we can work out the probability density function by remembering that the total area under the graph must be 1. Well the width of this rectangle is beta minus alpha. So therefore if the total area is going to be 1, the height must be 1 over beta minus alpha. So this is the height of the rectangle. And therefore the probability density function must be 1 over beta minus alpha, when x is between alpha and beta, and 0 otherwise. The second thing that you should understand about the continuous uniform distribution is its mean. If you think about the graph of the probability density function, it's obviously symmetrical. And therefore the mean is bound to be halfway between alpha and beta. So the mean is a half of alpha plus beta, because that's the number that's halfway between alpha and beta. You might also be expected to derive this algebraically. And then we should say that the mean, which is the expected value of x, is the integral of x f of x over all possible values of x. The integral of x times the probability density function evaluated over all possible values of x. Well the probability density function remember was just 1 over beta minus alpha between alpha and beta. So this is the integral of x times 1 over beta minus alpha evaluated between alpha and beta. When you integrate that you get a half of x squared over beta minus alpha with limits alpha and beta. And that's a half of beta squared minus a half of alpha squared over beta minus alpha. Or more simply a half of beta squared minus alpha squared over beta minus alpha. At this stage you may be wondering that this looks a lot more complicated than the previous answer. But remember that beta squared minus alpha squared is a difference of two squares. And therefore that's the same as beta minus alpha times beta plus alpha. And so in fact the numerator here is divisible by the denominator. Beta squared minus alpha squared over beta minus alpha is simply beta plus alpha. So this can be simplified to a half of beta plus alpha. A third thing that you should understand is the variance of a continuous uniform distribution. Now to work out the variance we need to find the expected value of x squared. And that's going to be the integral of x squared over beta minus alpha evaluated with limits alpha and beta. And that's a third of x cubed over beta minus alpha with limits alpha and beta. i one third of beta cubed minus one third of alpha cubed over beta minus alpha. And you can simplify that to a third of beta cubed minus alpha cubed over beta minus alpha. Now again the numerator here is actually divisible by the denominator. And if you do the division you'll get the answer one third of beta squared plus beta alpha plus alpha squared. So now we know that the expected value of x squared is a third of beta squared plus beta alpha plus alpha squared. And so we can work out the variance. The variance remember is the expected value of x squared take away the square of the mean. So that's a third of beta squared plus beta alpha plus alpha squared take away the square of a half of beta plus alpha. So squaring that bracket we've got a third of beta squared plus beta alpha plus alpha squared minus a quarter of beta squared plus two beta alpha plus alpha squared. To simplify this we really need a common denominator and the best common denominator is 12. So we can say that this is a 12th of four lots of beta squared plus beta alpha plus alpha squared minus three lots of beta squared plus two beta alpha plus alpha squared. And multiplying out these brackets we've got a 12th of four beta squared from the first bracket and minus three beta squared from the second bracket. Plus four beta alpha from the first bracket and minus six beta alpha from the second bracket. Plus four alpha squared from the first bracket and minus three alpha squared from the second bracket. And you can see that that simplifies to a 12th of beta squared minus two beta alpha plus alpha squared. And happily we can simplify this even further because beta squared minus two beta alpha plus alpha squared is simply the square of beta minus alpha. So the final answer, the variance of x is a 12th of the square of beta minus alpha. Now please remember, these formulae for the expected value of x and the variance of x are both in your formula book. But you can be expected to prove these results. So you need to know how these calculations work. Okay, the next thing that you need to understand is the cumulative distribution function for a random variable with the continuous uniform distribution. But it's easy to see what this is by thinking of the graph of the probability density function. The cumulative distribution function, remember, tells you the cumulative probability. And that's the area under the graph. So f of x is simply the area under the graph of the probability density function up to x. And that's the area of this rectangle. Well the width of it is x minus alpha, and the height is 1 over beta minus alpha. So therefore the area is x minus alpha over beta minus alpha. So therefore we can say that the cumulative distribution function is given by f of x equals 0 when x is less than alpha, x minus alpha over beta minus alpha when x is between alpha and beta, and 1 when x is greater than beta. Okay so we've now established a variety of results about the continuous uniform distribution. Let's just summarize. First of all we've seen that the probability density function is given by 1 over beta minus alpha when x is between alpha and beta and 0 otherwise. The cumulative distribution function is given by f of x is 0 when x is less than alpha, x minus alpha over beta minus alpha when x is between alpha and beta, and 1 when x is greater than beta. The mean is a half of alpha plus beta, and the variance is a 12th of the square of beta minus alpha. We can add to this list the fact that the median is the same as the mean, and that's obvious because the probability density function is symmetrical. And finally there's no mode because the probability density is the same everywhere. There's no value of x with the highest probability density. Okay so these are all results that you should be able to prove and use. We've proved them all. Now let's look at some examples which use them. Here's my first example. Suppose we have a continuous random variable x which is uniformly distributed on the interval 1.25 to 1.35. Let's find the mean and variance of x. Well in this case alpha is 1.25 and beta is 1.35. The mean will be a half of 1.25 plus 1.35 which is 1.3. That's probably obvious anyway because remember the mean is going to be half way between 1.25 and 1.35. The variance will be a 12th of the square of 1.35 take away 1.25. So that's a 12th times 0.1 squared which is 1 over 1200. So that's the variance. Here's my second example. Suppose that the random variable x has the continuous uniform distribution with mean 14 and standard deviation root 3. The question is to find the probability that x is less than or equal to 12. Well first of all we need to find out what alpha and beta are. Well the mean is 14 and the variance is 3. The fact that the mean is 14 means that a half of beta plus alpha is 14. Because remember the mean is half of beta plus alpha. Similarly the fact that the variance is 3 means that a 12th of the square of beta minus alpha is 3. Because remember that the variance is the 12th of the square of beta minus alpha. Now as a half of beta plus alpha is 14 beta plus alpha must be 28 And as a 12th of the square of beta minus alpha is 3, the square of beta minus alpha must be 36, and beta minus alpha must be 6. Okay, so you can see that we've now got simultaneous equations for beta and alpha. If you add them together, you get 2 beta equals 34, which shows us that beta is 17. And now if we substitute that into the earlier equation, we can say that 17 plus alpha is 28, and therefore that alpha is 11. Okay, you might have been able to work that out earlier, because remember the mean is 14, and we've discovered that the width of the interval is 6. So what we're looking for is the end points of the interval, whose midpoint is 14, and whose width is 6. And you can probably tell that those would be 11 and 17. Anyway, we've now discovered that alpha is 11 and beta equals 17. And having done that, we've got various ways of working out the probability that x is less than or equal to 12. One way is to look at the cumulative distribution function. When x is between 11 and 17, this is going to be equal to x minus 11 over 17 minus 11. Well, the probability that x is less than or equal to 12 is simply f of 12, because remember that f tells you the cumulative probabilities. So putting 12 into the above formula, we get 12 minus 11 over 17 minus 11, which is a sixth. So that must be the probability. Another way is to think of the graph of the probability density function. We have to find this area. Well, the height of the graph must be a sixth, because the width going from 11 up to 17 is 6. So the height must be a sixth in order to make the total area 1. And once we know the height of this graph, a sixth, it's easy to work out the area of the red rectangle. We simply have to multiply the width by the height. So we have to do 1 times a sixth, which is obviously a sixth. OK, one more example, and this one's going to be about the channel tunnel. Since the channel tunnel was built, there have been three major fires in one of the tunnels. Fortunately, none of them involving any Eurostar trains. They've all involved trains carrying heavy goods vehicles, and fortunately no one has died as a result. But because of the possibility of fire, the tunnels are equipped with access tunnels through which people can escape if necessary. The tunnels are spaced 375 meters apart, all the way along the channel tunnel. So let's suppose that a train has broken down somewhere in the channel tunnel and needs to be evacuated. Let's try and write down the probability density function for x, a passenger's distance in meters from the nearest access tunnel. And then let's find the upper quartile for x. Well, first of all, x is going to have the continuous uniform distribution because the probability density is going to be the same for all possible distances away from the tunnel. The train isn't more likely to break down at any one distance away from a tunnel as any other. So all we need to think about is what's the minimum possible distance from a tunnel and what's the maximum possible distance. Well, the minimum possible distance is obviously zero because the passenger might be really lucky and the train could break down with the passenger right next to an access tunnel. The maximum possible distance is going to be halfway between the tunnels because in the worst case, the passenger will be exactly halfway between two access tunnels. So the maximum possible distance will be 375 meters divided by 2, which is 187.5 meters. OK, well, now we know the minimum and the maximum possible values. It's easy to write down the probability density function. 1 over beta minus alpha, in this case, will be 1 over 187.5 take away 0, which is 2 over 375. OK, so now we can say what the probability density function is. f of x is going to be 2 over 375 when x is between 0 and 187.5 and 0 otherwise. OK, the last thing is to work out the upper quartile of x. And the easiest way to do this is to think of the graph of the probability density function. We need the area under the graph to be three quarters because that should be the cumulative probability at the upper quartile. The upper quartile is the place where the cumulative probability is three quarters. So we need the red area in the picture to be three quarters. But as the probability distribution is uniform, x will simply be three quarters of the way up to 187.5. So x is simply three quarters of 187.5, which is 141 to three significant figures. OK, that's almost the end of my video about the continuous uniform distribution. Let's just summarise by remembering the key things that you need to understand. First of all, the probability density function, which is 1 over beta minus alpha when x is between alpha and beta. Secondly, the cumulative distribution function, which is 0 when x is less than alpha, x minus alpha over beta minus alpha when x is between alpha and beta, and 1 when x is greater than beta. You need to understand that the mean is equal to a half of alpha plus beta and that the variance is a 12th of the square of beta minus alpha. You need to understand why the median is the same as the mean and there's no mode. OK, that is the end of my video on the continuous uniform distribution. I hope you find it helpful. Thank you very much for listening.