OU blog

Personal Blogs

Richard Walker

How Far Apart Are Random Points? An Elegant Expectation

Visible to anyone in the world
Edited by Richard Walker, Monday 2 March 2026 at 22:34

If cap x and cap y are two random points on the number line between zero amd one what is the average distance between them?

Of course this is not expressed rigorously but I hope it is good enough for the purposes of exploring our problem.*

What we want is the expected value of absolute value of cap x minus cap y . the difference between cap x and cap y ignoring sign. In problems like this it's often useful to take cap x and cap y as a coordinate pair, so here I have done this, with the help of Desmos. For each left parenthesis cap x comma cap y right parenthesis in the unit square left curly bracket zero less than or equals x less than or equals one right curly bracket times left curly bracket zero less than or equals y less than or equals one right curly bracket the height of the surface corresponds to absolute value of cap x minus cap y

Now to find our average we can do something analogous to how we calculate the mean of a set of numbers, where we add them all up and divide by how many there are of them. In the problem we are looking at we use a continuous version. We cannot add up all the infinite number of values or count them, but what we can do instead is find the volume under the surface and divide it by the area of the unit square, which is one .

The volume is made up of two identical pyramids, with a valley between where cap x and cap y are equal and the distance is zero . The volume of a pyramid is given by one divided by three postfix multiplication base area multiplication height . In this case the base of each pyramid is one divided by two and its height one so the volume is one divided by three multiplication one divided by two multiplication one equals one divided by six .

The combined volume of the two pyramids is therefore one divided by six plus one divided by six equals one divided by three and dividing by the are of the unit square which is one we find the expected distance between the two random points is one divided by three .

PS I have seen it argued that the two points divide the unit interval into three segmentsl and because the points are completely random the expected lengths of all three segments (and therefore the distance between the points should by symmetry be one divided by three . I suppose this is correct but I have a slight feeling of unease. Is it too glib?

*  I should have said the points are chosen at random from a uniform distribution.

Permalink
Share post

This blog might contain posts that are only visible to logged-in users, or where only logged-in users can comment. If you have an account on the system, please log in for full access.

Total visits to this blog: 3907258