LibraryQuant puzzles
Take a circle and inscribe an equilateral triangle in it. Now draw a chord of the circle at random.
What is the probability that the chord is longer than a side of the triangle?
Give at least two answers, each with a construction that a reasonable person would call random, and then say which one is correct.
Before computing anything, write down exactly how the random chord is produced. Try a few different recipes a reasonable person might use and see whether they agree.
A uniform distribution needs a set to be uniform on, and chords admit several natural parametrisations that disagree. Naming the measure is not pedantry, it is the entire content of the question.
Take the circle to have radius 1 and centre at the origin. The inscribed equilateral triangle has side . A chord whose midpoint sits at distance from the centre has length , so
Every construction below reduces to the same geometric condition, . What differs is the law we put on , and that is decided by how the chord was generated, not by the circle.
Pick two points independently and uniformly on the circumference and join them. By rotational symmetry we can fix the first at angle zero, so the second is uniform on . The chord subtends angle and has length , which exceeds exactly when lies in the middle third, between and .
Said another way, the second endpoint has to land on the arc cut off by the far side of the triangle, which is one of three equal arcs.
Pick a direction uniformly, draw the radius in that direction, then pick a point uniformly along that radius and take the chord perpendicular to the radius through that point. Now is uniform on and
Pick a point uniformly in the disc and take the chord having that point as its midpoint. The condition describes the inner disc of radius , and uniform on an area means probability proportional to area:
None of them, and all of them. There is no error to find. Each construction defines a genuinely different probability measure on the set of chords, and "at random" does not pick one out. The phrase is a promise of a distribution that was never delivered.
The three measures really are different objects, not three views of one. Under construction two the mean chord length is ; under construction three it is exactly ; under construction one it is . They disagree about everything, not only about this threshold.
The reason it feels paradoxical is that "uniform" carries no information until we say uniform on what. Uniform on pairs of endpoints, uniform on distance from the centre and uniform on midpoint location are three different sets with three different flat measures, and there is no privileged coordinate system on chord space that makes one of them the real one.
There is a well known argument, due to Jaynes, that construction two is the right one if we insist the answer be invariant under translating and rescaling the circle. That is a real theorem and it does single out one measure.
It is also answering a different question. The invariance requirement is the natural one for straws thrown across a floor onto a circle drawn there, because that physical setup genuinely does not know where the circle is or how big it is. It is not the natural requirement for "pick two points on the rim", which is a perfectly sensible thing to do and gives . Invariance selects a measure only once we have committed to what the chord generating mechanism is indifferent to, and different mechanisms are indifferent to different things.
So the honest position is the one that sounds evasive and is not: the question is underdetermined, here are the three measures, and if you tell me the mechanism I will tell you the number.
Every Monte Carlo estimate is a Bertrand chord. Whoever writes the sampler chooses the measure, usually without noticing, and the number that comes out is a property of the sampler as much as of the geometry. A scenario generator that draws "random market conditions" has picked a measure. A stress test that perturbs "a random subset of parameters" has picked a measure. When two teams report different answers to what they believe is the same question, the disagreement is almost never in the arithmetic.
The discipline is short: write down the sampling mechanism before writing the estimator, and if you cannot write it down, the question is not yet a question.
Checked by simulation. Two million draws under each construction returned 0.33318, 0.50000 and 0.24996 against the exact 1/3, 1/2 and 1/4, and the mean chord lengths came out at 1.2726, 1.5707 and 1.3332, matching , and . The last of those is exact rather than numerical: a midpoint uniform on the disc puts density on its distance from the centre, and .
All three constructions fit in one seeded run, and the numbers separate on the first few million draws.
import numpy as np
rng = np.random.default_rng(7)
n = 4_000_000
th = rng.uniform(0, 2 * np.pi, n) # two endpoints
d2 = rng.random(n) # a random radius
d3 = np.sqrt(rng.random(n)) # a midpoint
one = 2 * np.sin(th / 2) > np.sqrt(3)
print(round(float(one.mean()), 2)) # 0.33
print(round(float((d2 < 0.5).mean()), 2)) # 0.5
print(round(float((d3 < 0.5).mean()), 2)) # 0.25
The follow-up to expect. Is there a fourth construction? Yes, and easily: pick the chord's two endpoints by first picking a chord length uniformly on , or sample lines uniformly in the space of lines meeting the disc under the kinematic measure of integral geometry. The last one is construction two in disguise, which is precisely Jaynes' point and a good way to confirm that the invariance argument is doing real work rather than picking a favourite.
1/3, 1/2 or 1/4, one for each way of making the phrase at random precise. The question as posed has no single answer.
Thuztra Learn teaches the maths of quant finance from zero, in short lessons, for readers who are unsure of it. Three questions in the app build your quant roadmap, free. Membership is a paid subscription. See what Thuztra Learn is and what it costs, or see the whole Core quant curriculum.
Get the app and answer the three questions:
Download on the Microsoft Store Download for Android