Given a unit circle, we pick two points at random. Measure the distance between
the two points, and record them somewhere. Then choose another pair of points randomly,
measure the distance between them, and record this as well. Pick a lot of other pairs of
points and measure the distances, and then we consider the average of these distances.
The question in the title basically means the average when we take larger and larger number
of pairs. It turns out the average distance would be 128 / 45 pi. So there you go,
here is the answer. Don’t forget to like, subscribe, hit the bell and comment below.
Okay, I am joking. The video hasn’t ended yet.
Where does this 128 / 45 pi come from? To explain this, we will need a video
series, but along the way, we will learn more about probability and calculus in general.
This video will deal with the first two concepts, because they can make the problem
more mathematically precise, while the remaining two explained in the next few videos make the
problem much more manageable. However, before actually solving the problem, another video is
dedicated to estimating the answer numerically, because this is not as easy as it looks.
To really understand the problem, we have to know what “random” means more precisely,
because we are picking pairs of points “randomly” for calculating distances.
Ideally, what we want is that our points are roughly uniformly distributed. This means that
if there are 4 points in this box, if I move the box elsewhere, it should contain more or less 4
points as well. The areas of the boxes can vary, but the number of points in these boxes should be
more or less the same. In other words, the density of the points should be the same across the disc.
However, the density of points depends on the number of samples taken, so a better description
would be having the same “probability” across the disc. This means that the probability of any point
being in this box, will be the same as that in any other box, as long as they have the same area. The
box does not have to be rectangular, and any shape would be fine, but rectangles are just easier to
demonstrate. Anyway, the probability of a point inside a region would be proportional to the area.
In other words, the ratio between probability and area of the region is a constant. This quantity on
the left is probability density. So actually, we were not thinking about probability at any
given point when we say “same probability” across the disc, we actually meant probability density.
We can actually calculate this constant of probability density.
When the area concerned is the entire circle, i.e. the area being pi, the probability is of course 1.
However, in other cases, this quantity can depend on position, i.e. a function of the position
vector x. This function is, unsurprisingly, called probability density function, pdf
for short. The way to calculate the probability density at one single point works like this.
Pick any region around the point, and calculate the ratio between probability and area of the
region. If we shrink it, this ratio might change a little bit. The pdf at this point
is taken to be the limit of this ratio when the region shrinks to nothing. In this case,
the position vector is in 2 dimensions, and so the denominator is naturally the area of the region.
If we are working in 3 dimensions, the denominator would be the volume instead and so on.
It might seem like the discussion of pdfs is irrelevant, but if we have different probability
density functions, then we will have a very different distribution of points, and thus
different answers to our problem of average distance. In general, whenever you say “random”,
you should always specify the pdf, to avoid getting different answers to the same question.
This is basically the crux of the infamous Bertrand’s paradox,
which might be a story for another time.
Anyway, the next thing we need to deal with is the word “average”, because there is a continuum
of possible distances and pairs of points, but let’s deal with the simpler situation
first. What would be the average of a function like this? Intuitively, we should sample some
values of the function, so let’s denote the y-coordinates as y_1 to y_5, then our estimate of
the average would be summing them up then divide by 5. On the other hand, we can consider the area
of these rectangular strips. We chose the points at regular intervals, so the area of the strips is
the common width times the sum of the y’s. With that, we can replace the sum by area over the
common width. However, 5 times width is precisely the length of the interval on which the function
is defined, so if the function is defined on the interval [a,b], then the 5 times width here can
be replaced by b - a. If we sample more points, then the area of the rectangular strips becomes
closer and closer to the area under the curve, so the average can be found with an integral.
Now notice that the denominator is the length of the interval,
and we are integrating over the interval. If the function takes in higher-dimensional input,
then the length of the interval would be generalised to the volume of the domain.
And instead of integrating over an interval, we integrate the function over the domain. In fact,
the prefactor is the probability density across the domain, so if the pdf is not constant,
this average will be more complicated. Anyway, to determine the average distance, we need to first
determine the domain of the function. Here the function would be the distance between
the points x and y. x is a point in a unit disc centred at the origin, and of course y is also
a point in the unit disc. That means the domain is the ordered pairs of points in a unit disc.
Even though this is a four-dimensional domain, it is useful to think of it as a sort of square,
where each side represents a unit disc. So calculating the four-dimensional volume of the
domain U is sort of like calculating the area of a square. It would be side length squared,
but here we generalise the side length to be the two-dimensional volume, or the area of the unit
disc. Area of a unit disc is pi, so the volume of the domain is pi squared. So going back to
the formula for the average of a function, we can simply substitute the domain and the volume here.
To make this integral more explicit, we can choose to represent the points in
Cartesian or polar coordinates. However, whichever coordinate system you choose,
the resulting quadruple integral is really, really horrible. If we don’t know the answer,
there is no reason why this evaluates to a nice closed-form answer, which is why in the next
video we want to numerically estimate the answer first. Then the following videos will explain the
remaining two concepts that allow us to solve this problem analytically, which will be in next year,
because this would be the last video in 2020 from me, so I would like to give a big thanks
to all of you. In the beginning of this year, I only had 200 subscribers, and as of recording,
I have more than 2000 subscribers. Merry Christmas or if you don’t celebrate Christmas,
happy holidays, even if it is a belated one, and hopefully next year will be better.
This time for real, do like this video if you enjoyed it,
subscribe and hit the bell. Don’t forget to leave a comment as well! See you next year!