Concept

Monte Carlo

Computing a deterministic quantity by averaging a random process designed to have that quantity as its mean. Its error falls like one over the square root of the sample size whatever the dimension, which makes it slow everywhere and the only workable method in high dimensions.

Named by 16 essays across 5 fields — each of them below, with the objects they name alongside it.

120 needles on a lined floor. 120 needles dropped at random across evenly spaced lines; 83 of them cross a line.

Getting pi by dropping needles on the floor

Throw a needle at a lined floor enough times, count how often it crosses a line, and pi falls out. There is no circle anywhere in the experiment.

probability · Monte Carlo
How fast each way of averaging closes in, as the dimension grows. Relative error against the number of points, both on logarithmic scales, for a regular grid in 1, 4, 8 dimensions and for random points in 8; the grid's lines steepen or flatten with the dimension and the random one does not move from a slope of a half.

The error that does not care how many dimensions

A grid gets rapidly better in one dimension and hopelessly worse in twenty. Random points get better at the same slow rate whatever the dimension, which is why a method that is bad everywhere ends up being the only one that works.

probability · Monte Carlo
Two unbiased estimates of one integral, and their spread. The sharply peaked integrand with the proposal density that follows it, above a strip plot of 200 estimates from each of two methods; the weighted estimates cluster 4.2 times more tightly about the same value.

Sampling where the answer lives

Monte Carlo error cannot be made to fall faster than the square root, so the only thing left to attack is the constant in front of it. Drawing points where the integrand is large, and dividing by how often they were drawn, leaves the answer alone and can shrink the noise many times over.

probability · Monte Carlo
A walk that visits each state as often as its weight says. The target distribution over 12 states with the share of a 40,000-step Metropolis run beside each bar, above the first 300 steps of the walk itself; the two distributions differ by 0.5 per cent in total.

A walk that samples a distribution

When a distribution can be evaluated but not drawn from, a wandering point can be arranged to visit each state as often as its weight says. The rule needs no normalising constant, compares two weights and steps or stays.

probability · Monte Carlo
Points too even to be random. 256 independent random points beside 256 points of a Halton sequence, with the largest mismatch between a box's share of points and its area plotted against the number of points for both.

Points too even to be random

Independent random points clump, and the clumping is what makes the error fall only as the square root. Points chosen to be evenly spread rather than independently beat that rate, and the price is that nothing about them is random at all.

probability · Monte Carlo
Sampling the orders, and how fast the answer arrives. The largest error in the estimated shares against the number of orderings sampled, both on logarithmic axes, with the square-root rate drawn through the first point.

Too many orders to list

The rule is an average over every order the players could have arrived in. At seven players that is five thousand orders and at twenty it is more than there are seconds in the age of the universe — so the average is sampled, and the error falls at a rate that can be measured.

applied · Shapley value
Measuring a closed curve with inlets by throwing lines at it. A curve inside a disc crossed by a sample of random lines with each crossing marked, beside the mean number of crossings and the length it implies against the true length.

A length counted by the lines that cross it

Throw straight lines at random across a curve and count how often they cross it. The average count, times π times the radius of the target, is the curve's length — for a wiggly closed curve, a spiral or a snowflake alike, with no following of the curve and no derivative anywhere. It is Crofton's formula of 1868, and it measures length the way a map-reader's ruled transparency does.

analysis · Arc length
400 random points and their longest rising chain, 34 long. 400 uniform random points in a unit square with the longest chain increasing in both coordinates marked: 34 points, against 2√n = 40.0.

The longest climb of a shuffle

Erdős and Szekeres guarantee that any n distinct numbers hold a climb or a fall of √n, and there are orders that allow nothing more. Shuffle a deck at random instead and the longest climb is almost exactly 2√n — with fluctuations of size n to the power one-sixth, distributed exactly as the largest eigenvalue of a large random matrix.

discrete · Ramsey theory
Where a random walk from the centre leaves the snowflake. 60,000 walks on spheres from the centre of the level-6 snowflake; the most-visited 10% of 768 boundary pieces receive 62.7% of the walks; one walk of 9 jumps drawn.

Where a random walk leaves the snowflake

Start a random walk at the centre of the Koch snowflake and record where it first touches the edge. The edge has dimension 1.26, but the places the walks arrive form a set of dimension one: 60,000 walks spread their entropy by ln 3 a level, not ln 4, and the busiest fifth of the edge takes nine tenths of them. Makarov proved in 1985 that it must be so for every simply connected region in the plane.

analysis · Measure
One random path estimates the whole tree. probe columns 4,2,5,3,6,0; choices 8,5,3,1,2,1; estimate 769; exact 2057.

One random path down a search tree

Before running a search that may take a week, it is worth knowing whether it will take a week or a century. Donald Knuth's answer, from 1975, is to walk down the search tree once at random, multiply the numbers of choices met on the way, and add up the products: the result is, on average, exactly the size of the tree. On the eight-queens tree one path guesses 769 against a true 2,057 and twenty thousand paths average to within a tenth of a per cent. On a tree built to hide its bulk, the same unbiased estimate is almost always wrong by a factor of thousands.

probability · Monte Carlo
Shrinking beats the nearest point at every true mean. p=3: ratio at |θ|²/p = 0, 1, 5: 0.667, 0.863, 0.976; p=5: ratio at |θ|²/p = 0, 1, 5: 0.400, 0.732, 0.931; p=10: ratio at |θ|²/p = 0, 1, 5: 0.200, 0.621, 0.886; p=25: ratio at |θ|²/p = 0, 1, 5: 0.080, 0.549, 0.855

The nearest point is not the best guess

Measure ten unrelated quantities once each, with noise, and report the measurements. Nothing seems better. Yet pulling all ten towards nought by an amount the data choose gives a smaller total error whatever the true values are — in three dimensions or more, and never in one or two. The reason is a right angle: in many dimensions noise is nearly perpendicular to the truth, so a measurement is always too long, and the best correction is the shadow of the truth on it.

algebra · Inner product
How often a table of random signs is singular. n=2: 0.5000 (parallel 0.500); n=3: 0.6250 (parallel 0.625); n=4: 0.6602 (parallel 0.660); n=5: 0.6558 (parallel 0.628); n=6: 0.6270 (parallel 0.547); n=7: 0.5810 (parallel 0.442); n=8: 0.5216 (parallel 0.329); n=9: 0.4515 (parallel 0.234); n=10: 0.3757 (parallel 0.154); n=11: 0.2963 (parallel 0.0978); n=12: 0.2274 (parallel 0.0619); n=13: 0.1639 (parallel 0.0361); n=14: 0.1136 (parallel 0.0217); n=15: 0.07550 (parallel 0.0127); n=16: 0.04668 (parallel 0.00683); n=18: 0.01639 (parallel 0.00229); n=20: 0.004725 (parallel 0.000683)

How often a table of random signs is flat

Fill a square table with random plus and minus signs and ask whether its determinant is nought. For four rows the answer is yes two times in three. The chance then falls, and since 2020 it has been known to fall at exactly the rate of the dullest accident, two rows or columns equal or opposite. The conjecture is that this accident is, in the end, the whole story. Every size a computer can reach says otherwise, and the theory says the computer has not gone far enough.

algebra · Determinant
How often a game picked at random has a core. n=3: 0.20:1.000 0.24:1.000 0.28:1.000 0.32:1.000 0.36:1.000 0.40:1.000 0.44:1.000 0.48:1.000 0.52:1.000 0.56:1.000 0.60:1.000 0.64:1.000 0.68:1.000 0.72:0.997 0.76:0.993 0.80:0.980 0.84:0.958 0.88:0.933 0.92:0.899 0.96:0.872 1.00:0.833; n=4: 0.20:1.000 0.24:1.000 0.28:1.000 0.32:1.000 0.36:1.000 0.40:1.000 0.44:1.000 0.48:1.000 0.52:0.991 0.56:0.937 0.60:0.843 0.64:0.737 0.68:0.634 0.72:0.517 0.76:0.424 0.80:0.323 0.84:0.258 0.88:0.182 0.92:0.134 0.96:0.091 1.00:0.066; n=5: 0.20:1.000 0.24:1.000 0.28:1.000 0.32:1.000 0.36:1.000 0.40:1.000 0.44:0.994 0.48:0.904 0.52:0.725 0.56:0.438 0.60:0.245 0.64:0.116 0.68:0.059 0.72:0.022 0.76:0.009 0.80:0.002 0.84:0.002 0.88:0.001 0.92:0.001 0.96:0.000 1.00:0.000

A core is a rare thing to find at random

A game has a core when the whole can be shared so that no group would do better on its own, and Bondareva and Shapley turned that into a finite list of checks. For three players there are five checks; for four, forty-one; for five, 1,291. Draw the coalitions' values at random and the list wins: a third of three-player games fail, nineteen four-player games in twenty, and not one five-player game in two thousand passes. The cores that theorems promise come from structure, and structure is exactly what a random game lacks.

applied · The core
Three ways to draw a random chord. Samples of 220 chords from each of three procedures: random ends, random radius and random midpoint; chords longer than the triangle's side are coloured; chances 1/3, 1/2 and 1/4.

What a random chord is

Draw a chord of a circle at random. How often is it longer than the side of the inscribed equilateral triangle? Pick two random points on the rim and the answer is 1/3. Pick a radius and a random point on it, and the answer is 1/2. Pick a random midpoint in the disc, and the answer is 1/4. All three calculations are correct, and Bertrand published them in 1889 to warn that the phrase had no meaning. Eighty-four years later Jaynes argued that one answer is right after all.

probability · Monte Carlo
Where a randomly broken stick can land. De Finetti's triangle of all ways to break a stick into three pieces, with 500 random breaks: the 118 in the shaded middle quarter, where every piece is shorter than half the stick, are the breaks whose pieces form a triangle.

A stick broken in three

Break a stick at two random points and the three pieces form a triangle one time in four — a fact that can be read off a picture without integrating anything, because the pieces are a point spread evenly over a triangle and the good breaks fill its middle quarter. With more pieces the same picture gives 1 − n/2ⁿ⁻¹, which is also the chance that n random points on a circle avoid every semicircle. But 'break at random' is ambiguous: cut once and then cut the longer piece, and the answer is 2 ln 2 − 1.

probability · Expectation
Thirteen votes in twenty-five, and 1 to 4 seats. clustered voters: seats over 4006 maps from 1 to 4.

Every map of twenty-five voters

Put twenty-five voters on a five-by-five grid, thirteen red and twelve blue, and divide them into five districts of five connected squares. There are exactly 4,006 ways to do it, and the same votes give red one seat, two, three or four depending on which map is drawn. Listing every map turns the accusation of gerrymandering into a measurement: how unusual a given map is among all the maps that could have been drawn — and the answer depends on where the voters live as much as on how many there are.

applied · Voting rules

Named alongside it

The objects these essays reach for when they reach for this one.

SamplingConvergence rateExhaustive searchVarianceEstimator biasExpectationIntegralIntegral geometryProbability densityUnbiased estimatorUniform distributionImportance sampling

All concepts