WEBVTT

00:00:01.100 --> 00:00:03.960
We will now go through an
example that brings together

00:00:03.960 --> 00:00:07.300
all of the concepts that
we have introduced.

00:00:07.300 --> 00:00:10.480
We have a stick of length l.

00:00:13.100 --> 00:00:17.910
And we break that stick at some
random location, which

00:00:17.910 --> 00:00:21.860
corresponds to a random
variable, X.

00:00:21.860 --> 00:00:27.060
And we assume that this random
variable is uniform over the

00:00:27.060 --> 00:00:28.790
length of the stick.

00:00:28.790 --> 00:00:31.350
So its PDF has this
particular shape.

00:00:31.350 --> 00:00:34.770
And for the PDF to integrate to
1, the height of this PDF

00:00:34.770 --> 00:00:37.660
must be equal to 1 over l.

00:00:37.660 --> 00:00:41.660
Then we take the piece of the
stick that we are left with,

00:00:41.660 --> 00:00:46.380
which has length X, and we break
it at a random location,

00:00:46.380 --> 00:00:51.050
which we call Y. And we assume
that this location Y is

00:00:51.050 --> 00:00:54.830
uniformly distributed over the
length of the stick that we

00:00:54.830 --> 00:00:56.540
were left with.

00:00:56.540 --> 00:00:58.500
What does this assumption
mean?

00:00:58.500 --> 00:01:02.350
It means that if the first break
was at some particular

00:01:02.350 --> 00:01:08.370
value, x, then the random
variable Y has a conditional

00:01:08.370 --> 00:01:14.350
distribution, which is uniform
over the interval from 0 to x.

00:01:14.350 --> 00:01:16.490
So the conditional
PDF is uniform.

00:01:16.490 --> 00:01:19.350
A conditional PDF, like
any other PDF, must

00:01:19.350 --> 00:01:20.560
integrate to 1.

00:01:20.560 --> 00:01:23.430
So the height of this
conditional PDF is

00:01:23.430 --> 00:01:25.930
equal to 1 over x.

00:01:25.930 --> 00:01:28.020
Are X and Y independent?

00:01:28.020 --> 00:01:28.920
No.

00:01:28.920 --> 00:01:32.780
One way to see it is that if
you change little x, the

00:01:32.780 --> 00:01:37.110
conditional PDF of Y would have
been something different.

00:01:37.110 --> 00:01:39.690
Whereas if we have independence,
all the

00:01:39.690 --> 00:01:43.860
conditional PDFs have to be the
same when you change the

00:01:43.860 --> 00:01:45.720
value of little x.

00:01:45.720 --> 00:01:51.810
Another way to see it is that
if I tell you that x is 0.5,

00:01:51.810 --> 00:01:55.310
this gives you lots of
information about Y. It tells

00:01:55.310 --> 00:01:59.570
you that Y has to be less
than or equal to 0.5.

00:01:59.570 --> 00:02:02.540
So the value of the random
variable X gives you plenty of

00:02:02.540 --> 00:02:05.050
information about the other
random variable.

00:02:05.050 --> 00:02:07.950
And so we do not have
independence.

00:02:07.950 --> 00:02:10.199
Notice that in this example,
instead of starting with a

00:02:10.199 --> 00:02:13.300
full description of the random
variables in terms of a joint

00:02:13.300 --> 00:02:18.430
PDF, we use a marginal PDF and
then a conditional PDF to

00:02:18.430 --> 00:02:20.420
construct our model.

00:02:20.420 --> 00:02:23.390
Of course, with these two pieces
of information, we can

00:02:23.390 --> 00:02:28.500
reconstruct the joint PDF using
the multiplication rule.

00:02:28.500 --> 00:02:30.400
The marginal is 1 over l.

00:02:30.400 --> 00:02:32.220
The conditional is 1 over x.

00:02:32.220 --> 00:02:37.350
So the joint is equal
to 1 over lx.

00:02:37.350 --> 00:02:40.620
But for which values of x and
y is this the correct

00:02:40.620 --> 00:02:41.860
expression?

00:02:41.860 --> 00:02:45.640
It is correct only for those
values that are possible.

00:02:45.640 --> 00:02:54.920
So 0 has to be less than y,
less than x, less than l.

00:02:54.920 --> 00:02:58.079
This is the range of values
that are possible in this

00:02:58.079 --> 00:02:59.680
particular experiment.

00:02:59.680 --> 00:03:01.670
And we can visualize
those values.

00:03:01.670 --> 00:03:05.540
They are those that correspond
to this shaded triangle here.

00:03:05.540 --> 00:03:08.610
x and y are less than
or equal to l.

00:03:08.610 --> 00:03:13.050
And y has to be less
than or equal to x.

00:03:13.050 --> 00:03:17.760
If you try to visualize the
joint PDF, notice that since

00:03:17.760 --> 00:03:22.310
it only depends on x not on y,
if you fix a value of x and

00:03:22.310 --> 00:03:26.600
you look at the slice of the
joint PDF, the value of the

00:03:26.600 --> 00:03:30.550
joint PDF is going to be a
constant on that slice.

00:03:30.550 --> 00:03:33.280
On this slice, it's going to be
another constant, actually

00:03:33.280 --> 00:03:34.270
a bigger one.

00:03:34.270 --> 00:03:36.870
On that slice, an even
bigger constant.

00:03:36.870 --> 00:03:41.030
And actually, this constant is
bigger and bigger and goes to

00:03:41.030 --> 00:03:44.980
infinity as we approach 0.

00:03:44.980 --> 00:03:49.640
Of course, the fact that the
slice is constant is just a

00:03:49.640 --> 00:03:54.320
reflection of the fact that
the conditional PDF is

00:03:54.320 --> 00:03:57.550
constant over the range of
values that the random

00:03:57.550 --> 00:03:59.115
variable can take.

00:03:59.115 --> 00:04:03.360
Let us now continue with
some calculations.

00:04:03.360 --> 00:04:08.120
Let us find the marginal PDF
of Y. How do we do it?

00:04:08.120 --> 00:04:12.310
Since we have in our hands the
joint PDF, we can find the

00:04:12.310 --> 00:04:15.450
marginal by integrating
the joint.

00:04:19.610 --> 00:04:25.280
And in our case, the joint
is equal to 1 over lx.

00:04:25.280 --> 00:04:28.350
And we integrate over all x's.

00:04:28.350 --> 00:04:31.110
Now, what is the range
of the integration?

00:04:31.110 --> 00:04:37.970
If we fix a certain value of y,
the joint PDF is actually 0

00:04:37.970 --> 00:04:40.290
in this region and
in that region.

00:04:40.290 --> 00:04:44.700
So we should only integrate over
x's that correspond to

00:04:44.700 --> 00:04:46.240
this interval.

00:04:46.240 --> 00:04:48.330
What is that interval?

00:04:48.330 --> 00:04:51.430
It's the interval
that ends at l.

00:04:51.430 --> 00:04:56.570
And because this is a line
of slope 1, this value

00:04:56.570 --> 00:04:58.280
here is also y.

00:04:58.280 --> 00:05:01.240
So we integrate over
an interval where x

00:05:01.240 --> 00:05:04.010
ranges from y to l.

00:05:04.010 --> 00:05:08.350
In fact, this is just the range
of x's that are possible

00:05:08.350 --> 00:05:10.340
for a given value of y.

00:05:10.340 --> 00:05:14.400
x must always be larger
than or equal to y.

00:05:14.400 --> 00:05:18.290
Now, the integral of 1 over
x is a logarithm.

00:05:18.290 --> 00:05:21.260
And using this fact, we can
evaluate this integral.

00:05:21.260 --> 00:05:28.870
And it's 1 over l times the
logarithm of l over y.

00:05:28.870 --> 00:05:33.170
For what y's is this a
correct expression?

00:05:33.170 --> 00:05:36.970
Well, it makes sense only for
those y's that are possible in

00:05:36.970 --> 00:05:39.650
this experiment.

00:05:39.650 --> 00:05:44.564
And that's the range
from 0 to l.

00:05:44.564 --> 00:05:48.180
When y is equal to l, we have
the logarithm of 1, which is

00:05:48.180 --> 00:05:49.120
equal to 0.

00:05:49.120 --> 00:05:51.870
So the value of the
PDF is 0 here.

00:05:51.870 --> 00:05:55.480
As y decreases, this ratio

00:05:55.480 --> 00:05:58.370
increases and goes to infinity.

00:05:58.370 --> 00:06:01.830
So the log of that also
blows up to infinity.

00:06:01.830 --> 00:06:06.100
And we get a shape of this form,
where the function that

00:06:06.100 --> 00:06:10.270
we're dealing with goes to
infinity as we approach 0.

00:06:10.270 --> 00:06:14.530
Is this a problem having a PDF
that blows up to infinity?

00:06:14.530 --> 00:06:15.460
Not really.

00:06:15.460 --> 00:06:20.480
As long as the area under this
PDF is equal to 1, it's still

00:06:20.480 --> 00:06:22.280
a legitimate PDF.

00:06:22.280 --> 00:06:26.670
And blowing up to infinity
is not an issue.

00:06:26.670 --> 00:06:30.530
Let us now calculate the
expected value of Y. One way

00:06:30.530 --> 00:06:34.780
of doing this is by using the
definition of the expectation.

00:06:34.780 --> 00:06:39.570
It's the integral of y times the
density of y, which is 1

00:06:39.570 --> 00:06:45.750
over l times the log
of l over y.

00:06:45.750 --> 00:06:49.320
And the range of integration
has to be those values for

00:06:49.320 --> 00:06:51.740
which we have a non-zero
density.

00:06:51.740 --> 00:06:55.170
So we integrate from 0 to l,
which are the possible values

00:06:55.170 --> 00:06:58.320
of the random variable Y.
This is an integral

00:06:58.320 --> 00:07:00.330
that's pretty messy.

00:07:00.330 --> 00:07:04.050
One can actually integrate it
using integration by parts.

00:07:04.050 --> 00:07:06.300
But the calculation
is a bit tedious.

00:07:06.300 --> 00:07:08.490
So let us look for
an alternative

00:07:08.490 --> 00:07:10.100
and more clever approach.

00:07:10.100 --> 00:07:13.720
The idea is to divide
and conquer.

00:07:13.720 --> 00:07:16.900
We're going to use the total
expectation theorem, where

00:07:16.900 --> 00:07:21.810
we're going to condition on X.
The total expectation theorem

00:07:21.810 --> 00:07:26.510
tells us that the expected value
of Y is the integral

00:07:26.510 --> 00:07:30.250
over all possible values of the
random variable X, which

00:07:30.250 --> 00:07:33.220
is from 0 to l.

00:07:33.220 --> 00:07:41.350
The density of X, which is 1
over l, times the conditional

00:07:41.350 --> 00:07:47.190
expectation of Y given that X
is equal to some little x.

00:07:47.190 --> 00:07:50.940
And we integrate over all x's.

00:07:50.940 --> 00:07:52.480
Why is this simpler?

00:07:52.480 --> 00:07:57.230
When we condition on X taking
a specific value, Y has a

00:07:57.230 --> 00:08:00.620
uniform distribution
between 0 and x.

00:08:00.620 --> 00:08:03.430
And therefore, this conditional
expectation is the

00:08:03.430 --> 00:08:07.130
expectation of a uniform,
which is 1/2 the

00:08:07.130 --> 00:08:09.010
range of that uniform.

00:08:09.010 --> 00:08:12.240
So we obtain the integral
from 0 to l.

00:08:12.240 --> 00:08:16.470
1 over l times x over 2, dx.

00:08:19.910 --> 00:08:22.760
And finally, that's an
integral that we

00:08:22.760 --> 00:08:24.310
can evaluate easily.

00:08:24.310 --> 00:08:28.700
Or we can think even
in a simpler way.

00:08:28.700 --> 00:08:33.095
This expression here is
the density of x.

00:08:35.780 --> 00:08:37.520
This is x itself.

00:08:37.520 --> 00:08:41.820
So the integral of this times x
gives us the expected value

00:08:41.820 --> 00:08:44.860
of X. And there's only
a factor of 1/2

00:08:44.860 --> 00:08:46.160
that's left out there.

00:08:46.160 --> 00:08:52.920
So we obtain 1/2 the expected
value of X. But now, X itself

00:08:52.920 --> 00:08:57.020
is uniform on an interval
that has length l.

00:08:57.020 --> 00:09:01.030
And therefore, the expected
value of x is l over 2.

00:09:01.030 --> 00:09:05.890
And so we get the final answer,
which is 1/2 times l

00:09:05.890 --> 00:09:10.280
over 2, which is l over four.

00:09:10.280 --> 00:09:12.630
This answer makes
intuitive sense.

00:09:12.630 --> 00:09:17.040
If we break a stick once, the
expected value or what we're

00:09:17.040 --> 00:09:21.160
left with is half of what
we started with.

00:09:21.160 --> 00:09:25.330
But if we break it once more,
then we expect it on the

00:09:25.330 --> 00:09:29.750
average to be cut by a
factor again of 1/2.

00:09:29.750 --> 00:09:33.300
And so we expect to be left with
a stick that has length

00:09:33.300 --> 00:09:35.890
1/4 of what we started with.

00:09:39.580 --> 00:09:43.280
So this example is a
particularly nice one, because

00:09:43.280 --> 00:09:46.740
we used all of the concepts
that we have introduced--

00:09:46.740 --> 00:09:50.510
marginal PDFs, joint PDFs,
conditional PDFs, and the

00:09:50.510 --> 00:09:54.780
relations between them, as
well as expectations,

00:09:54.780 --> 00:09:58.720
calculations of expectations,
and conditional expectations,

00:09:58.720 --> 00:10:00.760
as well as the total probability
theorem.