How Far Apart Are Random Points? An Elegant Expectation
Monday 2 March 2026 at 20:19
Visible to anyone in the world
Edited by Richard Walker, Monday 2 March 2026 at 22:34
If and are two random points on the number line between amd 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 . the difference between and ignoring sign. In problems like this it's often useful to take and as a coordinate pair, so here I have done this, with the help of Desmos. For each in the unit square the height of the surface corresponds to .
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 .
The volume is made up of two identical pyramids, with a valley between where and are equal and the distance is . The volume of a pyramid is given by . In this case the base of each pyramid is and its height so the volume is .
The combined volume of the two pyramids is therefore and dividing by the are of the unit square which is we find the expected distance between the two random points is .
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 . 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.
How Far Apart Are Random Points? An Elegant Expectation
If and are two random points on the number line between amd 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 . the difference between and ignoring sign. In problems like this it's often useful to take and as a coordinate pair, so here I have done this, with the help of Desmos. For each in the unit square the height of the surface corresponds to .
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 .
The volume is made up of two identical pyramids, with a valley between where and are equal and the distance is . The volume of a pyramid is given by . In this case the base of each pyramid is and its height so the volume is .
The combined volume of the two pyramids is therefore and dividing by the are of the unit square which is we find the expected distance between the two random points is .
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 . 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.