Probability — page 5
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 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 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 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.
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.
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.
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.
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
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 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 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 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.
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.
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
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 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.
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.
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.
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.