Field

What is taught wrongly

The comparisons that are made without units, the averages quoted without their distributions, and the bounds treated as predictions of speed.
mean 494599th 60304,2825,4136,543comparisonsruns600 independent random inputs, n = 512worst run 1.32× the mean

The words "on average" are not a number

Why an average-case complexity claim is a statement about a distribution, what the distribution behind randomised quicksort actually looks like, why the tail matters more than the mean in most systems, and three different things the word "average" is used for.

first-element pivot130,816 on sortedmedian of three5088 meanrandom pivot4937 meanblue bar: range over 400 random inputs · marker: the already-sorted inputn = 512a bad case that cannot be chosen is a different kind of bad case

What randomising the pivot buys

What a randomised pivot actually guarantees, why average-case and expected-case are different claims, what median-of-three does and does not fix, and the input where no pivot rule helps at all.

1234560.000.250.500.75formulameasuredload factor αprobes per insertion8,192 slots, mean of 8 fills, seeds stated in lib/structures.jstwo routes agree to 2.3%

The probe formula nobody checks

Knuth's linear-probing formula checked against tables actually filled, the finite-size error measured across table sizes and load factors, and the wrong-formula mistake that looks exactly like a broken hash function.

peak slots held at once, logarithmic18645124096Insertion sort11Selection sort11Bubble sort11Heapsort11Shellsort11Quicksort, median of three14log nQuicksort, random pivot32log nQuicksort, first-element4,097nMerge sort with a cutoff4,106nMerge sort4,110nn = 4,096, already sorted inputone slot = one array element or one stack frame

In place is a claim, and it is usually wrong about quicksort

What "sorts in place" turns out to mean once auxiliary space is counted rather than asserted, the input on which quicksort needs as much scratch as merge sort, and a space claim the fit refused.

quantilepromisedone summarymerge of 8q = 0.5100.01418q = 0.920.0183q = 0.992.005overq = 0.9990.214overrank error, in items out of 20,000ε = 0.01 · high-biased · 8 shards, round2 of 4 quantiles over the single summary's promise

The promise that does not survive the tree

What a quantile summary's error guarantee becomes when the summaries are merged, why the merged bound is a sum rather than a maximum, and how much space a merged summary fails to give back.

least recently usedthe offline optimumA loop over 7 blocks35 accesses35113.18×Random over 7 blocks35 accesses971.29×A straight sweep35 accesses35351.00×B = 8, M = 48 (M/B = 6)3.2× on the loop

The block that is not a block

The external-memory model's honest limits — prefetching, concurrency, the hierarchy, read/write asymmetry and the replacement policy — and which of this field's claims survive each of them.

46810120.010.1bits per element (m / n)false-positive ratemeasured(1 − e^(−kn/m))^kfrom the bits set60,000 absent-key queries per point, seed 80800 false negatives at every size

The formula everybody sizes filters with

The two approximations hidden in the Bloom filter sizing formula, which of them survives measurement, and why benchmarking a hashed structure on consecutive integers measures the wrong thing in a direction that is hard to guess.

average 8.001,0242,048bucket, 0 to 255keys in the bucketmultiply–shift · keys built for this hashworst bucket 2,048 against 8.0

The adversary who knows the seed

Why seeding a randomised algorithm deterministically for reproducibility removes the property the randomisation was for, how completely it removes it, and what to do about the tension.

W = 256even256–256Poisson225–285bursty256–256drifting79–1,736items held inside the time windowD = 2.56 s · 1 ms clockW would be 256, always

The window that is not full

What happens to a space bound when the number of items in the window becomes a random variable — how far the occupancy swings on ordinary streams, and why sizing for the mean is undersizing by a factor of seven.

three-entry rule (as shipped, 2002–2015)1414101410314103141054+14+10+3+2+4final stack: 14, 10, 5, 414 is not > 10 + 5 — the invariant is brokenfour-entry rule (Java, after the proof)141410141031410333+14+10+3+2+4final stack: 33every triple satisfies the invariantrun lengths 14, 10, 3, 2, 4both outputs are correctly sorted

The invariant that was wrong for seven years

Constructing the smallest input that breaks Timsort's shipped merge invariant, and what it means that a correct sort can have a broken policy nothing observes.

0.1250.30.50.70.80.90.99probability of the dominant symbolbits per symbol0.01.63.2one bit per symbolHuffmanArithmeticEntropy H₀model: order 0 · 16,384 symbols per point8.7× at p = 0.99

The optimal code that is beaten

What Huffman's optimality theorem actually claims, why a prefix code cannot spend less than one bit on a symbol worth 0.152, and the two escapes — blocking symbols and abandoning symbol boundaries entirely.

1101001,0000.111010010³true count of the keyrelative errorheaviest keyrarest key4×64 counters · 8,192 bits · Zipf s = 1.1 · 3,528 distinct keys at 702 positions4.11% to 34100%

The guarantee that is one query wide

The four separate claims inside every sketch guarantee, three of which are usually dropped — within epsilon of what, with what probability, per what, and measured against which stream.

10³10⁴capacity Wsubproblems given a valueBottom-up table · 1.00Top-down, reachable only · 0.14one unit = one subproblem given a valuesubproblems given a value, W from 200 to 3200

A table wider than its input

What pseudo-polynomial means, why the encoding is part of the bound, and how rounding the values buys a table whose size no number in the input can move.

Count-Min 4×64exact184 under16 overrms 42Count-Sketch 4×64-174-8708717499 under101 overrms 13general turnstile · insertions and deletions, counts may go negative · counts exact8,192 bits each

When the stream takes it back

The turnstile model, the strict turnstile that sits between it and the cash register, and what happens to a one-sided guarantee when the model it was proved in is left behind.

answered 4,1900%25%50%75%100%11.794,190value, logarithmicfraction of the stream at or belowrank ±2%value 24.9–4,190answered 1553.5% out20,000 values · Pareto, α = 1.2 — a heavy tail · Greenwald–Khanna, ε = 0.02rank 0.10% · value 1553.5%

A promise about the rank is not a promise about the value

Rank error against value error, why the two coincide only on a uniform distribution, and the measured reversal in which the summary with the better guarantee returns the worse answers.

the same 16 patterns, one of them shortenedshortest 1658.4%mean shift 3.15shortest 1262.8%mean shift 2.99shortest 869.7%mean shift 2.64shortest 680.5%mean shift 2.35shortest 493.4%mean shift 1.98shortest 399.2%mean shift 1.71shortest 2100.0%mean shift 1.3716 patterns, 15 of them 16 characterstext 20,000

The ceiling the shortest pattern sets

Why Commentz-Walter's advantage is a property of the pattern set rather than of the algorithm — the ceiling, where it crosses the one-pass matcher, and the two counts that disagree about where.

100.0010.010.1fraction of the text proposedlog_4 n = 7.101234,56,7seed length, characters · errors allowed abovepattern 24 · text 20,000 · four symbolsrings: the closed form

The filter that proposes everything

Where a seed-and-extend filter stops paying — the two thresholds, the closed form the candidate count follows, and why a longer text does not dilute the problem.

unit cost — triples broken0.02%unit cost — pivot bound failed0.02%log-odds on a keyboard walk — triples broken6.61%log-odds on a keyboard walk — pivot bound failed13.22%42,840 triples per model, enumerated0.02% shown where the true rate is zero

A distance that is not a distance

Which of a metric's properties survive a substitution matrix and which does not, measured by enumeration, and what a pivot filter over a non-metric score silently gets wrong.

2585167741,032020,00040,000arrivals so farcountSpace-Saving's floorMisra-Gries's decrementsboth 93840,000 prefixes, 0 disagreementsk = 32 against k = 31

Two structures that are one

The Space-Saving and Misra-Gries summaries are the same state read two ways — the shift that converts one into the other, why it is k − 1 and not k, and what actually differs between them.

Greenwald–Khanna7,008 bits802high-biased55,008 bits802t-digest6,144 bits675the truth, 802ε = 0.01, δ = 100 · 40,000 valuesq = 0.52

The digest that promises nothing

What a structure with no guarantee actually delivers — the arcsine scale, the accuracy that degrades towards the tail rather than improving, and an answer that never occurred in the data.

0.000.250.500.751.00stationarydepartingburstydriftingprediction ÷ measurement, as a factorshare of the top k that moves between halves8 shards · round · k = 327.1× out where the statistic reads 1.00

The histogram that cannot see the order

Where a merge-damage prediction computed from arrival frequencies breaks down, why a drifting distribution defeats it, and what a warning statistic can and cannot see.

1.821251.951.431752.731.302253.521.292503.911.183755.861.005128.00longest block ÷ shortestarrivals per block, and bursts per blockpart of a bursta whole numberbursts of 64 · 8 blocks · 20,000 arrivalsdispersion 0.57 and a ratio of 1.00

The boundary that hides the burst

Why a block boundary that fires on an arrival count is a sampler, what it aliases against, and how a structure can report exactly nothing about a stream that is visibly uneven.

1 — no differencethe whole array reviewed1.03×only this batch reviewed1.22×a block window, which does alias1.48×20,000 arrivals · period 50 · cyclethe instrument reads 1.48 where an alias is known to be

The sampler that cannot alias

Why a compression schedule cannot alias against a periodic stream even though a block boundary can, what separates the two, and how a negative result of this kind has to be checked.

01002003004005006007008009001000roundloads 1.0×blockedloads 1.0×hashedloads 17.6×worst error over the heaviest keyschaintreesmallest-firstlargest-first32 shards · k = 32 · 40,000 arrivalseven 1.00× · uneven 2.7×

A parameter that waits for another

Why a merge fold's shape is worth nothing under an even partition and a factor of 2.7 under an uneven one, and what that says about measuring one parameter at a time.

10⁴10⁵10⁶characters in the collectionshuffled ÷ real, phraseswhat the order is wortha million characters of prose · phrases per characterx1.37 over the sweep

The half of a fall that is the logarithm

What a control does to a size sweep, why one measure of repetition carries a logarithm and the other does not, and how to tell which of your numbers is a property of your data.

0.60.81.01.21.41.61.84φ share 0.908φ share 0.8516φ share 0.8032φ share 0.7564φ share 0.70predicted ÷ measuredshards, mlevel floors, uncorrectedleaf floorslevel floors, correctedk = 32 · hashed · 40,000 arrivalsworst 22% against 73% and 46%

The floor a merge does not settle at

Why a merged summary carries a lower floor than a fresh one over the same arrivals, the law that share follows, and how much of the merge prediction it recovers.

how far the top k movedthe order warninghow far the floors are from doublingthe regime warningstationary Zipf0.160.53 (54%)one key floods a stretch0.170.59 (54%)a heavy hitter that stops0.170.65 (52%)the popular keys drift0.9134.00 (0%)k = 32 · 40,000 arrivalsin brackets: the leaf model at sixty-four shards

The warning that is silent for the right reason

Why a prediction's order-sensitivity warning is correctly silent on a bursty stream and on a large-shard failure, and what the second failure's own detector is.

English-like, 32 copies0.05x0.017 runs/charEnglish-like, 8 copies0.12x0.045 runs/chara text that repeats itself0.08x0.029 runs/charEnglish-like0.80x0.292 runs/charfour symbols, uniform2.07x0.753 runs/charthe whole suffix arraysampling bits, run boundaries / every valuen = 8,192

A sampling that costs more than the array

Where a sampling proportional to the run count stops being an improvement, and why the condition is a property of the text rather than of the index.

1001,00010characters in the wordruns · phrasesr, worse orderz, either orderr, better orderFibonacci words · two symbolsspread 1.50x to 3.17x

The measure that cannot see the alphabet

Why the run count of a transform depends on which order the alphabet sorts in, why the phrase count cannot, and how large the difference gets.

0.010.11errors allowed, kshare of windows proposed01234q = 3q = 4q = 5a shaded dot is a collapsed thresholdm = 24 · n = 4,000 · 6 planted1 collapsed rows

The threshold that reaches zero

Where the counting filter stops filtering, why the collapse is exact rather than gradual, and how it differs from the seed filter's.

73 characters long24 runsto depth 7270 characters long24 runsto depth 69longest: 73 × "-" at position 11,0162,685 positions below depth 20, 2,685 of them inside a runeight source modules · worst depth 78100.0% in runs

The deepest text is punctuation

What is actually at the bottom of a depth histogram's tail, why a run of one repeated character produces one level per character, and what that does to a cap chosen from the histogram.

the whole table60,00060,000r · 0rkcounting filter24,84315,369r · 0rkseed filter17,7452,415r · 1,377rkindex walk00r · 177,046rkn = 3,000 · m = 20 · q = 4cells drawn · r = characters read, rk = index rankscells computed6 occurrences

Three savings in three currencies

Four methods for approximate matching, measured in the three resources they spend, and why there is no ordering between them.

short by 133.6% of pairsshort by 211.2% of pairsshort by 411.2% of pairsthe same shift7994.0% of pairspatterns of 10 over four symbolsthe published rule is never the larger of the twoshift decisions84 pairs · 21 nodes

What the approximation gives up

How far short of the exact shift the published rules fall, measured over their whole domain rather than over one run, and where the gap disappears.

candidates, filtering4,355candidates, grid33rank and select, grid2,471occurrences32one query · same collection · same answer16,384 characters · 32 occurrencescandidates 132x · operations 1.76x

The operations a candidate count leaves out

Why a plate counting candidates examined reports a range structure as two orders of magnitude better than it is, and what the comparison looks like in one currency.

a text that repeats itself2.96xchain 13 · z 110English-like1.31xchain 10 · z 604four symbols, uniform1.28xchain 10 · z 816periodic, period 171.11xchain 9 · z 1,285phrases under a cap of four, against no cap4,096 characters each2.96x to 1.11x

The cap that binds on one text and not another

Why the cost of bounding a parse's copy depth is a threefold spread across four texts, and why the text that looks most like a chain is the cheapest to cap.

0102030255075100125one sampled position in every …of both halves saved, per cent"about a sixth"the marks alone: 14.0%8,192 characters16.7% at one in 32

A sixth of what, exactly

The locating apparatus swept over the sampling rate, why half of it does not shrink at all, and what a size quoted for an index is actually a size of.

atgaattcatgagtgacaag00000111111112222222errorsthe pattern, left to right · D belowleast errors neededD, the bound4 symbols · m = 2090 ranks · 2 resets

The pruning that loses an occurrence

Two ways to get a safe pruning wrong that return nothing but correct answers, and why a search's failures are invisible to every check except a comparison against exhaustion.

101001,00010100total length of the pattern settimes the published rule's precomputationwritten as a definitionbuilt from the linksthe published rulefour symbols · m = 10137x becomes 1.60x

The ratio that was an implementation

How a comparison between two algorithms came to measure a definition against a rule, what the accounting error was, and what the number is once both halves are fixed.

46812windowswindow lengthspanning a joinin no documentwith a separatorEnglish-like · 8 documents44 invented at m = 12

The occurrences a join invents

What concatenating documents into one string invents, how many strings it invents, and what the two ways of stopping it cost.

errors, by piecetaken by(0, 0, 0)1(0, 0, 1)1(0, 0, 2)1(0, 1, 0)1(0, 1, 1)1(0, 2, 0)3(1, 0, 0)2(1, 0, 1)2(1, 1, 0)3(2, 0, 0)30 of 10 covered more than once · the numbers are the searchesk = 2 · 3 pieces10 distributions

A schedule nobody writes down

The covering condition that makes a list of searches a scheme, how a valid one was found by enumeration rather than quoted, and three ways of getting it wrong that produce plausible answers.

02e+34e+36e+301234567891011level of the wavelet treebitsplainblock-codedrun-coded3,612 points · 12 levels24 copies of 2048 characters

The level where compression stops paying

The per-level answer to a deferral, why an obvious optimisation is worth nothing here, and what a strand looks like when its result is that the idea was not worth having.

11010⁴cap on the depthphrasesno capcap 165,536 characters · 16 copies26x at cap 1

What a quadratic construction was setting

The depth-cap sweep re-run at the size a linear construction allows, which of its conclusions survive, and what it means that a measurement's size was chosen by its construction's cost.

1.0%10.0%0.11fraction of characters changedper characterthe real runsthe real phrasesgenerated runsgenerated phrasesten revisions of one file · 24,580 characters2.32% against 3.24%

The dial that has no setting

What happens when a one-parameter model of a repetitive collection is fitted to a real one, and the measurement of where the model is wrong.

1101000.1documentsruns of the transform, per characterprose: 1.10xcopies: 1.02x8,192 characters, cutthe control rises further

A boundary that costs nothing

The expected cost of a document boundary on a repetitive collection, measured against its own control, and the ordering that came out backwards.

prose, many short documents4.31 most frequent3.07 drawn from a documentone copy per document5.75 most frequent1.81 drawn from a documentcopies cut across the boundaries5.81 most frequent1.88 drawn from a documentoccurrences per document holding the pattern16 documents · 6-character patternsall three within a tenth on the drawn pattern

One copy per document is one occurrence per document

Occurrences per document measured in three collection shapes, and why repetition between documents cannot make a pattern dense inside one.

equal lengths5.00 bits100.0%lengths as one over rank4.15 bits83.4%a few long, many short4.31 bits86.7%one document holding most of the text1.69 bits39.5%log₂ 3232 documents · 8,192 characters100.0% to 39.5%

A saving quoted without its collection

The rejection test that keeps a compression figure honest, and the two collections it has to separate — one where the saving is real and one where it is a ceiling function.

a fixed-length codeleaves in orderacdefghilmnoprstuvwythe best ordered treeleaves in orderacdefghilmnoprstuvwythe best tree of any shapeleaves in frequency ordereahnrstdiloucfgmpvwythe symbols, in the order the descent reports them21 symbols in 2,048 positionsone set, 2 of 3 sorted

One set, three orders

Why an interval enumeration's set is shape-independent and its order is not, and what a caller reading the output in sequence has to check.

acdefghijklmnopqrstuvwyzroot24 of 26 symbols present54 ranks · 51 nodes

A walk that does not prune

The rejection test for an operation whose entire content is a test, and the class of defect that only an operation count can catch.

01e+42e+43e+44e+450100one sampled position in every …bitsplain, one bit a rowcompressed blocksElias-Fano16,384 rowscrosses at one in 4

Where the sparse representation loses

The two-ended measurement of a sparse bit-vector representation, the density at which it stops paying, and what a plate showing only the sparse end would report.

bits heldthe model3,591the structure3,905one rank, in operationsbinary search10 stepsselect and walk1 select + 0.7016,385 rows · one in 32 marked14x on the operation

A price with no structure under it

A size model reported as a structure, the check that separates them, and why no measurement of bits could have found it.

factor against the published loopthe compound walk11xthe enumeration78xthe two, multiplied860xnothing measures thisan index with both78xthe shortfall is 11x, and the walk's factor is 11x6 patterns · 1 error · sigma 21the larger of the two, not the product

Two factors that do not multiply

A product a reader computes without being told not to, drawn as a line the measurement falls short of, and the arithmetic of why.

0100200300400102030copies of the basebits held during one querythe visited set: 420the frontier: 2666-character patterns20x to 1.58x

A constant factor, not a term

A working-memory saving measured against the copy count, the retraction it produced, and what a query holds that no structure's accounting mentions.

10100states the cache holdsoperations a characterthe plain NFA: 52.5the whole set fits: 19.94,096 characters · k = 8the knee is at 512 states

A cache below the reachable set

What a bounded cache costs when a text reaches more states than it holds, and why the lazy construction defers an exponential rather than removing it.

1010³10⁴10⁵10⁶characters of textstepsbacktrackingThompson's NFAopen points: capped at4,000,000(a|a)*b12,158x at 20 characters

The folklore is about a matcher

A backtracking matcher against Thompson's simulation on the standard witness, measured to the cap, and the claim the two are usually conflated into.

All essays