Two parameters

A switch that counts the jumps

A landmark watch whose switch read its own costs could not tell fast traffic from slow, because what a look reads has the same mean at both paces. A switch that reads the traffic instead — the mean spacing of the last ten times the destination moved more than ten cells — was predicted to reach the corners at one jump in 1,000 and keep the watch at every slower pace. It separates the paces where costs could not: 146.6 cells a query at one jump in 1,000 against the watch's 150.7, and on drifting traffic it never switches off at all. But a count of k events is a reading with a delay of k events and a noise of one part in √k, and no k has both: three stretch ends reach the corners' 142.7 at the fast pace and are off 38% of the slower stream; twenty never misfire and save nothing. And when traffic slows, the events that would show it stop arriving, so the count keeps its fast reading and the switch stays off: 135.8 cells a query on a stream that slows halfway, worse than the corners or the watch.

A watch that switches itself off gave a landmark search’s watch a way to stop. The placement starts at the four corners of a weighted maze; every window of queries the watch prices its landmarks on the last twenty queries against candidates near their destinations, and refits one landmark when the saving pays. Where the destination jumps every thousand queries the watch costs more than the corners, which never look, and the switch was meant to notice that and stop. It noticed, and it also stopped at every slower pace, because what it read — the corners’ advantage on each look’s sample, less the watch’s own spending — had the same mean at one jump in 1,000 and at one in 2,500. The watch’s value arrives in a few large looks after jumps, and any four looks are mostly the others.

That page’s closing section concluded that cost is a poor witness to pace and proposed reading the pace directly. The traffic’s destination moving more than ten cells from where a stretch of traffic began — a stretch end — is a countable event, and the earlier pages already track it to learn the watch’s horizon. A count of events has a known noise: k of them estimate their rate to about one part in k\sqrt{k}. The paces to be told apart differ by a factor of two and a half. The proposal was a switch that keeps the times of the last ten stretch ends, takes the pace as their mean spacing, and keeps the corners with no looking while that spacing is under a threshold between the two paces. It predicted a cost within three cells of the corners at one jump in 1,000, after the first ten thousand queries, and the watch’s own cost at every slower pace. It named the failure: drifting traffic also produces stretch ends, and a fast drift might be read as fast jumps.

The switch

Everything else is the earlier pages’: four maps of 2,500 cells, each a weighted maze, 30,000 queries a stream, the destination jumping to a random open cell on average every 1,000, 2,500, 5,000 or 10,000 queries, or drifting to a neighbour with a chance of 0.001 to 0.03 a query, or changing pace halfway; every search charged the cells it expands, every look and refit its own searches. The watch is the one a horizon the stream can supply built, and every policy, the switches included, is reported at the better of a 1,000-query and a 2,000-query window, the convention the earlier page settled on.

The switch keeps the times of the last k+1k+1 stretch ends — the queries at which the destination was first more than ten cells from where the current stretch began — and at each window takes their mean spacing as the pace. While the pace is under TT queries, it keeps the corners and makes no look; otherwise the watch runs as before. Counting costs nothing, since the destinations are those of queries already served. The proposal’s switch is k=10k = 10 and T=1,600T = 1{,}600, the geometric mean of the two paces. Also run: kk of 3, 5 and 20 at the same threshold, and thresholds of 1,250 and 2,000 at k=10k = 10.

Before any stream, the gamma distribution says what to expect. If stretch ends arrived at random with mean spacing μ\mu, the mean of kk spacings would fall under TT with a computable chance, and that chance is the switch’s error rate: at the slow pace, a false alarm; at the fast pace, a hit. On these streams stretch ends come every 1,121 queries at one jump in 1,000 and every 2,469 at one in 2,500.

The count separates the paces

Counting stretch ends separates the paces where reading costs could not: ten of them bring the watch from 150.7 cells a query to 146.6 at one jump in 1,000 and cost 119.9 against its 116.4 at one jump in 2,500; three stretch ends reach the corners' 142.7 at the fast pace and twenty keep the watch's 116.4 at the slower one, and no count does bothMean cells a query over four maps of 30,000-query streams, the destination jumping at random, every watch at its better window of 1,000 and 2,000 queries; the switches look at their pace reading every window and keep the corners while it is under 1,600 queries. One jump in 1,000: the corners 142.7, watch, ten-cell horizon 150.7, switch on 3 stretch ends 142.3 (off 57%), switch on 10 stretch ends 146.6 (off 48%), switch on 20 stretch ends 149.9 (off 23%). One jump in 2,500: the corners 126.8, watch, ten-cell horizon 116.4, switch on 3 stretch ends 120.7 (off 38%), switch on 10 stretch ends 119.9 (off 15%), switch on 20 stretch ends 116.4. One jump in 5,000: the corners 127.2, watch, ten-cell horizon 98.1, switch on 3 stretch ends 97.4 (off 3%), switch on 10 stretch ends 98.1, switch on 20 stretch ends 98.1. One jump in 10,000: the corners 124.9, watch, ten-cell horizon 80.2, switch on 3 stretch ends 80.2, switch on 10 stretch ends 80.2, switch on 20 stretch ends 80.2.80100120140160one jump in 1,000, 2,500, 5,000, 10,000 queriescells a query1,0002,5005,00010,000the cornerswatch, ten-cell horizonswitch on 3 stretch endsswitch on 10 stretch endsswitch on 20 stretch endsfour maps, 30,000 queries eachcells a query
Fig. 1 Cells a query at each jump rate: the corners, the watch, and switches on 3, 10 and 20 stretch ends. One jump in 1,000: 142.7, 150.7, 142.3, 146.6 and 149.9. One in 2,500: 126.8, 116.4, 120.7, 119.9 and 116.4. One in 5,000: 127.2, 98.1, 97.4, 98.1, 98.1. One in 10,000: 124.9, 80.2, 80.2, 80.2, 80.2.

Counting stretch ends separates the paces where reading costs could not: the proposal’s switch on ten of them brings the watch from 150.7 cells a query to 146.6 at one jump in 1,000, and costs 119.9 against the watch’s 116.4 at one in 2,500 and the watch’s own cost at the two slower paces. The switch on costs had cost 126.1 at one jump in 2,500 and been off for 60% of that stream; the count’s switch is off for 15%.

The prediction is met at the slow paces and missed at the fast one. At one jump in 1,000 the switch was predicted to come within three cells of the corners; it comes within four, 146.6 against 142.7. The proposal’s own arithmetic says why: no reading exists until ten stretch ends have passed, about eleven thousand queries at this pace, and the watch pays its full cost until then. On one map the first reading under the threshold came at 28,000 queries.

Every count trades one pace for the other

Every count of stretch ends buys the fast pace with the slower one: five stretch ends cost 141.7 at one jump in 1,000 and 120.1 at one jump in 2,500, three 142.3 and 120.7, twenty cost 149.9 and 116.4, and the point that knows the pace in advance — the corners at one, the watch at the other — sits at 142.7 and 116.4, out of every count's reachFor each switch, cells a query at one jump in 1,000 against cells a query at one jump in 2,500, four maps: 3 stretch ends under 1,600 queries: 142.3 and 120.7; 5 stretch ends under 1,600 queries: 141.7 and 120.1; 10 stretch ends under 1,600 queries: 146.6 and 119.9; 20 stretch ends under 1,600 queries: 149.9 and 116.4; 10 stretch ends under 1,250 queries: 147.9 and 120.0; 10 stretch ends under 2,000 queries: 146.1 and 119.9; the watch 150.7 and 116.4; the corners 142.7 and 126.8; the better of the two at each pace 142.7 and 116.4.115120125143145148150cells a query at one jump in 1,000cells a query at one jump in 2,5003 ends5 ends10 ends20 endswatchcornersknowing the pacelower and left is better · faint: ten ends under 1,250 and 2,000four maps
Fig. 2 Each switch’s cost at one jump in 1,000 against its cost at one in 2,500. Three stretch ends: 142.3 and 120.7. Five: 141.7 and 120.1. Ten: 146.6 and 119.9. Twenty: 149.9 and 116.4. Ten under 1,250: 147.9 and 120.0; under 2,000: 146.1 and 119.9. The watch: 150.7 and 116.4; the corners: 142.7 and 126.8; knowing the pace: 142.7 and 116.4.

Every count of stretch ends buys the fast pace with the slower one: five stretch ends cost 141.7 cells a query at one jump in 1,000 — under the corners — and 120.1 at one in 2,500, where twenty cost 149.9 and 116.4, and the point that knows the pace in advance, 142.7 and 116.4, is out of every count’s reach. A short count reads early and wrongly; a long count reads late and rightly. The thresholds barely matter: at ten stretch ends, moving the threshold from 1,250 to 2,000 queries changes the cost at either pace by a cell or two.

That a switch on three or five stretch ends comes in under the corners at the fast pace, by a cell, is the one surprise on the plate, and it is smaller than the spread between maps. The switch returns to the corners whenever it is off, so what it adds is the watching it does before its first reading and in the windows where a reading strays over the threshold; those stretches evidently cost the watch no more than they save. It is not a reason to prefer a short count, whose cost at the slower pace is the larger number.

The arithmetic of a count

A count of k events reads the pace to about one part in √k, and the false alarms follow the arithmetic: at one jump in 2,500, where stretch ends come every 2,469 queries on these streams, a reading under 1,600 has chance 31%, 23%, 12%, 4% for k = 3, 5, 10, 20, and the switches are off 38%, 28%, 15%, 0% of the streamFor each count of stretch ends at a threshold of 1,600 queries: the share of the stream switched off at one jump in 1,000 and at one jump in 2,500, beside the chance that the mean of k spacings drawn at random with the streams' own mean spacing — 1,121 and 2,469 queries — falls under 1,600. k = 3: off 57% and 38%; reading under the threshold 80% and 31%; k = 5: off 57% and 28%; reading under the threshold 84% and 23%; k = 10: off 48% and 15%; reading under the threshold 90% and 12%; k = 20: off 23% and 0%; reading under the threshold 96% and 4%.0%25%50%75%100%k = 3k = 5k = 10k = 20upper bar: off at one jump in 1,000 · lower: at one jump in 2,500tick: the chance of a reading under 1,600threshold 1,600 queriesshare of the stream
Fig. 3 For each count at a threshold of 1,600 queries, the share of the stream switched off at one jump in 1,000 and at one in 2,500, beside the chance that the mean of k random spacings with these streams’ mean spacing falls under 1,600. At one in 2,500, for k = 3, 5, 10 and 20: switched off 38%, 28%, 15% and 0%.

The false alarms follow the arithmetic of a count: at one jump in 2,500, where stretch ends come every 2,469 queries, the chance that a mean of k spacings falls under 1,600 is about 30%, 22%, 11% and 4% for k of 3, 5, 10 and 20, and the switches are off 38%, 28%, 15% and nought of the stream. The measured shares run a little above the formula, because one false reading switches the watch off until a reading rises above the threshold again, a stretch longer than one window. At the fast pace the formula’s chance of a correct reading is between about four in five and nearly all, and the switches are off only 23% to 57% of the stream, because the first reading waits for kk stretch ends and the first few thousand queries are spent watching.

So the trade on the earlier plate is not a matter of tuning. A reading from kk events spreads by about one part in k\sqrt{k}, so its chance of straying across a threshold shrinks only slowly as kk grows, and it is not available until kk events have happened. A switch that must be right at both paces within a 30,000-query stream needs enough events to be sure and few enough to be early, and at a pace ratio of two and a half there is no count that gives both.

On one map at one jump in 1,000 the switch on 10 stretch ends has no reading until query 11,000, and is first off at 11,000; the first third of the stream, before enough jumps have been counted, is paid at the watch's priceMap 1 at one jump in 1,000, the switch on 10 stretch ends at a threshold of 1,600 queries, looking every 1,000 queries: its pace reading at each window (11000:1061, 12000:1076, 13000:1076, 14000:1231, 15000:1231, 16000:1398, 17000:1398, 18000:1398, 19000:1398, 20000:1657, 21000:1587, 22000:1587, 23000:1712, 24000:1382, 25000:1382, 26000:1457, 27000:1119, 28000:846, 29000:846), and the stretches it spent off (11000–20000, 21000–23000, 24000–30000).01e+32e+33e+34e+301e+42e+43e+4queriesmean spacing of the last stretch endsthreshold 1,600pale band: switched offmap 1
Fig. 4 One map at one jump in 1,000, the switch on ten stretch ends: its pace reading at each window, the threshold of 1,600 queries, and the stretches it spent switched off. No reading exists until the eleventh stretch end; from then on the reading sits under the threshold for most windows, and the switch is off for them.

On a single stream the delay is plain. The switch on ten stretch ends has nothing to read for the first ten thousand queries or so, and pays the watch’s cost through them; once it has a reading, the reading sits near the stream’s true spacing, under the threshold, and the switch is off for most of what is left. The third of the stream before the first reading is where the three or four cells between it and the corners go.

Why the traffic tells what the costs could not

The two switches differ in what they read, and the difference is the whole of the result. The switch on costs read, at each look, the watch’s own spending against what the corners would have cost on the same twenty queries. That number mixes two things: how often the destination moves, which is the pace, and how often the watch finds nothing worth a refit, which is a property of the watch. A refit priced before it is made built the watch to look every window and refit only when a refit pays, so most looks at every pace find nothing, and the switch on costs read those idle looks as the corners winning. Its mean reading was the same at the two fast paces because the idle looks dominate both.

A stretch end has no such mixture. It happens when the destination moves, whatever the watch is doing, and it is counted from the queries already served at no cost to anyone. Its rate is the pace and nothing else: 1,121 queries between stretch ends at one jump in a thousand, 2,469 at one in 2,500, 4,799 and 9,094 at the two slower paces, each within an eighth of the jump rate itself. A reading made of those numbers can only be wrong by being too few, which is a noise the arithmetic of a count describes exactly, and not by measuring the wrong thing.

That is why the count can be trusted where the costs could not, and also why it inherits a count’s limits. It knows the pace only as well as the events that have happened, and starting from the corners is the reminder that a watch begins every stream knowing nothing: the corners are its placement until the first refit, and the count’s switch is the watch until its first reading. Neither has evidence before the stream supplies it, and the stream supplies events at the pace being estimated, slowest when they are most needed to show a slowing.

Drifts, and traffic that slows

On drifting traffic no count of stretch ends ever switches the watch off: every switch costs exactly the watch’s 107.4, 120.7, 108.6 and 123.7 cells a query at the four step chances. The proposal’s named failure does not occur. A destination that moves one cell at a time needs, on average, about a hundred steps to wander ten cells from where it started, and at the fastest drift, one step in thirty-three queries, that is thousands of queries; over four maps the drifting streams produced sixteen stretch ends at the fastest rate and none at the two slowest. A pace read from them is never under 1,600, and the watch, which saves thirty to thirty-five cells a query over the corners on drifting traffic, is never switched off.

A count of stretch ends cannot see traffic slow down: on a stream that jumps every 1,000 queries and then every 10,000, the switch on ten stretch ends costs 135.8 cells a query, more than the corners' 133.2 and the watch's 127.4, because in the slow half stretch ends almost stop and its reading keeps the fast half's pace; on the reverse stream it costs 124.6 against 123.8Mean cells a query over four maps on streams that change pace at 15,000 queries. 1,000 then 10,000: the corners 133.2, watch 127.4, 3 stretch ends 128.9 (off 57%), 10 stretch ends 135.8 (off 47%), 20 stretch ends 127.4. 10,000 then 1,000: the corners 132.9, watch 123.8, 3 stretch ends 121.1 (off 32%), 10 stretch ends 124.6 (off 13%), 20 stretch ends 123.8.110120130140fast then slow: the corners133.2fast then slow: watch127.4fast then slow: 3 stretch ends128.9 · off 57%fast then slow: 10 stretch ends135.8 · off 47%fast then slow: 20 stretch ends127.4slow then fast: the corners132.9slow then fast: watch123.8slow then fast: 3 stretch ends121.1 · off 32%slow then fast: 10 stretch ends124.6 · off 13%slow then fast: 20 stretch ends123.8cells a query; the axis starts at 110pace changes at 15,000
Fig. 5 Streams that change pace at 15,000 queries. Fast then slow: the corners 133.2, the watch 127.4, three stretch ends 128.9, ten 135.8, twenty 127.4. Slow then fast: 132.9, 123.8, 121.1, 124.6 and 123.8.

A count of stretch ends cannot see traffic slow down: on a stream that jumps every 1,000 queries and then every 10,000, the switch on ten stretch ends costs 135.8 cells a query, more than the corners’ 133.2 and the watch’s 127.4. In the fast half it switches off, as it should. In the slow half stretch ends come every ten thousand queries, so in the remaining fifteen thousand there are one or two, and the reading — the mean spacing of the last ten — still holds eight or nine fast spacings and stays under the threshold. The switch keeps the corners through the slow half, where the watch would have saved a third of their cost.

This is the failure the proposal did not name, and it is structural. A count reads the pace from events, and slowing down is the absence of events. Every other failure on these plates is a matter of degree — a delay, a noise — but this one has no degree: a reading made only of events that have happened cannot register the events that have stopped. On the reverse stream, slow then fast, the switches do what they do at steady paces, and the shorter counts beat the watch by two or three cells.

What a switch needs to know

Summed over the four paces, the watch pays 8.0 cells a query more than knowing the pace would, almost all of it at one jump in 1,000; the best count, 5 stretch ends, pays 2.7, and the corners 84.3For each policy, cells a query beyond the better of the corners and the watch at each jump rate — one jump in 1,000 142.7, one jump in 2,500 116.4, one jump in 5,000 98.1, one jump in 10,000 80.2 — and the sum. The corners: 0.0, 10.4, 29.2, 44.7; 84.3 in all. The watch: 8.0, 0.0, 0.0, 0.0; 8.0 in all. 3 stretch ends: -0.4, 4.4, -0.7, 0.0; 3.2 in all. 5 stretch ends: -1.0, 3.7, 0.0, 0.0; 2.7 in all. 10 stretch ends: 3.9, 3.5, 0.0, 0.0; 7.4 in all. 20 stretch ends: 7.2, 0.0, 0.0, 0.0; 7.2 in all. 10 stretch ends under 1,250: 5.2, 3.6, 0.0, 0.0; 8.8 in all. 10 stretch ends under 2,000: 3.4, 3.5, 0.0, 0.0; 7.0 in all.the corners84.3the watch8.03 stretch ends3.25 stretch ends2.710 stretch ends7.420 stretch ends7.210 stretch ends under 1,2508.810 stretch ends under 2,0007.0excess at 1,000, 2,500, 5,000, 10,000: dark, green, mid, palecells a query beyond knowing the pacesummed over four paces
Fig. 6 For each policy, the cells a query it pays beyond the better of the corners and the watch at each jump rate, and the sum over the four. The watch pays 8.0, all at one jump in 1,000; the corners 84.3, all at the slower paces; the best count, five stretch ends, 2.7.

Summed over the four steady paces, the watch pays 8.0 cells a query more than a policy that knew the pace, all of it at one jump in 1,000; the switch on five stretch ends pays 2.7, a third of that; the switch on ten pays 7.4; the corners 84.3. On steady traffic a count of a few stretch ends removes two thirds of the watch’s excess, which the switch on costs could not do at any setting. A watch that looks less and its successor spent two pages establishing that the watch’s own records cannot tell it the pace; the traffic’s records can, roughly and late.

The switch needs to know two things the count gives it in opposite proportions: whether the traffic is fast now, and whether it has stopped being fast. The first needs a few events; the second needs the absence of events to count as evidence. What the queries know that the map does not found a query log worth reading exactly where it is not uniform, and a stretch end is the most non-uniform thing in the log; its absence is the most uniform, and it is the part of the evidence a count throws away.

Where these streams stop

One threshold rule. The switch compares a mean of spacings with a threshold. A rule that weighted recent spacings more, or compared the latest spacing alone with the mean, would read changes of pace sooner and noise more.

A stretch defined at ten cells. A stretch ends when the destination is more than ten cells from where it began, the distance a placement after the traffic moved found a fitted placement stops helping, and the candidates the watch prices are the four nearest the recent destinations, as the candidates near where the queries end chose them. A smaller distance would count drift steps as events and bring back the failure the proposal feared.

Four maps. Every number is a mean over four maps. At one jump in 1,000 the switch on ten stretch ends was first switched off between 9,000 and 28,000 queries depending on the map, and its cost on one map is not its cost on another.

Still open: a reading that counts the silence

The count’s one structural failure is that it cannot see events stop. The fix is to let the time since the last stretch end enter the reading. A spacing that is still open — the queries since the last stretch end — is a lower bound on the next spacing, and once it exceeds the mean of the recorded spacings it is evidence that the pace has slowed, as strong as a recorded spacing of that length would be.

The measurement that follows gives the switch a reading that is the mean of the last k−1k - 1 recorded spacings and the open one whenever the open one is longer than their mean, so that a stream that has gone quiet raises its own reading, and runs it on every pace and on both streams that change pace. The prediction is that on the stream that slows halfway the switch on ten stretch ends turns the watch back on within about four thousand queries of the slowing, costing about 129 cells a query instead of 135.8, and that nothing changes on steady traffic, where an open spacing rarely exceeds the mean for long. It could fail at the fast pace, where a single long gap between jumps — one in twenty at this pace is longer than three thousand queries — would raise the reading over the threshold and switch the watch back on for a stretch of traffic that is still fast. The question is whether a switch can read silence without reading every lull as a change of pace, which is the same question the count answered for events, asked of their absence.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

The objects this essay names

Each one links to every other essay that touches it.

Break-evenHeuristic searchLandmarkParameter choiceSamplingShortest path