Generator

Sketch distortion against sketch width, for 60 vectors

One function in the randomised library, called 15 times across 4 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 12 claims it put to the test while drawing them, and where it stands against the rule this site is named for.

At its defaults it draws sketch distortion against sketch width, for 60 vectors. A log-log plot of the worst relative change in vector length against the number of rows in the sketch, for vectors of two dimensions a factor of four apart. The two curves lie almost on top of one another and both fall steadily.

sketch-distortion is one function in lib/figures/randomised.js — randomised — a bound that holds with a probability, and the seed that moves. Everything below came out of it during this build, at arguments taken from the essays rather than invented for this page. A figure here is the figure a reader meets in an essay, and if the generator changes, this page changes with it.

At its defaults

Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.

Sketch distortion against sketch width, for 60 vectorsA log-log plot of the worst relative change in vector length against the number of rows in the sketch, for vectors of two dimensions a factor of four apart. The two curves lie almost on top of one another and both fall steadily.10²10².³10².⁵⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁶10⁻¹10⁻⁰.⁵1rows in the sketchworst relative distortiondimension 64dimension 2565 seeds per point, band is best to worstthe dimension does not appear

A log-log plot of the worst relative change in vector length against the number of rows in the sketch, for vectors of two dimensions a factor of four apart. The two curves lie almost on top of one another and both fall steadily.

vectors: 60

The arguments are the ones A bound that holds with probability passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Sketch distortion against sketch width, for 60 vectorsA log-log plot of the worst relative change in vector length against the number of rows in the sketch, for vectors of two dimensions a factor of four apart. The two curves lie almost on top of one another and both fall steadily.10²10².³10².⁵⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁹⁶10⁻¹10⁻⁰.⁵1rows in the sketchworst relative distortiondimension 64dimension 2565 seeds per point, band is best to worstthe dimension does not appear

A log-log plot of the worst relative change in vector length against the number of rows in the sketch, for vectors of two dimensions a factor of four apart. The two curves lie almost on top of one another and both fall steadily.

show: "sp-kappa", basis: "spiked"

The arguments are the ones One nonzero is a birthday problem passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The median condition number of a sketched orthonormal basis against the sketch's width in multiples of the dimension, every direction on one row, for a Gaussian sketch and for sparse ones, with singular draws drawn at the top of the axisGaussian: 6.96, 4.36, 3.15, 2.68, 2.07, 1.95, 1.56; 4 nonzeros: 6.48, 4.48, 2.95, 2.67, 2.12, 1.90, 1.59; 2 nonzeros: singular, 5.19, 3.33, 2.88, 2.21, 2.41, 1.73; 1 nonzero (CountSketch): singular, singular, singular, singular, singular, singular, 1.00 at widths 1.5, 2, 3, 4, 6, 8, 16 times the dimension.110¹110¹sketch width over dimensionκ(SQ), median of 16Gaussian4 nonzeros2 nonzeros1 nonzero (CountSketch)dimension 16 · 1,000 rows · cut at 40only leverage separates the sketches

Gaussian: 6.96, 4.36, 3.15, 2.68, 2.07, 1.95, 1.56; 4 nonzeros: 6.48, 4.48, 2.95, 2.67, 2.12, 1.90, 1.59; 2 nonzeros: singular, 5.19, 3.33, 2.88, 2.21, 2.41, 1.73; 1 nonzero (CountSketch): singular, singular, singular, singular, singular, singular, 1.00 at widths 1.5, 2, 3, 4, 6, 8, 16 times the dimension.

show: "sp-birthday"

The arguments are the ones One nonzero is a birthday problem passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

On a fully spiked basis of dimension 16, the share of one-nonzero sketches that are exactly singular at four widths, against the chance that two of the sixteen spikes share a bucket2 times the dimension: 16 of 16, against 0.99; 4 times the dimension: 14 of 16, against 0.87; 8 times the dimension: 8 of 16, against 0.62; 16 times the dimension: 5 of 16, against 0.38.00.250.50.7512 × dimension: measuredthe chance of a shared bucket4 × dimension: measuredthe chance of a shared bucket8 × dimension: measuredthe chance of a shared bucket16 × dimension: measuredthe chance of a shared bucketshare of sketches singulardimension 16 · sixteen drawsballs into bins, and nothing more

2 times the dimension: 16 of 16, against 0.99; 4 times the dimension: 14 of 16, against 0.87; 8 times the dimension: 8 of 16, against 0.62; 16 times the dimension: 5 of 16, against 0.38.

show: "sp-scale"

The arguments are the ones One nonzero is a birthday problem passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The share of one-nonzero sketches singular on a spiked basis against the width over the square of the dimension, at three dimensionsdimension 8: 15 of 16 at 2d, 7 of 16 at 4d, 4 of 16 at 8d, 3 of 16 at 16d; dimension 16: 16 of 16 at 2d, 14 of 16 at 4d, 8 of 16 at 8d, 5 of 16 at 16d; dimension 32: 16 of 16 at 2d, 16 of 16 at 4d, 13 of 16 at 8d, 11 of 16 at 16d.10⁻¹100.250.50.751sketch width over the square of the dimensionshare singulardimension 8dimension 16dimension 32sixteen draws at each widththe width it needs is the dimension squared

dimension 8: 15 of 16 at 2d, 7 of 16 at 4d, 4 of 16 at 8d, 3 of 16 at 16d; dimension 16: 16 of 16 at 2d, 14 of 16 at 4d, 8 of 16 at 8d, 5 of 16 at 16d; dimension 32: 16 of 16 at 2d, 16 of 16 at 4d, 13 of 16 at 8d, 11 of 16 at 16d.

show: "sp-rows"

The arguments are the ones One nonzero is a birthday problem passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The median condition number of a sketched orthonormal basis at a width of four times the dimension, by basis and by kind of sketch, with the share singularincoherent: Gaussian 2.61, 0 of 16 singular; 8 nonzeros a column 2.61, 0 of 16 singular; 4 nonzeros 2.58, 0 of 16 singular; 2 nonzeros 2.57, 0 of 16 singular; 1 nonzero (CountSketch) 2.68, 0 of 16 singular; uniform row sampling 2.64, 0 of 16 singular. half on single rows: Gaussian 2.71, 0 of 16 singular; 8 nonzeros a column 2.52, 0 of 16 singular; 4 nonzeros 2.56, 0 of 16 singular; 2 nonzeros 2.78, 0 of 16 singular; 1 nonzero (CountSketch) singular, 10 of 16 singular; uniform row sampling singular, 16 of 16 singular. every direction on one row: Gaussian 2.68, 0 of 16 singular; 8 nonzeros a column 2.51, 0 of 16 singular; 4 nonzeros 2.67, 0 of 16 singular; 2 nonzeros 2.88, 0 of 16 singular; 1 nonzero (CountSketch) singular, 14 of 16 singular; uniform row sampling singular, 16 of 16 singular.12468incoherentGaussian8 nonzeros a column4 nonzeros2 nonzeros1 nonzero (CountSketch)uniform row samplinghalf on single rowsGaussian8 nonzeros a column4 nonzeros2 nonzeros1 nonzero (CountSketch), 10 of 16 singularuniform row sampling, 16 of 16 singularevery direction on one rowGaussian8 nonzeros a column4 nonzeros2 nonzeros1 nonzero (CountSketch), 14 of 16 singularuniform row sampling, 16 of 16 singularκ(SQ) at four times the dimension; singular drawn at 8dimension 16 · 1,000 rowsuniform sampling never sees a spike

incoherent: Gaussian 2.61, 0 of 16 singular; 8 nonzeros a column 2.61, 0 of 16 singular; 4 nonzeros 2.58, 0 of 16 singular; 2 nonzeros 2.57, 0 of 16 singular; 1 nonzero (CountSketch) 2.68, 0 of 16 singular; uniform row sampling 2.64, 0 of 16 singular. half on single rows: Gaussian 2.71, 0 of 16 singular; 8 nonzeros a column 2.52, 0 of 16 singular; 4 nonzeros 2.56, 0 of 16 singular; 2 nonzeros 2.78, 0 of 16 singular; 1 nonzero (CountSketch) singular, 10 of 16 singular; uniform row sampling singular, 16 of 16 singular. every direction on one row: Gaussian 2.68, 0 of 16 singular; 8 nonzeros a column 2.51, 0 of 16 singular; 4 nonzeros 2.67, 0 of 16 singular; 2 nonzeros 2.88, 0 of 16 singular; 1 nonzero (CountSketch) singular, 14 of 16 singular; uniform row sampling singular, 16 of 16 singular.

What it checked while drawing

Every figure above checked its own claims on the way to being drawn, and a claim that failed would have stopped the picture rather than shipped a wrong one. Those checks used to leave no trace at all: a passing one returned true and the only evidence the figure had checked anything was that nothing crashed. The list below is what they actually said, collected by running this generator with an observer installed — not a description of what it is believed to check.

12 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.

at 25 rows the distortion barely notices a fourfold change of dimension — checked 5 times

a basis and a sketch this file measures

a basis the dial offers

and a wider sketch distorts less

at a rate near the inverse square root of the sketch width

at least as many rows as columns

at least one row

curves with points on them

Against the rule

The rule does not apply to it. It factorises nothing, so there is no residual it could be withholding. That is worth stating rather than leaving blank: a site that reported the rule as satisfied by every generator would be counting mostly generators the rule never reached.

Across the library: the rule bites on 217 of 397 generators — 199 print a residual and 18 are exempt with a published reason; 180 factorise nothing. Read from lib/residual-rule.js, which is the same body the gate enforces from, and the gate's last check fails the build if this page and it disagree about any generator.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

Randomised, and the guarantee that changes kind

A bound that holds with probability

Every other guarantee in this collection is deterministic. The randomised low-rank approximation offers one that holds with a probability, the seed changes the answer, and the honest figure is a band rather than a line.

Iterating, instead of factorising

An operator with no entries

At the sizes where linear algebra is expensive the matrix does not exist. What exists is a subroutine that returns Av. Every Krylov method survives that unchanged; every algorithm that reads an entry disappears. And the derivative such a code computes is accurate to ten digits instead of sixteen, which turns out to cost nothing at all.

Randomised, and the guarantee that changes kind

One nonzero is a birthday problem

A sketched preconditioner's quality is one number, how well the sketch preserves one subspace, and the sketch that ships has one nonzero in each column. It was said to supply the needed distortion at its own width. On an incoherent basis its own width is everyone else's: at four times the dimension CountSketch, uniform sampling and a Gaussian all read κ of 2.6. Put each direction of the basis on a single row and CountSketch is singular on 14 draws of 16 at the same width, by the formula for shared birthdays, and needs the dimension squared to escape it. Two nonzeros reduce that to three draws in sixteen at twice the dimension and none at four. Four nonzeros are a Gaussian for this purpose, at about a sixteenth of its cost to apply.

Randomised, and the guarantee that changes kind

The dimension does not appear

A random projection preserves the lengths of a set of vectors to within a distortion that depends on how many vectors there are and not on how many coordinates each one has. That is the fact the whole field rests on, and it is genuinely surprising.

The whole library · All essays · What must fail