Generator

Algorithm R: how often each of 32 positions is sampled, 40,000 runs

Rendered here at the parameters it defaults to, with every essay that calls it — which is the same list as the blast radius of changing it.
Algorithm R: how often each of 32 positions is sampled, 40,000 runsA uniform sampler chooses every position of the stream with probability k/n = 0.125, whatever order the items arrive in. The shaded band is four standard deviations of the estimate at 40,000 runs, which is what a correct sampler looks like at this trial count. The largest departure measured here is 3.3%. Each run costs 166 random bits, which is the other axis this sampler is measured on.k/n = 0.1250.0810.1250.169position in the streamshare of runs in which it was sampledAlgorithm R, n = 32, k = 4, 40,000 runsworst departure 3.3% · noise 1.4%

Algorithm R: how often each of 32 positions is sampled, 40,000 runs

A uniform sampler chooses every position of the stream with probability k/n = 0.125, whatever order the items arrive in. The shaded band is four standard deviations of the estimate at 40,000 runs, which is what a correct sampler looks like at this trial count. The largest departure measured here is 3.3%. Each run costs 166 random bits, which is the other axis this sampler is measured on.

Drawn at 690 × 370, wide on the page. Everything above is what reservoir-frequency returns with no arguments; the caption is the generator's own, computed from the numbers in the drawing rather than written beside it.

1 essay calls reservoir-frequency. The drawing above is what it returns with no arguments at all; every call below passes it something, because a placement that passes nothing draws whichever member of the family the generator happens to default to rather than the one its essay argues about — which is what optcheck and figfill exist to catch.

Where it is called

Changing this generator changes every one of these figures.

The library, page 3 of 5 — where reservoir-frequency sits