WEBVTT

00:00:00.000 --> 00:00:12.750 align:middle line:84%
[SQUEAKING]
[RUSTLING] [CLICKING]

00:00:12.750 --> 00:00:14.400 align:middle line:84%
YUFEI ZHAO: In
this video, let us

00:00:14.400 --> 00:00:18.090 align:middle line:84%
look at a basic yet important
concept in probability known

00:00:18.090 --> 00:00:20.880 align:middle line:84%
as linearity of
expectations and use

00:00:20.880 --> 00:00:24.960 align:middle line:84%
it to deduce some interesting
consequences in combinatorics

00:00:24.960 --> 00:00:27.900 align:middle line:90%
via the probabilistic method.

00:00:27.900 --> 00:00:31.290 align:middle line:84%
Linearity of expectations
says that, if you

00:00:31.290 --> 00:00:36.300 align:middle line:84%
are given random variables,
x1 to xn, and constants,

00:00:36.300 --> 00:00:42.030 align:middle line:84%
C1 through Cn, then when we
take a linear combination

00:00:42.030 --> 00:00:46.380 align:middle line:84%
of these random variables,
as such, C1 times x1--

00:00:46.380 --> 00:00:49.650 align:middle line:84%
so imagine these are real valued
random variables and these are

00:00:49.650 --> 00:00:56.070 align:middle line:84%
real constants, for instance--
then the sum of these C1 times

00:00:56.070 --> 00:01:01.740 align:middle line:84%
x1 plus C2 times x2 and
so on plus Cn times xn--

00:01:01.740 --> 00:01:04.980 align:middle line:90%
so this sum has expectation--

00:01:04.980 --> 00:01:07.080 align:middle line:84%
the following, which
can be computed

00:01:07.080 --> 00:01:11.040 align:middle line:84%
by distributing this
expectation symbol across

00:01:11.040 --> 00:01:14.350 align:middle line:90%
to the individual variables.

00:01:14.350 --> 00:01:17.030 align:middle line:84%
So this is a basic and
important property.

00:01:17.030 --> 00:01:21.190 align:middle line:84%
And it's worth noting that
a similar statement written

00:01:21.190 --> 00:01:23.270 align:middle line:90%
for products is often not true.

00:01:23.270 --> 00:01:26.320 align:middle line:84%
So it is not usually the
case that the expectation

00:01:26.320 --> 00:01:28.990 align:middle line:84%
of a product of two
random variables

00:01:28.990 --> 00:01:32.120 align:middle line:84%
is the product of
their expectations,

00:01:32.120 --> 00:01:34.430 align:middle line:84%
unless you're in some
special circumstances,

00:01:34.430 --> 00:01:38.530 align:middle line:84%
such as when x and y are
independent or uncorrelated.

00:01:38.530 --> 00:01:42.130 align:middle line:84%
Anyway, let us focus on the
linearity of expectations

00:01:42.130 --> 00:01:46.360 align:middle line:84%
and see some ways to use this
in combinatorial applications.

00:01:46.360 --> 00:01:50.390 align:middle line:84%
And the first example is
the following question,

00:01:50.390 --> 00:01:53.980 align:middle line:84%
which will be able to give a
very quick and clean answer.

00:01:53.980 --> 00:01:56.530 align:middle line:84%
The question is, what
is the average number

00:01:56.530 --> 00:02:00.340 align:middle line:84%
of fixed points of a
permutation of 1 through n

00:02:00.340 --> 00:02:03.190 align:middle line:90%
chosen uniformly at random?

00:02:03.190 --> 00:02:08.740 align:middle line:84%
As a reminder, if we have
numbers 1, 2, 3, 4-- here,

00:02:08.740 --> 00:02:09.860 align:middle line:90%
n equals to 4--

00:02:09.860 --> 00:02:14.300 align:middle line:84%
then a permutation can
be thought as some way

00:02:14.300 --> 00:02:17.990 align:middle line:84%
to map these numbers, the
sets back to themselves,

00:02:17.990 --> 00:02:20.210 align:middle line:90%
in one to one correspondence.

00:02:20.210 --> 00:02:28.910 align:middle line:84%
And a fixed point
is some number that

00:02:28.910 --> 00:02:31.280 align:middle line:90%
gets mapped back to themselves.

00:02:31.280 --> 00:02:36.700 align:middle line:84%
So in this permutation, there
are exactly two fixed points.

00:02:36.700 --> 00:02:39.370 align:middle line:90%
OK, great.

00:02:39.370 --> 00:02:42.586 align:middle line:84%
Let's answer this question
using linearity of expectations.

00:02:42.586 --> 00:02:45.210 align:middle line:90%


00:02:45.210 --> 00:02:46.800 align:middle line:84%
One way to think
about the problem

00:02:46.800 --> 00:02:50.550 align:middle line:84%
is that there are n
factorial permutations.

00:02:50.550 --> 00:02:54.073 align:middle line:84%
And maybe we want to try to go
about counting how many of them

00:02:54.073 --> 00:02:55.740 align:middle line:84%
have zero fixed points,
how many of them

00:02:55.740 --> 00:02:57.990 align:middle line:84%
have one fixed points, how
many have two fixed points.

00:02:57.990 --> 00:03:01.270 align:middle line:84%
But that method can get pretty
cumbersome and pretty difficult,

00:03:01.270 --> 00:03:03.270 align:middle line:90%
quite quickly.

00:03:03.270 --> 00:03:05.010 align:middle line:84%
However, if we look
at this problem

00:03:05.010 --> 00:03:08.080 align:middle line:84%
through the lens of
linearity of expectations,

00:03:08.080 --> 00:03:11.910 align:middle line:84%
there turns out to be
a very quick solution.

00:03:11.910 --> 00:03:16.210 align:middle line:84%
And the method is to introduce
some random variables.

00:03:16.210 --> 00:03:20.160 align:middle line:84%
Let xi be a random
variable that equals

00:03:20.160 --> 00:03:30.910 align:middle line:84%
to 1 if i is a fixed point,
meaning that in this permutation

00:03:30.910 --> 00:03:35.270 align:middle line:84%
i gets mapped to
itself and 0 otherwise.

00:03:35.270 --> 00:03:38.470 align:middle line:90%


00:03:38.470 --> 00:03:42.820 align:middle line:84%
So x sub i is the
indicator random variable

00:03:42.820 --> 00:03:45.130 align:middle line:84%
for the element i
being a fixed point

00:03:45.130 --> 00:03:46.970 align:middle line:90%
of this random permutation.

00:03:46.970 --> 00:03:51.350 align:middle line:90%


00:03:51.350 --> 00:03:54.390 align:middle line:84%
What's the expectation
of xi Well,

00:03:54.390 --> 00:03:59.215 align:middle line:84%
this is the probability
that i is a fixed point.

00:03:59.215 --> 00:04:05.290 align:middle line:90%


00:04:05.290 --> 00:04:08.410 align:middle line:84%
Well, this being a uniform
permutation chosen uniformly

00:04:08.410 --> 00:04:12.070 align:middle line:84%
at random, i is sent to each
of the elements 1 through n

00:04:12.070 --> 00:04:13.670 align:middle line:90%
with equal probabilities.

00:04:13.670 --> 00:04:15.580 align:middle line:84%
So in particular, it
is sent back to itself

00:04:15.580 --> 00:04:18.310 align:middle line:90%
with probability 1 over n.

00:04:18.310 --> 00:04:28.100 align:middle line:84%
And then the number of fixed
points equals to the sum

00:04:28.100 --> 00:04:32.830 align:middle line:90%
of the xi's--

00:04:32.830 --> 00:04:36.160 align:middle line:90%
so x1 plus x2, and so on, to xn.

00:04:36.160 --> 00:04:42.790 align:middle line:84%
And now, we can take
expectation on both sides

00:04:42.790 --> 00:04:51.600 align:middle line:84%
and apply linearity
of expectations

00:04:51.600 --> 00:04:57.230 align:middle line:84%
and see that, well, each
individual term is 1 over n

00:04:57.230 --> 00:04:58.870 align:middle line:90%
and there are n such terms.

00:04:58.870 --> 00:05:00.300 align:middle line:90%
So the answer is 1.

00:05:00.300 --> 00:05:03.870 align:middle line:84%
And that is the answer
to this question.

00:05:03.870 --> 00:05:05.610 align:middle line:84%
So the average number
of fixed points

00:05:05.610 --> 00:05:08.220 align:middle line:84%
of a permutation chosen
uniformly at random

00:05:08.220 --> 00:05:09.838 align:middle line:90%
is exactly 1.

00:05:09.838 --> 00:05:11.880 align:middle line:84%
And you see that there's
a very quick calculation

00:05:11.880 --> 00:05:14.430 align:middle line:84%
once you get the hang
of the idea of linearity

00:05:14.430 --> 00:05:17.130 align:middle line:90%
of expectations.

00:05:17.130 --> 00:05:20.640 align:middle line:84%
Let us look at a slightly
more interesting example.

00:05:20.640 --> 00:05:23.520 align:middle line:84%
And for this example,
we'll consider

00:05:23.520 --> 00:05:25.180 align:middle line:90%
the concept of a tournament.

00:05:25.180 --> 00:05:31.070 align:middle line:90%


00:05:31.070 --> 00:05:35.180 align:middle line:84%
So a tournament is a concept
in graph theory referring

00:05:35.180 --> 00:05:38.750 align:middle line:90%
to the following.

00:05:38.750 --> 00:05:40.220 align:middle line:90%
There are n vertices.

00:05:40.220 --> 00:05:42.420 align:middle line:84%
Think of n players
in some tournament.

00:05:42.420 --> 00:05:44.780 align:middle line:84%
And between every
pair of vertices,

00:05:44.780 --> 00:05:47.870 align:middle line:84%
we have some directed
edge pointing

00:05:47.870 --> 00:05:50.180 align:middle line:90%
in one of these two directions.

00:05:50.180 --> 00:05:53.660 align:middle line:84%
So every pair of vertices,
there is some edge pointing

00:05:53.660 --> 00:05:55.486 align:middle line:90%
to one of the two directions.

00:05:55.486 --> 00:06:04.510 align:middle line:90%


00:06:04.510 --> 00:06:08.860 align:middle line:84%
OK, so that's an
example of a tournament.

00:06:08.860 --> 00:06:11.440 align:middle line:84%
I'll need to introduce
another concept, which

00:06:11.440 --> 00:06:12.675 align:middle line:90%
is that of a Hamilton path.

00:06:12.675 --> 00:06:23.870 align:middle line:90%


00:06:23.870 --> 00:06:28.700 align:middle line:84%
So a Hamilton path
is a directed path,

00:06:28.700 --> 00:06:32.510 align:middle line:84%
meaning we travel along the
directions of these edges

00:06:32.510 --> 00:06:34.090 align:middle line:90%
according to their directions.

00:06:34.090 --> 00:06:46.240 align:middle line:84%
So directed path that passes
through each vertex, so

00:06:46.240 --> 00:06:51.045 align:middle line:84%
every vertex of the graph
exactly once, no more, no less.

00:06:51.045 --> 00:06:54.000 align:middle line:90%


00:06:54.000 --> 00:07:00.160 align:middle line:84%
So let's see if we can find any
Hamilton paths in this example.

00:07:00.160 --> 00:07:01.320 align:middle line:90%
Well, I see one.

00:07:01.320 --> 00:07:03.450 align:middle line:84%
So if we start with
a middle vertex

00:07:03.450 --> 00:07:07.950 align:middle line:84%
and go along this one, this
edge, then this edge, and then

00:07:07.950 --> 00:07:10.560 align:middle line:84%
this edge, so that's
a Hamilton path

00:07:10.560 --> 00:07:14.820 align:middle line:84%
that goes through all four
vertices, each vertex passing

00:07:14.820 --> 00:07:16.210 align:middle line:90%
through it exactly once.

00:07:16.210 --> 00:07:18.815 align:middle line:84%
And it always traverses along
the direction of the edges.

00:07:18.815 --> 00:07:23.830 align:middle line:90%


00:07:23.830 --> 00:07:25.410 align:middle line:84%
Let us prove the
following theorem.

00:07:25.410 --> 00:07:28.640 align:middle line:90%


00:07:28.640 --> 00:07:48.186 align:middle line:84%
For every n, there
exists a tournament

00:07:48.186 --> 00:08:03.550 align:middle line:84%
of n vertices with at
least n factorial times 2

00:08:03.550 --> 00:08:10.935 align:middle line:84%
to the minus n plus
1 Hamilton paths.

00:08:10.935 --> 00:08:20.160 align:middle line:90%


00:08:20.160 --> 00:08:24.320 align:middle line:84%
So in other words,
for every n, there

00:08:24.320 --> 00:08:26.930 align:middle line:84%
is some way to orient the
edges of the complete graph

00:08:26.930 --> 00:08:29.960 align:middle line:84%
on n vertices so
that it has lots

00:08:29.960 --> 00:08:34.669 align:middle line:84%
and lots of Hamilton paths,
specifically at least this many.

00:08:34.669 --> 00:08:36.790 align:middle line:84%
So that's a theorem that
we're aiming to prove.

00:08:36.790 --> 00:08:39.640 align:middle line:90%


00:08:39.640 --> 00:08:42.159 align:middle line:84%
We will not prove this
theorem by explicitly

00:08:42.159 --> 00:08:43.880 align:middle line:90%
constructing such a tournament.

00:08:43.880 --> 00:08:46.480 align:middle line:84%
Instead, we'll invoke
the probabilistic method

00:08:46.480 --> 00:08:50.620 align:middle line:84%
and show that a random
tournament has an expectation

00:08:50.620 --> 00:08:53.800 align:middle line:90%
of this property.

00:08:53.800 --> 00:08:56.470 align:middle line:90%
So here's the proof.

00:08:56.470 --> 00:09:09.020 align:middle line:84%
Let's consider a
random tournament

00:09:09.020 --> 00:09:16.905 align:middle line:84%
on n vertices chosen
uniformly at random.

00:09:16.905 --> 00:09:25.830 align:middle line:90%


00:09:25.830 --> 00:09:29.770 align:middle line:84%
One way to do this is to take
a complete graph on n vertices

00:09:29.770 --> 00:09:32.340 align:middle line:84%
and for every edge
flip a fair coin

00:09:32.340 --> 00:09:35.550 align:middle line:84%
and use that coin to decide
which way the edge orients

00:09:35.550 --> 00:09:37.360 align:middle line:90%
of the two different directions.

00:09:37.360 --> 00:09:40.370 align:middle line:90%


00:09:40.370 --> 00:09:43.250 align:middle line:84%
Now, let's think about the
number of Hamilton paths.

00:09:43.250 --> 00:09:50.960 align:middle line:90%
So each path of the--

00:09:50.960 --> 00:10:05.430 align:middle line:84%
so each-- so each of the
n factorial permutations

00:10:05.430 --> 00:10:18.245 align:middle line:84%
of vertices forms
a directed path.

00:10:18.245 --> 00:10:22.660 align:middle line:90%


00:10:22.660 --> 00:10:26.710 align:middle line:84%
OK, so first, consider a
permutation of vertices--

00:10:26.710 --> 00:10:30.470 align:middle line:90%
for example, 2, 1, 3, 4.

00:10:30.470 --> 00:10:33.700 align:middle line:84%
And think about what is the
probability that the edges that

00:10:33.700 --> 00:10:38.450 align:middle line:84%
go in the direction
of this permutation--

00:10:38.450 --> 00:10:43.860 align:middle line:84%
that the edges are oriented
according to the permutation.

00:10:43.860 --> 00:10:46.555 align:middle line:84%
Well, we have to
flip n minus 1 coins.

00:10:46.555 --> 00:10:48.430 align:middle line:84%
And all of them have to
come up in such a way

00:10:48.430 --> 00:10:51.660 align:middle line:84%
so that the edges are
pointing in the direction

00:10:51.660 --> 00:10:54.520 align:middle line:84%
of this permutation, in the
order of this permutation.

00:10:54.520 --> 00:11:00.930 align:middle line:84%
So the probability that this
is a directed path for each

00:11:00.930 --> 00:11:03.210 align:middle line:84%
of these permutations
is precisely

00:11:03.210 --> 00:11:08.030 align:middle line:84%
2 to the minus
parentheses n minus 1.

00:11:08.030 --> 00:11:11.090 align:middle line:90%


00:11:11.090 --> 00:11:14.960 align:middle line:84%
And now, we invoke the
linearity of expectations

00:11:14.960 --> 00:11:24.110 align:middle line:84%
to claim that the expected
number of Hamilton paths

00:11:24.110 --> 00:11:26.600 align:middle line:84%
must then be--
well, each of the n

00:11:26.600 --> 00:11:31.520 align:middle line:84%
factorial permutations
has probability of 2

00:11:31.520 --> 00:11:38.090 align:middle line:84%
to the minus n minus 1
of being a directed path.

00:11:38.090 --> 00:11:42.020 align:middle line:84%
So this is a calculation that
is analogous to the calculation

00:11:42.020 --> 00:11:45.850 align:middle line:84%
that we did in the earlier
part of this video.

00:11:45.850 --> 00:11:50.500 align:middle line:84%
Well, this is what happens
in expectation, on average.

00:11:50.500 --> 00:11:55.150 align:middle line:84%
And thus, there must
be some instance

00:11:55.150 --> 00:11:58.810 align:middle line:84%
where we can beat this average
or at least be at least as

00:11:58.810 --> 00:12:00.200 align:middle line:90%
large as this average.

00:12:00.200 --> 00:12:09.040 align:middle line:84%
So thus, there
exists a tournament

00:12:09.040 --> 00:12:19.685 align:middle line:84%
with at least this
many Hamilton paths.

00:12:19.685 --> 00:12:24.020 align:middle line:90%


00:12:24.020 --> 00:12:27.470 align:middle line:84%
And that concludes the
proof of this theorem

00:12:27.470 --> 00:12:30.590 align:middle line:90%
that we laid out earlier.

00:12:30.590 --> 00:12:34.520 align:middle line:84%
So this is an example
of applying linearity

00:12:34.520 --> 00:12:38.510 align:middle line:84%
of expectations as a step
in the probabilistic method

00:12:38.510 --> 00:12:42.020 align:middle line:84%
to prove this nice
and simple result,

00:12:42.020 --> 00:12:47.590 align:middle line:84%
that there exists tournaments
with lots of Hamilton paths.

00:12:47.590 --> 00:12:55.000 align:middle line:90%