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 . What is the probability of a reasonable cut?
Solution
Choosing two random perimeter points amounts to picking two sides (with replacement, so equally likely ordered pairs) and a uniform point on each. Three cases cover it.
Same side (probability ): the “cut” lies along an edge and does not divide the square, so it is never reasonable.
Adjacent sides (probability ): the smaller piece is a right triangle with legs at the shared corner, of area . It is reasonable when , and since has CDF ,
Opposite sides (probability ): the cut makes a trapezium of area , and the smaller piece is at least exactly when , which for two uniforms has probability .
Weighting by the case probabilities,
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