Field

Probability — page 5

Randomness with a shape.
When to stop tossing a coin. 1:1 2:2 3:3 4:2 5:3 6:2 7:3 8:2 9:3 10:4 11:3 12:4 13:3 14:4 15:3 16:4 17:5 18:4 19:5 20:4 21:5 22:4 23:5 24:4 25:5 26:4 27:5 28:4 29:5 30:6

When to stop tossing a coin

Toss a fair coin as many times as you like and stop whenever you choose; you are paid the proportion of heads so far. Stopping after a first head pays one, so the only question is what to do after a tail. Waiting for the first moment heads lead pays exactly π/4 on average. Waiting for a lead of two pays exactly ln 2. The best possible rule pays about 0.79295, a number known to six decimal places only since 2013 — and it stops when the lead reaches about 0.84 times the square root of the number of tosses, a constant that comes from Brownian motion.

The median has a bell of its own. normal: median sd 0.1238 (pred 0.1247), mean spread 0.0985; laplace: median sd 0.1071 (pred 0.0995), mean spread 0.1405; cauchy: median sd 0.1588 (pred 0.1563), mean spread 1.5006

The middle value has a bell of its own

The central limit theorem is a theorem about sums, and the median of a sample is not a sum of anything. It has a bell all the same: the middle of n draws spreads like 1/(2f√n), where f is the height of the density at the middle — not the variance, which the median never consults. That one number decides when the median beats the average, by a factor of two for a two-sided exponential and outright for the Cauchy law; and where the density is nought at the middle, the bell fails, slowing to a fourth root or splitting in two.

Arcs that overlap and still leave gaps. n=14, a=0.2: starts 0.014,0.017,0.118,0.192,0.232,0.237,0.251,0.428,0.458,0.500,0.510,0.579,0.930,0.931; gaps 1; P(cover) exact 0.34675223.

Arcs that cover a circle

Throw fourteen arcs, each a fifth of a circle, onto the circle at random: together they are nearly three times as long as it, and still a third of the time some stretch is left bare. The chance of covering is an alternating sum over which gaps are too long, found by W. L. Stevens in 1939. Its terms run into the thousands and cancel to almost nothing, and they say that random covering costs a logarithm.

Two losing games with memory that win together. game A: -1.8000; game B: -1.9390; a fair coin chooses: 1.7434; the cycle A B B: 1.9077; ε=0.003.

Two losing games with a memory

Parrondo's first paradox needed a game that watched the player's capital. This one watches nothing but the last two results: a coin that wins nine times in ten after two losses, one time in four after a loss and a win, seven times in ten after two wins. Alone it loses, and so does a slightly unfair coin; played at random together they win. The walk treats every position alike, and the paradox survives — because it was never about position.

How well a trimmed mean estimates the centre, shape by shape. Efficiency of the alpha-trimmed mean for normal: mean 1.000, 10% 0.943, 25% 0.837, median 0.637; logistic: mean 0.912, 10% 0.994, 25% 0.950, median 0.750; contam: mean 0.698, 10% 0.969, 25% 0.901, median 0.697; t5: mean 0.800, 10% 0.989, 25% 0.966, median 0.769; laplace: mean 0.500, 10% 0.669, 25% 0.815, median 1.000; t3: mean 0.500, 10% 0.932, 25% 0.984, median 0.811; cauchy: mean 0.000, 10% 0.419, 25% 0.785, median 0.811.

The best middle when the shape is unknown

The mean is the best estimate of a centre when the data are normal and worthless when they are Cauchy. The median is best for Laplace data and wastes a third of normal data. Between them lie the trimmed means — drop a share from each end, average the rest — and across seven symmetric shapes the best guarantee comes from trimming about 28 per cent from each end, which never does worse than 81 per cent of the best possible. Peter Bickel proved in 1965 that trimming can never cost more than a known factor against the mean, whatever the shape.

What is left in the other box. Banach matchbox remainder distribution for N=50: means p=0.5: 7.0385, p=0.55: 9.9165, p=0.6: 16.1560; at p=0.5 P(0)=0.07959, P(1)=0.07959.

The matches left in the other pocket

A smoker keeps a box of fifty matches in each pocket and picks a pocket at random. When one box is found empty, the other holds about seven, and none and one are exactly equally likely. Favour one pocket by a tenth and the answer is sixteen; give each box five thousand matches and a fair choice leaves seventy-nine while a bias of one in a hundred leaves nearly two hundred — because a fair remainder grows like a square root and any bias makes it grow in proportion, with the change-over at a bias of one over the square root of the box.

Boxes as a permutation. A random permutation of 24 with cycle lengths 11, 7, 5, 1; longest 11.

A hundred prisoners and one shuffle

A hundred prisoners each search fifty of a hundred boxes for their own number, one at a time, with no communication once it starts. If any fails, all are executed. Choosing at random gives them a chance of 8 × 10⁻³¹. There is a rule that gives them 31%, and no rule can do better. Every prisoner's individual chance is still one half: what the rule changes is not how often each succeeds but how those successes line up.

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.

One number for each arm. Gittins indices at discount 0.9 for s successes and f failures on a uniform prior: a fresh arm has mean 0.5 and index 0.7029.

One number for each arm

Several slot machines pay at unknown rates, and each pull both earns and teaches. The problem seems to tangle every machine with every other, and in the 1940s it was thought hopeless. Then John Gittins found that each machine alone has one number, and the rule is to play the highest. An exact search over 1,187,671 states of two arms gets the same value to six places.

A restaurant with room for one parameter. Seeded Chinese restaurants of 60 customers: 0.5: 4 tables, largest 44; 2: 10 tables, largest 17; 10: 22 tables, largest 10.

A restaurant and a shuffled deck

Each new customer sits at a table with chance proportional to the people there, or starts a new one with weight θ. That one rule gives the kinds of species in a catch and the alleles at a gene. At θ = 1 it is exactly the cycles of a shuffled deck, 62.4% of which lie in the longest, and the same shares describe the largest prime factors of a random number.

Where to look after looking and not finding. A prior over a 16 by 12 grid and the posterior after 60 looks by the greedy rule that found nothing: the chance of having found the object by then was 0.425.

Where to look after looking and not finding

A lost object is somewhere on a map of probabilities, and every search that fails redraws the map. Bayes' rule says how: the cell searched loses probability in proportion to how good the search was, and every other cell gains. Looking where the chance of finding it on the next look is highest is provably best, and a search that overrates its own eyesight looks in the wrong place — which is how the wreck of Air France 447 was missed for two years.

One swap splits the long cycle. A shuffle of 100 boxes whose longest cycle has 61 boxes, drawn as a ring; swapping the contents of two boxes 30 steps apart splits it into cycles of 30 and 31, so every cycle has at most 50 and all prisoners succeed.

One swap saves every prisoner

A hundred prisoners following the cycles of a shuffle all survive about 31% of the time. Let a helper look into the room first and swap the contents of two boxes, and they survive every time. With fewer boxes each, more swaps are needed — exactly one per cut a long cycle needs — and the number of swaps a random room demands has an exact distribution.

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.

A family of 16, and the walk that counts it. seed 11: children 2,1,2,2,0,2,1,1,2,0,0,0,0,1,1,0; walk 0,1,1,2,3,2,3,3,3,4,3,2,1,0,0,0,-1

The walk that counts a family

Start with one ancestor, give everyone a random number of children, and ask how big the whole family gets. Visit the family member by member and keep a running total of children minus one: the total is a random walk, and the family is finished at the exact step the walk first drops below zero. A theorem about rotating sequences then gives the size's law in one line, and when each person has on average one child it is Cayley's count of labelled trees, multiplied by e⁻ⁿ/n!.

Four dice that beat each other in a circle. A>B 24/36; B>C 24/36; C>D 24/36; D>A 24/36; means 2.667,3.000,3.333,3.000

Four dice that beat each other in a circle

Bradley Efron's four dice are numbered so that A beats B, B beats C, C beats D and D beats A, each two times in three. Whichever die an opponent picks, there is another that beats it, and the die with the lowest average beats one with a higher average. Rolling two of each reverses half the circle. Three dice can never beat each other more strongly than the golden ratio's reciprocal, 0.618, and an exhaustive search reaches 0.6; four can reach 2/3, which Efron's dice do exactly; no number of dice can reach three in four.

The lost boarding pass as a chain. n=8: P(last seat free) = 1/2

The last passenger gets one of two seats

A hundred passengers board a plane with a hundred seats. The first has lost the boarding pass and sits anywhere; everyone after takes their own seat if it is free and a random free seat if not. The last passenger to board finds their own seat free with probability exactly one half — for a hundred passengers, for two, for any number — and if it is not free, they get the first passenger's seat, never any other. Along the way about four passengers are displaced, and one more than that number is distributed exactly like the number of cycles in a shuffled deck.

Three kerbs filled by cars parking at random. length 24, seeds 7,8,9: cars 17,17,15; mean 17.6899

Cars parked at random fill three quarters of the kerb

Cars of length one arrive at a long kerb and each parks at a random place where it still fits. When nobody else can fit, the cars cover 0.7476 of the kerb — Rényi's constant, an integral with Euler's constant hidden in its tail. Cut the kerb into sites and park cars two sites long, and the answer becomes 1 − e⁻², exactly; lengthen the cars and it falls back towards Rényi's number without ever reaching it.

Twelve people and their friends' friends. 12 people: mean 2.667, friend mean 3.125, 8 with fewer

Why a friend has more friends

Most people have fewer friends than their friends have, on average, and nothing about popularity or bad luck is needed to explain it. Choosing a friend is choosing the end of a friendship, and the well-connected are at the end of many. The gap between a friend's friends and a person's is exactly the variance of the counts divided by their mean: one extra friend when friendships form independently, ten or more when the popular attract the rest. And the same bias that makes the comparison unflattering makes a random friend a good person to vaccinate.

Five serial numbers out of sixty. 16,22,23,27,47 -> 55.40; 9,11,31,42,44 -> 51.80; 10,17,51,53,55 -> 65.00; 25,34,38,48,49 -> 57.80

The largest serial number seen

Allied statisticians in the Second World War estimated German tank production from the serial numbers on captured tanks, and their estimates beat the intelligence reports by a factor of five. The method is simple. The largest serial number seen always falls short of the total, and the shortfall can be estimated: it is about one gap between serial numbers. Adding the average gap gives the best unbiased estimate there is, and its error shrinks like one over the number of tanks seen.

All essays