7/14/2026 at 4:07:56 PM
> so hopefully you can refresh a few times and get a fresh one every timeIf you randomly sample from only 60 quotes, then after 10 refreshes there will be a greater than 50% chance of at least one repeat, and by 20 refreshes it's up to 95%. This is an example of the birthday paradox[1].
On the flip side, if someone wants to see all 60 quotes, they will have to refresh the page an average of 281 times, mostly (~80%) seeing quotes they've already seen before. This is an example of the coupon collector's problem[2].
The way to avoid both these problems is to shuffle the quotes into a random order, just once, and remember that order. The first time a user comes to the page, start at a random index in that shuffled list, and from then on, simply move to the next item in the list. Every user will get a unique set of random quotes, but will see no repeats until the list is exhausted, and will be guaranteed to be able to see all available content in just 60 refreshes.
[1]: https://en.wikipedia.org/wiki/Birthday_problem
[2]: https://en.wikipedia.org/wiki/Coupon_collector%27s_problem
by olooney
7/14/2026 at 4:36:55 PM
If the user doesn't know how many unique items there are, they would need to keep refreshing even longer to gauge whether the N they've seen is the full set.by dantillberg
7/15/2026 at 2:32:44 AM
Is there a good way to determine after seeing N unique items in M trials how many items there potentially are? Would tracking the time between seeing new unique items help? Is this an already solved problem?by gregdaniels421
7/15/2026 at 3:47:10 AM
There are many different statistical estimators for this problem, many from the ecology literature (e.g. Chao1). This paper and a Python library based on it covers many of them:https://www.vldb.org/conf/1995/P311.PDF
https://pydistinct.readthedocs.io/en/latest/docs/readme_link...
by senderista
7/15/2026 at 3:10:40 AM
This is the “German tank problem”: https://en.wikipedia.org/wiki/German_tank_problem?wprov=sfti...by clickety_clack
7/15/2026 at 3:50:54 AM
No, it's not the same as the German tank problem, because that assumes all sampled values are unique (and totally ordered). It's closer to the "species richness" estimation problem, where you estimate the total number of species from a sample (specimens) with many repeated values (species).by senderista
7/15/2026 at 1:44:12 PM
Ah, you’re right! The German tank problem was based on reading the serial numbers I think.by clickety_clack
7/14/2026 at 5:00:20 PM
I'd prefer have a unique and shared quote each day keyed on the day of the year. Then restart when going above N and shuffle.by xandrius
7/14/2026 at 5:39:30 PM
Why shuffle, though?by pegasus
7/14/2026 at 4:58:51 PM
TIL about the coupon collector problem. Thanks for sharing that linkby thekaranchawla
7/14/2026 at 4:12:26 PM
Make sure you fingerprint every user to make sure they're using the right index value /sby alansaber