Deja-Vu Detector

random streams can feel eerily familiar

Loading interactive simulation...

Birthday Paradox Limits 🖖

The probability of pattern collisions scales non-linearly with sequence length...

Why familiar patterns are unavoidable 🖖

That flash of 'I've seen this before' is your brain's pattern-matcher firing, but in a short stream built from only 4 symbols, local repeats are ordinary rather than eerie. With window size 3 there are just 43 = 64 possible patterns, so a 120-symbol run (118 windows) is forced to repeat at least one by the pigeonhole principle. This tool counts the real repeats and compares them against a random baseline, separating genuine surprise from routine chance.

Some patterns clump more than others 🖖

Two windows of the same length are not equally prone to bunching up. A self-overlapping motif like AAAA or ABAB can line up with a shifted copy of itself, so once it appears it tends to recur immediately, giving it higher variance in its repeat count than a non-overlapping window like ABCD. Guibas and Odlyzko captured this with a pattern's autocorrelation. So the déjà vu you feel depends on which motif recurs, not merely how long it is.

Example problems

  • short run - Short sequence with 3-symbol windows: repeats still appear quickly.
  • medium run - Medium sequence shows that repeated motifs are normal by chance.
  • dense deja-vu - Longer sequences with bigger windows still generate deja-vu clusters.