1
00:00:01,690 --> 00:00:04,890
As an example of a mean-variance
calculation, we

2
00:00:04,890 --> 00:00:07,520
will now consider the continuous
uniform random

3
00:00:07,520 --> 00:00:10,610
variable which we have
introduced a little earlier.

4
00:00:10,610 --> 00:00:13,600
This is the continuous analog
of the discrete uniform, for

5
00:00:13,600 --> 00:00:16,500
which we have already seen
formulas for the corresponding

6
00:00:16,500 --> 00:00:17,800
mean and variance.

7
00:00:17,800 --> 00:00:21,280
So let us now calculate the mean
or expected value for the

8
00:00:21,280 --> 00:00:23,090
continuous case.

9
00:00:23,090 --> 00:00:26,660
The mean is defined as an
integral that ranges over the

10
00:00:26,660 --> 00:00:28,170
entire real line.

11
00:00:28,170 --> 00:00:31,100
On the other hand, we recognize
that the density is

12
00:00:31,100 --> 00:00:36,210
equal to 0 outside the interval
from a to b, and

13
00:00:36,210 --> 00:00:38,740
therefore, there is going to
be no contribution to the

14
00:00:38,740 --> 00:00:42,940
integral from those x's
outside that interval.

15
00:00:42,940 --> 00:00:46,460
This means that we can integrate
just over the

16
00:00:46,460 --> 00:00:49,290
interval from a to b.

17
00:00:49,290 --> 00:00:52,890
And inside that interval, the
value of the density is 1

18
00:00:52,890 --> 00:00:55,110
over b minus a.

19
00:00:55,110 --> 00:00:59,270
We can carry out this
integration and find an answer

20
00:00:59,270 --> 00:01:04,360
equal to a plus b over 2, which,
interestingly, also

21
00:01:04,360 --> 00:01:07,080
happens to be the same as
in the discrete case.

22
00:01:07,080 --> 00:01:11,200
In fact, we could find this
answer without having to run

23
00:01:11,200 --> 00:01:12,789
this integration.

24
00:01:12,789 --> 00:01:17,060
We could just recognize that
this PDF is symmetric around

25
00:01:17,060 --> 00:01:20,030
the midpoint of the interval,
and the midpoint is

26
00:01:20,030 --> 00:01:23,630
a plus b over 2.

27
00:01:23,630 --> 00:01:28,340
We now continue with what is
involved in the calculation of

28
00:01:28,340 --> 00:01:33,310
the expected value of the square
of the random variable.

29
00:01:33,310 --> 00:01:37,620
Using the expected value rule,
this is the integral of x

30
00:01:37,620 --> 00:01:44,720
squared times the density, but
because of the same argument

31
00:01:44,720 --> 00:01:49,490
as before, we only need to
integrate from a to b.

32
00:01:49,490 --> 00:01:53,360
We can evaluate this integral,
and the answer turns out to be

33
00:01:53,360 --> 00:01:59,479
1 over (b minus a) times
(b cube over 3

34
00:01:59,479 --> 00:02:03,010
minus a cube over 3).

35
00:02:03,010 --> 00:02:06,690
The reason why these cubic
terms appear is that the

36
00:02:06,690 --> 00:02:10,440
integral of the x square
function is x

37
00:02:10,440 --> 00:02:13,440
cube divided by 3.

38
00:02:13,440 --> 00:02:16,620
Now that we have this quantity
available, we're ready to

39
00:02:16,620 --> 00:02:21,829
calculate the variance using
this alternative formula,

40
00:02:21,829 --> 00:02:25,650
which, as we have often
discussed, usually provides us

41
00:02:25,650 --> 00:02:29,880
a quicker way to carry
out the calculation.

42
00:02:29,880 --> 00:02:32,930
We take this term,
insert it here.

43
00:02:32,930 --> 00:02:36,270
We take the square of this
term, insert it here.

44
00:02:36,270 --> 00:02:40,610
Carry out some algebra, and
eventually we find an answer

45
00:02:40,610 --> 00:02:46,490
which is equal to b minus
a squared over 12.

46
00:02:46,490 --> 00:02:50,140
And this is the formula for
the variance of a uniform

47
00:02:50,140 --> 00:02:52,650
random variable.

48
00:02:52,650 --> 00:02:56,550
We can take the square root of
this expression to find the

49
00:02:56,550 --> 00:02:59,750
standard deviation, and the
standard deviation is going to

50
00:02:59,750 --> 00:03:05,820
be b minus a divided by
the square root of 12.

51
00:03:05,820 --> 00:03:07,830
A few observations.

52
00:03:07,830 --> 00:03:11,350
First, the formula looks quite
similar to the formula for the

53
00:03:11,350 --> 00:03:14,040
variance that we had in the
discrete case, except that in

54
00:03:14,040 --> 00:03:16,579
the discrete case, we
have this extra

55
00:03:16,579 --> 00:03:20,440
additive factor of 2.

56
00:03:20,440 --> 00:03:23,500
More interestingly, and perhaps
more important, is

57
00:03:23,500 --> 00:03:28,000
that the standard deviation is
proportional to the width of

58
00:03:28,000 --> 00:03:29,370
this uniform.

59
00:03:29,370 --> 00:03:32,420
The wider it is, the
larger the standard

60
00:03:32,420 --> 00:03:33,860
deviation will be.

61
00:03:33,860 --> 00:03:37,100
And this conforms to our
intuition that the standard

62
00:03:37,100 --> 00:03:41,660
deviation captures the width of
a particular distribution.

63
00:03:41,660 --> 00:03:44,190
And the variance, of course,
becomes larger when

64
00:03:44,190 --> 00:03:45,710
the width is larger.

65
00:03:45,710 --> 00:03:48,540
And as far as the variance is
concerned, it increases with

66
00:03:48,540 --> 00:03:51,670
the square of the length of
the interval over which we

67
00:03:51,670 --> 00:03:52,920
have our distribution.