Library · Geometric Probability · Chapter 32

Expected area of a random rectangle

Revised Report an error

Problem 32.1

Let P1=(X1,Y1)P_1 = (X_1, Y_1) and P2=(X2,Y2)P_2 = (X_2, Y_2) be two points chosen independently and uniformly in the unit square. Let RR be the axis-aligned rectangle with diagonally opposite corners P1P_1 and P2P_2. What is the expected area of RR?

Solution. The area of the axis-aligned rectangle is ∣X1−X2∣⋅∣Y1−Y2∣|X_1 - X_2| \cdot |Y_1 - Y_2|. Since the pairs (X1,X2)(X_1, X_2) and (Y1,Y2)(Y_1, Y_2) are independent (the xx- and yy-coordinates of the two points are independent), so are ∣X1−X2∣|X_1 - X_2| and ∣Y1−Y2∣|Y_1 - Y_2|. Hence E[Area⁡(R)]=E[∣X1−X2∣]⋅E[∣Y1−Y2∣].\mathbb{E}[\operatorname{Area}(R)] = \mathbb{E}[|X_1 - X_2|] \cdot \mathbb{E}[|Y_1 - Y_2|].

Each factor is the expected absolute difference of two uniform random variables on [0,1][0, 1]. A direct calculation: for X1,X2X_1, X_2 iid uniform on [0,1][0,1], the density of ∣X1−X2∣|X_1 - X_2| is 2(1−t)2(1 - t) on [0,1][0,1], so E[∣X1−X2∣]=∫01t⋅2(1−t) dt=[t2−2t33]01=1−23=13.\mathbb{E}[|X_1 - X_2|] = \int_0^1 t \cdot 2(1 - t) \, dt = \left[ t^2 - \tfrac{2 t^3}{3} \right]_0^1 = 1 - \tfrac23 = \tfrac13. (Alternatively, by symmetry in the triangle {x1<x2}\{x_1 < x_2\}: E[x2−x1]=E[x2]−E[x1]=12−12=0\mathbb{E}[x_2 - x_1] = \mathbb{E}[x_2] - \mathbb{E}[x_1] = \tfrac12 - \tfrac12 = 0 unconditionally, but conditional on x1<x2x_1 < x_2, E[x2−x1∣x1<x2]=13\mathbb{E}[x_2 - x_1 \mid x_1 < x_2] = \tfrac13; and the same value arises unconditionally for the absolute value.)

Hence E[Area⁡(R)]=13⋅13=19.■\boxed{\mathbb{E}[\operatorname{Area}(R)] = \tfrac13 \cdot \tfrac13 = \tfrac19.} \qedhere

The factor 13\tfrac13 for E[∣X1−X2∣]\mathbb{E}[|X_1 - X_2|] is such a frequent building block that it is worth knowing by heart; we meet it again in Chapter 33. The factor of 19\tfrac19 here is a clean demonstration of the multiplicative structure of product measures.

import numpy as np
x1, x2 = np.random.rand(2, 10**7)
y1, y2 = np.random.rand(2, 10**7)
area = np.abs(x1 - x2) * np.abs(y1 - y2)
print(f"sim: {area.mean():.5f}   exact: {1/9:.5f}")
# sim: 0.11114   exact: 0.11111
Report an error on this page

Reports are stored by Netlify. See the privacy note.