The birthday surprise: can your class find a match?

A game in five short stages. How many kids does a class need?

· · Updated 2026-11-04 · 2 min read · code & data · ✓ Delta-reproducible

probabilitysimulationbirthdaysfor young readers

#The question

How many kids does a class need before two of them are as likely as not to share a birthday? Play to find out. Your progress is kept on this device.

The birthday game, in five stages. The pretend classes in Stage 3 are rolled by your browser. The rest uses our recorded results.

#Specs: system & compute

Deploymentdomestic
ImagePyTorch CUDA13 (GPU)
CPU2
Memory4Gi
GPUnone
Run time37 s
Run ID8914bb42f5fa457288289b4b68bc16a0
Date2026-11-01
Packages
36 packages

contourpy==1.3.2, cycler==0.12.1, filelock==3.29.0, fonttools==4.65.0, fsspec==2026.4.0, Jinja2==3.1.6, kiwisolver==1.5.1, MarkupSafe==3.0.3, matplotlib==3.10.9, mpmath==1.3.0, networkx==3.4.2, numpy==2.2.6, nvidia-cublas-cu12==12.1.3.1, nvidia-cuda-cupti-cu12==12.1.105, nvidia-cuda-nvrtc-cu12==12.1.105, nvidia-cuda-runtime-cu12==12.1.105, nvidia-cudnn-cu12==9.1.0.70, nvidia-cufft-cu12==11.0.2.54, nvidia-curand-cu12==10.3.2.106, nvidia-cusolver-cu12==11.4.5.107, nvidia-cusparse-cu12==12.1.0.106, nvidia-nccl-cu12==2.21.5, nvidia-nvjitlink-cu12==12.9.86, nvidia-nvtx-cu12==12.1.105, packaging==26.3, pillow==12.2.0, pyparsing==3.3.3, python-dateutil==3.0.0, six==1.17.0, sympy==1.13.1, torch==2.5.1+cu121, torchaudio==2.5.1+cu121, torchvision==0.20.1+cu121, triton==3.1.0, typing_extensions==4.15.0, tzdata==2026.6

Recorded from the actual Delta run, not typed by hand.

#What we did

A simulation is a pretend experiment on a computer. Ours made pretend classes, gave each kid a random birthday, and checked for a match. Every day of a 365-day year had the same chance. It played 1000000 games for each class size from 2 to 80, and compared the results with the exact answer worked out with maths.

        birthdays = np.sort(rng.integers(0, DAYS, size=(size, k)), axis=1)
        # after sorting, a shared birthday means two neighbours are equal
        shared += int((np.diff(birthdays, axis=1) == 0).any(axis=1).sum())

#Results

A line showing the chance of a shared birthday rising as classes get bigger. It reaches about half at 23 kids. Orange simulation dots sit very close to the black maths line.
The chance of a match grows with class size. The orange simulation dots and the black exact-maths line are hard to tell apart.
Kids in the class Simulation Exact maths
10 11.71% 11.69%
23 50.66% 50.73%
30 70.66% 70.63%
50 97.03% 97.04%
70 99.92% 99.92%

#What this does and doesn't show

  • Real birthdays differ. Some days are more common, twins share birthdays, and we left out 29 February. We did not measure real classes.
  • "Likely" is not a promise. Your class is one game.
  • This was a check, not a discovery. The maths was already known.

Code & data

Everything needed to check the numbers above. Click a file to read it here, with line numbers.

#Author verification

✓ Signed by @seawan on

I played all five stages and read the whole post to make sure a child can follow it. I checked that the main numbers match the results file from the Delta run, and that the post has the Delta-reproducible badge and run record.

Written by the author, not generated. The build only checks that it is present.

#Reproduce

✓ Delta-reproducible

npx -y github:seawan/vibe-research#0fae223b2dded3030a8738c721afc659672ee84f seawan/birthday-surprise

Pinned to the commit that last changed this post. Rerun spec: delta.yaml. Resources: 2 CPU · 4Gi memory · no GPU · up to 30 min · domestic.

Need Delta? Register for delta-cli first.

This is a “vibe research” report: the experiments and the write-up were produced with help from an AI assistant and checked by the author. Numbers come from the linked code and data; references were machine-verified.