the birthday paradox

Version (1.54 KB) by Bud Kelly
Plots probability of any two people in a group of n having the same birthday
Updated 1 Apr 2018

View License

This is a modification of Joseph Delgadillo's excellent tutorial (Matlab from Beginner to Advanced on YouTube and also at teachable.) that computes and plots the probability of two or more people in a random group of n people will have the same birthday. Surprisingly, the probability is 0.5 at around 23 people, and approaches certainty after around 50 people. Cool problem, and thanks to Joseph Delgadillo for the very best Matlab tutorial on the Web. Great course.

Cite As

Bud Kelly (2024). the birthday paradox (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Birthdays in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes