WEBVTT

00:00:00.376 --> 00:00:01.130
Hi.

00:00:01.130 --> 00:00:04.830
In this problem, we'll get a
chance to see the usefulness

00:00:04.830 --> 00:00:07.880
of conditioning in helping us
to calculate quantities that

00:00:07.880 --> 00:00:10.440
would otherwise be difficult
to calculate.

00:00:10.440 --> 00:00:13.330
Specifically, we'll be using
the law of iterated

00:00:13.330 --> 00:00:16.120
expectations and the law
of total variance.

00:00:16.120 --> 00:00:18.800
Before we get started, let's
just take a quick moment to

00:00:18.800 --> 00:00:21.120
interpret what these two
laws are saying.

00:00:21.120 --> 00:00:23.980
Really, what it's saying is,
in order to calculate the

00:00:23.980 --> 00:00:26.980
expectation or the variance of
some random variable x, if

00:00:26.980 --> 00:00:29.810
that's difficult to do,
we'll instead attack

00:00:29.810 --> 00:00:31.490
this problem in stages.

00:00:31.490 --> 00:00:34.500
So the first stage is, we'll
condition on some related

00:00:34.500 --> 00:00:35.980
random variable, y.

00:00:35.980 --> 00:00:38.810
And the hope is that by
conditioning on this and

00:00:38.810 --> 00:00:42.200
reducing it to this conditional
universe, the

00:00:42.200 --> 00:00:45.900
expectation of x will be
easier to calculate.

00:00:45.900 --> 00:00:49.060
Now, recall that this
conditional expectation is

00:00:49.060 --> 00:00:52.535
really a random variable, which
is a function of the

00:00:52.535 --> 00:00:53.910
random variable y.

00:00:53.910 --> 00:01:02.880
So what we've done is we first
average out x given some y.

00:01:02.880 --> 00:01:05.540
What remains is some new random
variable, which is a

00:01:05.540 --> 00:01:07.190
function of y.

00:01:07.190 --> 00:01:10.250
And now, what we have is
randomness in y, which will

00:01:10.250 --> 00:01:15.895
then average out again to get
the final expectation of x.

00:01:15.895 --> 00:01:19.110
OK, so in this problem, we'll
actually see an example of how

00:01:19.110 --> 00:01:21.130
this plays out.

00:01:21.130 --> 00:01:23.100
One more thing before we get
started that's useful to

00:01:23.100 --> 00:01:26.310
recall is if y is a uniform
random variable, distributed

00:01:26.310 --> 00:01:30.310
between a and b, then the
variance of y is b minus a

00:01:30.310 --> 00:01:33.450
squared over 12, and the
expectation of y is just a

00:01:33.450 --> 00:01:35.852
midpoint, a plus b over 2.

00:01:35.852 --> 00:01:38.310
All right, so let's get started
on the problem.

00:01:38.310 --> 00:01:42.510
So what we have is we have a
stick of some fixed length, l,

00:01:42.510 --> 00:01:45.600
and what we do is we break
it uniformly at random.

00:01:45.600 --> 00:01:49.350
So what we do is we choose a
point uniformly at random

00:01:49.350 --> 00:01:50.630
along this stick.

00:01:50.630 --> 00:01:53.960
And we break it there, and then
we keep the left portion

00:01:53.960 --> 00:01:56.220
of that stick.

00:01:56.220 --> 00:02:00.410
So let's call the length of this
left portion after the

00:02:00.410 --> 00:02:02.490
first break random variable y.

00:02:02.490 --> 00:02:04.440
So it's random because
the point where

00:02:04.440 --> 00:02:06.940
we break it is random.

00:02:06.940 --> 00:02:09.120
And then what we do is we
repeat this process.

00:02:09.120 --> 00:02:13.100
We'll take this left side of
the stick that's left.

00:02:13.100 --> 00:02:16.920
And we'll pick another point,
uniformly at random, along

00:02:16.920 --> 00:02:20.140
this left remaining side.

00:02:20.140 --> 00:02:22.610
And we'll break it again,
and keep the left

00:02:22.610 --> 00:02:24.760
side of that break.

00:02:24.760 --> 00:02:29.030
And we'll call that the length
of the final remaining piece,

00:02:29.030 --> 00:02:31.870
x, which again is random.

00:02:31.870 --> 00:02:34.580
The problem is really asking
us to calculate the

00:02:34.580 --> 00:02:37.710
expectation of variance of x.

00:02:37.710 --> 00:02:42.980
So at first, it seems difficult
to do, because the

00:02:42.980 --> 00:02:47.240
expectation and variance of x
depends on where you break it

00:02:47.240 --> 00:02:51.250
the second time and also where
you break it the first time.

00:02:51.250 --> 00:02:55.730
So let's see if conditioning
can help us here.

00:02:55.730 --> 00:02:58.340
So the first thing that we'll
notice is that, if we just

00:02:58.340 --> 00:03:01.670
consider y, the length of the
stick after the first break,

00:03:01.670 --> 00:03:04.160
it's actually pretty easy to
calculate the expectation and

00:03:04.160 --> 00:03:05.730
variance of y.

00:03:05.730 --> 00:03:13.360
Because y, when you think about
it, is actually just the

00:03:13.360 --> 00:03:16.270
simple uniform in a variable,
uniformly distributed between

00:03:16.270 --> 00:03:22.490
0 and l, the length
of the stick.

00:03:22.490 --> 00:03:25.820
And this is because we're told
that we choose the point of

00:03:25.820 --> 00:03:29.560
the break uniformly at random
between 0 and l.

00:03:29.560 --> 00:03:32.030
And so wherever we choose it,
that's going to be the length

00:03:32.030 --> 00:03:34.100
of the left side of the stick.

00:03:34.100 --> 00:03:38.480
And so because of this, we know
that the expectation of y

00:03:38.480 --> 00:03:50.000
is just l/2, and the variance
of y is l squared over 12.

00:03:50.000 --> 00:03:53.000
But unfortunately, calculating
the expectation variance of x

00:03:53.000 --> 00:03:58.230
is not quite as simple, because
x isn't just uniformly

00:03:58.230 --> 00:04:01.430
distributed between 0 and
some fixed number.

00:04:01.430 --> 00:04:03.930
Because it's actually uniformly
distributed between

00:04:03.930 --> 00:04:07.830
0 and y, wherever the
first break was.

00:04:07.830 --> 00:04:11.140
But where the first break
is is random too.

00:04:11.140 --> 00:04:14.170
And so we can't just say that
x is a uniformly distributed

00:04:14.170 --> 00:04:16.320
random variable.

00:04:16.320 --> 00:04:18.085
So what do we do instead?

00:04:18.085 --> 00:04:22.730
Well, we'll make the nice
observation that let's pretend

00:04:22.730 --> 00:04:24.940
that we actually
know what y is.

00:04:24.940 --> 00:04:28.680
If we knew what y was, then
calculating the expectation of

00:04:28.680 --> 00:04:32.010
x would be simple, right?

00:04:32.010 --> 00:04:40.150
So if we were given that y is
just some little y, then x

00:04:40.150 --> 00:04:44.370
would in fact just be uniformly
distributed between

00:04:44.370 --> 00:04:47.180
0 and little y.

00:04:47.180 --> 00:04:50.010
And then if that's the case,
then our calculation is

00:04:50.010 --> 00:04:52.960
simple, because the expectation
of x would just be

00:04:52.960 --> 00:04:57.090
y/2, and the variance would
just be y squared over 12.

00:04:57.090 --> 00:05:02.120
All right, so let's make that
a little bit more formal.

00:05:02.120 --> 00:05:06.060
What we're saying is that the
expectation of x, If we knew

00:05:06.060 --> 00:05:09.610
what y was, would just be y/2.

00:05:12.300 --> 00:05:20.840
And the variance of x If we knew
what y was would just be

00:05:20.840 --> 00:05:24.080
y squared over 12.

00:05:24.080 --> 00:05:26.390
All right, so notice
what we've done.

00:05:26.390 --> 00:05:31.140
We've taken the second stage and
we've said, let's pretend

00:05:31.140 --> 00:05:33.760
we know what happens in the
first stage where we break it.

00:05:33.760 --> 00:05:35.950
And we know what y, the
first break, was.

00:05:35.950 --> 00:05:40.190
Then the second stage becomes
simple, because the average of

00:05:40.190 --> 00:05:43.390
x is just going to
be the midpoint.

00:05:43.390 --> 00:05:48.230
Now what we do to calculate the
actual expectation of x,

00:05:48.230 --> 00:05:51.360
well, we'll invoke the law
of iterated expectations.

00:05:51.360 --> 00:06:00.160
So expectation of x is
expectation of the conditional

00:06:00.160 --> 00:06:04.710
expectation of x given 1, which
in this case is just

00:06:04.710 --> 00:06:08.710
expectation of y/2.

00:06:08.710 --> 00:06:11.190
And we know what the expectation
of y is.

00:06:11.190 --> 00:06:13.560
It's l/2.

00:06:13.560 --> 00:06:16.050
And so this is just l/4.

00:06:19.350 --> 00:06:20.600
l/4.

00:06:23.066 --> 00:06:28.740
All right, and so notice
what we've done.

00:06:28.740 --> 00:06:32.820
We've taken this calculation
and done it in stages.

00:06:32.820 --> 00:06:36.460
So we assume we know where
the first break is.

00:06:36.460 --> 00:06:40.740
Given that, the average location
of the second break

00:06:40.740 --> 00:06:41.130
becomes simple.

00:06:41.130 --> 00:06:42.880
It's just in the midpoint.

00:06:42.880 --> 00:06:45.470
And then, we move up to
the higher stage.

00:06:45.470 --> 00:06:48.490
And that now we average out
over where the first break

00:06:48.490 --> 00:06:49.410
could have been.

00:06:49.410 --> 00:06:50.900
And that gives us our
final answer.

00:06:50.900 --> 00:06:55.590
And notice that this actually
makes sense, if we just think

00:06:55.590 --> 00:06:58.820
about it intuitively, because
on average, the first break

00:06:58.820 --> 00:07:00.670
will be somewhere
in the middle.

00:07:00.670 --> 00:07:03.600
And then that will leave us with
half the stick left, and

00:07:03.600 --> 00:07:04.260
we break it again.

00:07:04.260 --> 00:07:05.720
On average, that will leave
us with another half.

00:07:05.720 --> 00:07:09.360
So on average, you get a quarter
of the original stick

00:07:09.360 --> 00:07:12.270
left, which makes sense.

00:07:12.270 --> 00:07:15.220
All right, so that's the first
part, where we use the law of

00:07:15.220 --> 00:07:17.150
iterated expectations.

00:07:17.150 --> 00:07:20.820
Now, let's go to part B, where
we're actually asked to find

00:07:20.820 --> 00:07:22.070
the variance.

00:07:26.160 --> 00:07:30.410
The variance is given by the
law of total variance.

00:07:30.410 --> 00:07:34.400
So let's do it in stages.

00:07:34.400 --> 00:07:38.490
We'll first calculate the first
term, the expectation of

00:07:38.490 --> 00:07:39.740
the conditional variance.

00:07:42.380 --> 00:07:45.450
Well, what is the expectation
of the conditional variance?

00:07:45.450 --> 00:07:46.930
We've already calculated
out what this

00:07:46.930 --> 00:07:47.820
conditional variance is.

00:07:47.820 --> 00:07:50.510
The conditional variance
is y squared over 12.

00:07:50.510 --> 00:07:52.380
So let's just plug that in.

00:07:52.380 --> 00:07:55.520
It's expectation of
y squared over 12.

00:07:59.090 --> 00:08:02.040
All right, now this looks like
it could be a little difficult

00:08:02.040 --> 00:08:02.770
to calculate.

00:08:02.770 --> 00:08:09.610
But let's just first
pull out the 1/12.

00:08:09.610 --> 00:08:13.560
And then remember, one way to
calculate the expectation of

00:08:13.560 --> 00:08:14.620
the square of a random variable

00:08:14.620 --> 00:08:17.610
is to use the variance.

00:08:17.610 --> 00:08:23.800
So recall that the variance of
any random variable is just

00:08:23.800 --> 00:08:30.800
expectation of the square
minus the square of the

00:08:30.800 --> 00:08:33.190
expectation.

00:08:33.190 --> 00:08:36.990
So if we want to calculate the
expectation of the square, we

00:08:36.990 --> 00:08:38.960
can just take the variance
and add the square of the

00:08:38.960 --> 00:08:40.100
expectation.

00:08:40.100 --> 00:08:43.340
So this actually we can
get pretty easily.

00:08:43.340 --> 00:08:50.265
It's actually just the variance
of y plus the square

00:08:50.265 --> 00:08:51.640
of the expectation of y.

00:08:55.870 --> 00:08:57.650
And we know what these
two terms are.

00:08:57.650 --> 00:09:02.600
The variance of y is
l squared over 12.

00:09:02.600 --> 00:09:05.490
And the expectation
of y is l/2.

00:09:05.490 --> 00:09:07.540
So when you square that, you
get l squared over 4.

00:09:10.890 --> 00:09:13.610
So l squared over 12 plus l
squared over 4 gives you l

00:09:13.610 --> 00:09:15.060
squared over 3.

00:09:15.060 --> 00:09:19.860
And you get that the first term
is l squared over 36.

00:09:22.390 --> 00:09:24.820
All right, now let's calculate
the second term.

00:09:24.820 --> 00:09:28.450
Second term is the variance of
the conditional expectation.

00:09:28.450 --> 00:09:33.830
So the variance of expectation
of x given y.

00:09:36.740 --> 00:09:39.060
Well, what is the expectation
of x given y?

00:09:39.060 --> 00:09:40.230
We've already calculated that.

00:09:40.230 --> 00:09:42.260
That's y/2.

00:09:42.260 --> 00:09:46.340
So what we really want is
the variance of y/2.

00:09:46.340 --> 00:09:48.810
And remember, when you have a
constant inside the variance,

00:09:48.810 --> 00:09:50.730
you pull it out but
you square it.

00:09:50.730 --> 00:09:58.660
So what you get is 1/4 the
variance of y, which we know

00:09:58.660 --> 00:10:01.270
that the variance of y
is l squared over 12.

00:10:01.270 --> 00:10:04.020
So we get that this is
l squared over 48.

00:10:06.740 --> 00:10:09.200
OK, so we've calculated
both terms of

00:10:09.200 --> 00:10:10.340
this conditional variance.

00:10:10.340 --> 00:10:13.360
So all we need to do to
find the final answer

00:10:13.360 --> 00:10:15.140
is just to add them.

00:10:15.140 --> 00:10:21.880
So it's l squared over 36
plus l squared over 48.

00:10:21.880 --> 00:10:31.530
And so, the final answer is
7 l squared over 144.

00:10:31.530 --> 00:10:36.710
OK, and so this is the first,
the expectation of x, maybe

00:10:36.710 --> 00:10:38.150
you could have guessed
intuitively.

00:10:38.150 --> 00:10:42.270
But the variance of x is not
something that looks like

00:10:42.270 --> 00:10:44.250
something that you could
have calculated off

00:10:44.250 --> 00:10:45.620
the top of your head.

00:10:45.620 --> 00:10:51.050
And so I guess the lesson from
this example is that it is

00:10:51.050 --> 00:10:53.110
often very helpful if you
condition on some things,

00:10:53.110 --> 00:10:55.930
because it allows you to
calculate things in stages and

00:10:55.930 --> 00:10:58.800
build up from the bottom.

00:10:58.800 --> 00:11:01.900
But it's important to note that
the choice of what you

00:11:01.900 --> 00:11:03.970
condition on-- so the choice
of y-- is actually very

00:11:03.970 --> 00:11:06.440
important, because you could
choose lots of other y's that

00:11:06.440 --> 00:11:07.940
wouldn't actually
help you at all.

00:11:07.940 --> 00:11:11.270
And so how to actually choose
this y is something that you

00:11:11.270 --> 00:11:14.200
can learn based on just
having practiced with

00:11:14.200 --> 00:11:16.620
these kinds of problems.

00:11:16.620 --> 00:11:20.050
So again, the overall lesson
is, conditioning can often

00:11:20.050 --> 00:11:22.510
help when you calculate
these problems.

00:11:22.510 --> 00:11:24.370
And so you should look
to see if that could

00:11:24.370 --> 00:11:26.970
be a possible solution.

00:11:26.970 --> 00:11:28.630
So I hope that was helpful,
and see you next time.