z-of-a Zone of Avoidance

enumerative combinatorics probability theory

Five Numbers Force Three

Any five distinct numbers contain three that rise in order or three that fall in order. Erdős and Szekeres computed the exact length that forces it, which turns a run into a measurement of the window rather than of the series.


The diagnostic model
You are seeing
  • A thesis rests on a run of consecutive moves in one direction
  • A pattern is quoted without the length of the window it was found in
  • A screen returns matches and nobody computed how many the window size alone would force
  • The pattern was identified by looking at the series rather than specified beforehand
  • A backtest reports the best rule found and not the number of rules searched
The mechanism
Above a computable size a structure contains a named pattern regardless of what produced it, so the pattern's presence measures the size of the window rather than anything about the process, and the threshold exists only for a pattern specified before the search.
The older apparatus
Combinatorics, which computes the exact size at which a named pattern becomes unavoidable and proves the boundary by exhibiting the largest arrangement that still escapes it.
The false friend
The gambler's fallacy, which runs the other way. A long streak in an independent process is genuinely rare and correctly registered as rare, and the error there is expecting compensation. Rarity under a model and unavoidability without one are different findings that attach to the same run.
The discriminating test
Compute the length at which the pattern in question is forced and compare it with the window it was found in. Above that length its presence is guaranteed and carries nothing. Below it, the pattern is a finding.
On your own data
For each pattern a live thesis rests on, compute its Erdős–Szekeres bound and the length of the window it was found in, and record the ratio. Separately, count how many of the patterns were specified before the data was examined.

Take any five distinct numbers, in any order, from anywhere.

Three of them rise in order, or three of them fall in order. There is no arrangement that avoids both, and four numbers are not enough to force it.

Paul Erdős and George Szekeres published the general result in Compositio Mathematica in 1935. Any sequence of distinct reals of length at least (r−1)(s−1)+1 contains an increasing subsequence of length r or a decreasing one of length s. Setting both to three gives five.

Nothing in the statement is about probability. There is no process, no distribution, no assumption of independence. The numbers can have been generated by anything at all, or by nothing, and the run is still there.

The general form is Ramsey’s theorem #

The same shape appears wherever a structure is large enough. Colour every edge of a complete graph on six vertices red or blue, in any way at all, and some triangle comes out all one colour. Five vertices is not enough, and the arrangement that escapes it is a pentagon with its edges one colour and its diagonals the other.

That is R(3,3) = 6, and the exact values run out almost immediately.

Each one costs two proofs pointing in opposite directions. The upper bound argues that every colouring at that size contains the target. The lower bound is settled by producing an arrangement one size down that escapes it, which is why the pentagon is in the literature rather than an argument about pentagons.

R(4,4) is eighteen. R(4,5) was pinned to twenty-five by Brendan McKay and Stanisław Radziszowski in 1995. R(5,5) is not known and sits somewhere between forty-three and forty-six.

In 1997, McKay, Radziszowski and Exoo constructed 656 distinct two-colourings of a forty-two-vertex graph with no monochromatic five-clique, and conjectured forty-three on that evidence. It is still a conjecture.

Joel Spencer records Erdős putting the difficulty as an ultimatum. Aliens demand R(5,5) or they destroy the planet: marshal every computer and every mathematician. Aliens demand R(6,6): attack the aliens.

Seventeen observations force a run of five #

Up seven months running. Five consecutive quarters of margin expansion. Nine of the last eleven.

A monotone run is the most quoted pattern in market commentary, and it has a forcing length. Seventeen distinct observations guarantee a monotone run of five. Thirty-seven guarantee a run of seven, and the arithmetic is the theorem’s own.

So a run of five inside a window of twenty is not a property of the series. Twenty is past seventeen, and something of that shape had to appear.

There is a precision here worth keeping, because it cuts the other way as often as not. The theorem forces a rising run or a falling one and does not say which. Seventeen observations do not guarantee five consecutive up months. They guarantee five consecutive months in one direction.

A directional streak is the stronger claim, and it is the one that gets quoted.

The bound is a floor #

What the theorem supplies is what cannot be avoided. Real series produce more than that, because prices are not distinct reals in general position — there are ties, and there is autocorrelation, and both manufacture runs beyond the unavoidable minimum.

So the forcing length is the wrong number to compare against an observed count. It is the right number to compare against a claim.

It answers one question. Could this have been absent from a window of this size? Above the bound, no.

The second reason points the other way #

The Monte Carlo Casino roulette wheel landed on black twenty-six times in succession on 18 August 1913, at odds of roughly one in sixty-eight million on a single-zero wheel. Gamblers bet progressively larger sums against black as the run extended, on the reasoning that a correction had become due, and lost heavily as it continued.

The error is precise and worth stating precisely. A long unbroken streak is rare, and the gamblers registered that part correctly. That the process must compensate is false, because compensation would require the next spin to depend on the history, which is exactly what independence rules out.

Set the two side by side. Rarity under a model, and unavoidability with no model at all.

Both attach to the same observed run, they point in opposite directions, and neither licenses the inference the run is usually carrying.

The threshold needs the pattern named first #

Erdős–Szekeres answers a question that was posed in advance. It states how long a sequence must be to force a monotone run of length r, given that somebody asked about monotone runs of length r.

There is no forcing bound for whatever pattern a person notices.

That is where nearly every market pattern comes from. The shape was not specified and then looked for. Somebody looked, and named what was there, and the family of shapes that would have been named instead is unbounded and undeclared.

No threshold can be computed against an undeclared family. That is not a gap in the mathematics. The question was never put in the form the theorem answers, which makes the cheap version of this test something other than arithmetic.

Ask when the pattern was specified.

McKay, Radziszowski and Exoo built 656 colourings of a forty-two-vertex graph to support a conjecture about a single number, and it is open thirty years later.

A screen returns its matches in under a second, and the count of what was searched is not in the output.

That is the number that would have made the matches mean something.

Diagram: Five Numbers Force Three

Questions

How long does a series have to be before a run stops being informative?

It is computable for a named run length. The Erdős–Szekeres theorem, published in 1935, says any sequence of distinct reals of length at least (r−1)(s−1)+1 contains an increasing subsequence of length r or a decreasing one of length s. For runs of three either way, five observations force it. For runs of five, seventeen. Above the bound the pattern had to be there, and its presence is a fact about the window.

Does the bound apply to a run in a specific direction?

No, and the distinction matters more than it looks. The theorem forces a rising run of the stated length or a falling one, and does not say which. Seventeen observations guarantee a monotone run of five in some direction. They do not guarantee five consecutive up months. Commentary that quotes a directional streak is claiming the stronger thing, and the bound it needs is not the one usually available.

Is this the same as saying a streak is due to end?

No, and that is the opposite error. The Monte Carlo Casino roulette wheel landed on black twenty-six times running on 18 August 1913, at roughly one chance in 68.4 million. Gamblers bet progressively against black on the reasoning that a correction was owed, and lost. A long streak in an independent process is genuinely rare, and independence means nothing compensates for it. Rarity under a model and unavoidability without one are separate findings.

Why do these thresholds get so hard so fast?

R(3,3) is 6 and R(4,4) is 18, and R(4,5) was pinned to 25 only in 1995. R(5,5) is still unknown, trapped between 43 and 46. In 1997 three researchers constructed 656 distinct two-colourings of a forty-two-vertex graph containing no monochromatic five-clique, and conjectured 43 on that basis, and the conjecture is open. Joel Spencer records Erdős saying that if aliens demanded R(5,5) humanity should marshal every computer it has, and if they demanded R(6,6) it should attack the aliens.

What is the cheap version of this test?

Ask when the pattern was named. A forcing bound exists for a pattern specified in advance, because the arithmetic needs to know what shape it is counting. There is no bound for whatever somebody notices while looking, and that is where nearly every market pattern comes from. The absence of a computable threshold there is not a technical gap. Erdős and Szekeres could state a bound in 1935 because somebody had already asked about monotone runs. The question was never put in that form.