Lab

How the gallery samples

Every load in the photo gallery is a random draw. Run the same draws here, try other ways of picking, and watch the counts settle onto the maths.

Demo pool · 242 photos in 6 folders, shaped like the archive (not the real counts)

Settings

Every photo is equally likely. This is what the gallery does.

Replace: each load is a fresh draw from every photo, so repeats happen.

Same seed and settings, same draws. The link in the address bar reproduces this run.

P(≥1 new)
100%
E[new]
15.0
σ
0.0
unseen
242 of 242
~loads to see all
96

No draws yet. Press Draw.

Share per folder

Where the drawn photos came from. The open tick is what the strategy should give in the long run, the filled dot what has happened so far.

0%10%20%30%40%50%obs / expStreetStreet: expected 39.7%– / 39.7EventsEvents: expected 22.3%– / 22.3ShootsShoots: expected 12.4%– / 12.4Travel 2022Travel 2022: expected 11.6%– / 11.6City WalksCity Walks: expected 9.1%– / 9.1Studio 2019Studio 2019: expected 5.0%– / 5.0
Show data
FolderPhotos drawnObservedExpected
Street0–39.7%
Events0–22.3%
Shoots0–12.4%
Travel 20220–11.6%
City Walks0–9.1%
Studio 20190–5.0%

Convergence

Total-variation distance between observed and expected folder shares, by number of draws (log scale). The dashed curve is what pure chance leaves over, shrinking like 1/√n.

00.10.20.3110Draw to start
Show data

No draws yet.

New photos in the next load

Bars: the exact probability of each count (hypergeometric). Dots: the last 15 loads, landing where they actually fell; older ones are fainter.

0%50%100%0123456789101112131415 new: 100.0%15
Show data
Next load
New photosProbability
00.0%
10.0%
20.0%
30.0%
40.0%
50.0%
60.0%
70.0%
80.0%
90.0%
100.0%
110.0%
120.0%
130.0%
140.0%
15100.0%

What is going on

Without replacement. Load more in the gallery never repeats a photo you have already seen in this visit: it draws the next batch at random from the photos that have not been shown. That is sampling without replacement. Each photo still has the same chance of coming next, so the order differs on every visit, but nothing repeats until you have seen them all. In Replace mode every load starts from the full set instead, and the number of new photos follows the hypergeometric distribution in the last chart.

Balanced is not fair. Picking a folder first and then a photo inside it gives every folder the same share of the screen. That sounds even-handed, but it is not uniform per photo: a photo in a folder of 12 is about eight times as likely to appear as one in a folder of 96. Uniform treats photos equally; by-folder treats folders equally. Both are fair, to different things, and the share chart shows which one you are getting.

The seed. The draws come from a small pseudo-random generator (mulberry32) started from the seed. The same seed and settings give exactly the same sequence of loads, so a run can be shared and checked. The gallery picks a new seed for every visit, which is why it looks different each time you open it.

Open the gallery