Library · Geometric Probability · Chapter 43
Sylvester’s four-point problem in a triangle
Problem 43.1
Let be four points chosen independently and uniformly at random in a triangle . What is the probability that they form the vertices of a convex quadrilateral?
Solution. Step 1: the disjoint-events dichotomy. Four points in the plane in general position either lie in convex position (their convex hull is a quadrilateral) or else exactly one of the four lies inside the triangle formed by the other three. Let denote the event “ lies strictly inside ” (the triangle of the other three). The events are mutually exclusive, and
Step 2: reduce to the expected-area lemma. By symmetry, is the same for each . For , condition on :
Step 3: the expected area is . We claim that for three uniform random points in a triangle , By affine invariance of both sides under linear maps , we may take to be the standard triangle with vertices , of area . Write . The signed area is with so . Direct integration (using the density on and repeated Fubini) gives , hence . The computation is tedious but elementary.
Step 4: assemble. From Steps 1–3,
import numpy as np
# 4 uniform points in standard triangle (fold-sampled); directly test convex
# position by checking no point is strictly inside the triangle of the other 3.
N = 10**6
u, v = np.random.rand(2, 4, N)
mask = u + v > 1
u, v = np.where(mask, 1-u, u), np.where(mask, 1-v, v)
def inside_tri(pu, pv, au, av, bu, bv, cu, cv):
det = (bv-cv)*(au-cu) + (cu-bu)*(av-cv)
w1 = ((bv-cv)*(pu-cu) + (cu-bu)*(pv-cv)) / det
w2 = ((cv-av)*(pu-cu) + (au-cu)*(pv-cv)) / det
return (w1 > 0) & (w2 > 0) & (1 - w1 - w2 > 0)
any_in = np.zeros(N, dtype=bool)
for i in range(4):
j, k, l = [m for m in range(4) if m != i]
any_in |= inside_tri(u[i], v[i], u[j], v[j], u[k], v[k], u[l], v[l])
print(f"sim: {(1 - any_in).mean():.5f} exact: {2/3:.5f}")
# sim: 0.66736 exact: 0.66667