Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 89

Can You Knock Down The Gates?

Pick two uniformly random points on the perimeter of a unit square and cut straight between them (the two points may share a side). The cut is “reasonable” if it splits the square into two pieces and the smaller has area at least 14\tfrac14. What is the probability of a reasonable cut?

Solution

Choosing two random perimeter points amounts to picking two sides (with replacement, so 1616 equally likely ordered pairs) and a uniform point on each. Three cases cover it.

Same side (probability 416=14\tfrac{4}{16} = \tfrac14): the “cut” lies along an edge and does not divide the square, so it is never reasonable.

Adjacent sides (probability 816=12\tfrac{8}{16} = \tfrac12): the smaller piece is a right triangle with legs X,YU[0,1]X, Y \sim \mathcal{U}[0,1] at the shared corner, of area 12XY12\tfrac12 XY \le \tfrac12. It is reasonable when 12XY14\tfrac12 XY \ge \tfrac14, and since XYXY has CDF F(z)=zzlnzF(z) = z - z\ln z, Pr ⁣(XY12)=1F(12)=12ln22.\Pr\!\big(XY \ge \tfrac12\big) = 1 - F\big(\tfrac12\big) = \tfrac12 - \tfrac{\ln 2}{2}.

Opposite sides (probability 416=14\tfrac{4}{16} = \tfrac14): the cut makes a trapezium of area 12(X+Y)\tfrac12(X + Y), and the smaller piece is at least 14\tfrac14 exactly when X+Y[12,32]X + Y \in [\tfrac12, \tfrac32], which for two uniforms has probability 34\tfrac34.

Weighting by the case probabilities, 12(12ln22)+1434=716ln240.264.\frac12\Big(\tfrac12 - \tfrac{\ln 2}{2}\Big) + \frac14\cdot\frac34 = \frac{7}{16} - \frac{\ln 2}{4} \approx \boxed{0.264}.

The computation

Pick two sides and two uniform points, classify the pair as same/adjacent/opposite, and test whether the smaller piece clears a quarter of the area.

import numpy as np
rng = np.random.default_rng(0)
N = 5_000_000
s1, s2 = rng.integers(0, 4, N), rng.integers(0, 4, N)
x, y = rng.random(N), rng.random(N)
diff = np.abs(s1 - s2)
adj, opp = (diff == 1) | (diff == 3), (diff == 2)
ok = np.zeros(N, bool)
ok[adj] = x[adj] * y[adj] / 2 >= 0.25
small = np.minimum((x + y) / 2, (2 - x - y) / 2)
ok[opp] = small[opp] >= 0.25
print(ok.mean())                               # ~0.264