Join Nostr
2025-08-23 05:25:31 UTC
in reply to

Greg Egan on Nostr: Here is a more geometrically intuitive solution. We assume the square has both x and ...

Here is a more geometrically intuitive solution.

We assume the square has both x and y coordinates ranging from 0 to 1.

Imagine sweeping a line across the square (red in the animation) so that it always joins the top and bottom edges, and one endpoint or the other is always in one of the corners of the square.

If we call the two points (x₁,y₁) and (x₂,y₂), suppose we hold y₁ and y₂ fixed, and look at the values of x₁ and x₂ so that both points lie on the red line.

In the (x₁, x₂) plane, their values sweep out a parallelogram with vertices at (0,0), (y₁,y₂), (1,1) and (1-y₁,1-y₂). The area of this parallelogram is:

|y₁-y₂|

So for any fixed y₁ and y₂, this is the probability that the line between the two points with uniformly random x₁ and x₂ joins the top and bottom edges of the square.

What is the average of |y₁-y₂| across all values of y₁ and y₂? This is just the volume of two pyramids with equal-sized triangular bases, one with y₁ ≤ y₂ and one with y₁ ≥ y₂. The height of both pyramids is 1, since that is the maximum that |y₁-y₂| reaches in both triangles. So the volume of each pyramid is 1/6, for a total of 1/3.

We multiply by two to account for the other case, where the pair of opposite edges are the left and right edges.

So P(opposite) = 2/3.