Mathematics

Birthday Paradox: Definition, Formula & Example

The birthday paradox is the surprising result that in a group of only 23 people, the probability that at least two people share a birthday is slightly greater than 50%.

Under the standard simplified assumptions of 365 equally likely birthdays and no leap day:

P(shared birthday among 23 people) ≈ 0.5073

or:

≈ 50.73%

This does not mean that one specific person’s birthday has a 50% chance of matching someone else’s. The birthday paradox asks whether any pair among the people shares a birthday.

The number of possible pairs grows rapidly as the group becomes larger, which is why the probability rises much faster than many people intuitively expect.

What Is the Birthday Paradox?

The birthday paradox is a probability problem asking:

What is the probability that at least two people in a group have the same birthday?

It is called a paradox because the result often feels counterintuitive, not because it contains a mathematical contradiction.

With 23 people:

P(at least one shared birthday) ≈ 50.73%

With 50 people:

P(at least one shared birthday) ≈ 97.04%

The probability becomes large even though there are 365 possible birthday dates because a group creates many different pairs that could match.

Standard Birthday Paradox Assumptions

The classic calculation usually assumes:

  • 365 possible birthdays;
  • no February 29;
  • birthdays are equally likely on every day;
  • individuals’ birthdays are independent.

Real birthday distributions are not perfectly uniform, but these assumptions produce the standard birthday paradox result.

The mathematical mechanism is more important than the calendar simplification: the probability grows because the number of pairwise comparison opportunities increases rapidly with group size.

Why Calculate the Complement?

Calculating the probability of at least one match directly is difficult because several different matching patterns are possible.

A much easier approach is to calculate the opposite event:

No two people share a birthday

Then use:

P(at least one match) = 1 – P(no match)

This is the central birthday paradox formula.

Birthday Paradox Formula

For n people and 365 equally likely birthdays:

P(no match) = (365/365)(364/365)(363/365)…((365 – n + 1)/365)

Therefore:

P(match) = 1 – P(no match)

An equivalent factorial form for:

0 ≤ n ≤ 365

is:

P(no match) = 365! / [(365 – n)! × 365^n]

So:

P(match) = 1 – 365! / [(365 – n)! × 365^n]

For:

n > 365

the probability of at least one shared birthday is exactly:

1

by the pigeonhole principle.

Why the First Person Contributes 365/365

The first person can have any birthday without creating a match.

Therefore:

Probability = 365/365 = 1

For the second person to avoid a match, their birthday must be one of the remaining 364 dates:

364/365

For the third person to avoid matching either of the first two birthdays:

363/365

The process continues as long as all birthdays remain different.

Multiplying these conditional probabilities gives the probability of no shared birthday.

Two People

For two people:

P(no match) = 365/365 × 364/365

= 364/365

Therefore:

P(match) = 1 – 364/365

= 1/365

≈ 0.00274

or about:

0.274%

With only one pair, the probability is very small.

Three People

For three people:

P(no match) = 365/365 × 364/365 × 363/365

Then:

P(match) = 1 – P(no match)

The third person creates matching possibilities with both earlier people, so the probability is already larger than simply asking whether one predetermined pair matches.

This distinction becomes much more important as n increases.

Birthday Paradox for 23 People

For:

n = 23

calculate:

P(no match) = (365/365)(364/365)(363/365)…(343/365)

This gives approximately:

P(no match) ≈ 0.492703

Therefore:

P(match) = 1 – 0.492703

≈ 0.507297

So:

P(match) ≈ 50.73%

That is the famous birthday paradox threshold.

Why 23 Feels Too Small

A common intuition compares 23 people with 365 possible dates and thinks:

23 is much smaller than 365

But the relevant comparison is not simply people versus dates.

It is how many pairs of people can potentially match.

The number of distinct pairs among n people is:

C(n,2) = n(n – 1)/2

For 23 people:

C(23,2) = 23 × 22 / 2

= 253

So a group of 23 people creates:

253 distinct pairs

that could share a birthday.

The detailed counting formula is developed under combinations.

Number of Pairs Grows Quadratically

The pair count is:

n(n – 1)/2

For 10 people:

10 × 9 / 2 = 45 pairs

For 23 people:

253 pairs

For 50 people:

50 × 49 / 2 = 1225 pairs

The number of comparisons grows roughly with:

n²/2

rather than simply n.

That rapid growth is the main source of the surprising probability.

Birthday Paradox Probability Table

Under the standard 365-day assumptions:

PeopleProbability of at least one shared birthday
10≈ 11.69%
20≈ 41.14%
23≈ 50.73%
30≈ 70.63%
40≈ 89.12%
50≈ 97.04%
57≈ 99.01%
70≈ 99.92%

The rise is nonlinear. Adding another person creates comparisons with every person already in the group, not just one new comparison.

The 50% Threshold

The smallest group size for which the standard birthday-match probability exceeds 50% is:

23

For 22 people, the probability is still below 50%.

At 23:

P(match) ≈ 0.5073

Therefore the familiar claim is not that 23 produces exactly 50%, but that 23 is the first integer group size to exceed the halfway point.

The 99% Threshold

At approximately:

57 people

the probability exceeds 99%.

Specifically:

P(match for 57) ≈ 99.01%

This can feel even more surprising because 57 is still far below 365.

Again, the number of possible pairs explains much of the effect:

C(57,2) = 57 × 56 / 2

= 1596 pairs

There are many opportunities for a collision.

One Specific Birthday Is a Different Problem

Suppose you ask:

What is the probability that someone in a group shares my birthday?

That is not the standard birthday paradox.

If there are n other people, the probability that none shares your specific birthday is:

(364/365)^n

Therefore:

P(at least one shares your birthday) = 1 – (364/365)^n

This grows much more slowly than the probability that any two people in the group match.

The birthday paradox compares all possible pairs, not everyone only against one predetermined birthday.

Example: 22 Other People Matching Your Birthday

Suppose you are in a group with 22 other people.

The chance that none of those 22 people shares your birthday is:

(364/365)^22

Therefore:

P(someone shares your birthday) = 1 – (364/365)^22

This is only around 5.9%, far below the approximately 50.7% probability that some pair somewhere among 23 people shares a birthday.

The two questions sound similar but have very different sample structures.

Why Pair Counting Alone Is Not the Exact Formula

Because 23 people generate 253 pairs, it may be tempting to multiply:

253 × 1/365

This gives roughly:

0.693

but that is not the exact probability of at least one match.

Why?

The pair-match events are not mutually exclusive. One group could contain multiple matching pairs or three people with the same birthday, causing overlap among events.

The complement method avoids double counting and gives the exact standard result.

Complement Probability Step by Step

For n people:

P(match) = 1 – P(all birthdays different)

The first person can use any of 365 days.

The second must avoid 1 occupied day:

364 choices

The third must avoid 2 occupied days:

363 choices

The kth person must avoid:

k – 1

already used birthday dates.

Therefore the numerator is:

365 × 364 × 363 × … × (365 – n + 1)

The total number of equally likely birthday assignments is:

365^n

Hence:

P(no match) = [365 × 364 × … × (365 – n + 1)] / 365^n

Factorial Form

The descending product:

365 × 364 × … × (365 – n + 1)

can be written:

365!/(365 – n)!

Therefore:

P(no match) = 365! / [(365 – n)!365^n]

and:

P(match) = 1 – 365! / [(365 – n)!365^n]

The factorial notation becomes convenient when expressing the complete formula compactly.

Generalized Collision Formula

The birthday paradox is not fundamentally about birthdays.

Suppose there are:

d

equally likely possible categories and n independent selections.

Then:

P(no collision) = d(d – 1)(d – 2)…(d – n + 1) / d^n

for n ≤ d.

Therefore:

P(at least one collision) = 1 – P(no collision)

Birthdays are simply the case:

d = 365

This generalized form appears in many collision-probability problems.

Pigeonhole Principle

If there are more people than available birthday dates, a match is guaranteed.

Under a 365-day model:

366 people

placed into:

365 birthday categories

must contain at least two people in the same category.

Therefore:

P(match) = 1

for n ≥ 366.

This conclusion does not require probability. It follows directly from the pigeonhole principle.

Birthday Paradox Approximation

For n much smaller than 365, a useful approximation is:

P(no match) ≈ e^[-n(n-1)/(2 × 365)]

Therefore:

P(match) ≈ 1 – e^[-n(n-1)/730]

This approximation exposes why the pair count appears naturally.

The exponent contains:

n(n – 1)/2

which is exactly the number of pairs.

Approximate 50% Group Size

Set the approximation equal to 50%:

1 – e^[-n(n-1)/(2d)] ≈ 0.5

Then:

e^[-n(n-1)/(2d)] ≈ 0.5

Taking natural logarithms:

n(n – 1)/(2d) ≈ ln 2

For a rough estimate:

n ≈ √(2d ln 2)

For:

d = 365

this gives a value near:

22.5

so the first integer group size exceeding 50% is unsurprisingly around:

23

The exact calculation confirms it.

Why the Approximation Works

The exact no-match probability is:

(1)(1 – 1/365)(1 – 2/365)…

For small x:

ln(1 – x) ≈ -x

Applying this approximation to the logarithm of the product converts the many multiplicative factors into a sum.

The resulting sum contains:

1 + 2 + … + (n – 1)

which equals:

n(n – 1)/2

This provides another explanation for why pair count governs the scale of the birthday effect.

Birthday Paradox and Combinatorics

The birthday paradox is closely related to counting possible arrangements.

The pair count:

C(n,2)

measures how many pairs can potentially collide.

The exact probability calculation counts birthday assignments in which all n birthdays are different and compares them with all possible assignments.

These are standard combinatorics ideas, but the birthday paradox has its own narrower objective: calculating the chance of at least one birthday collision.

Birthday Paradox and Big Numbers

The total number of possible birthday assignments for n people is:

365^n

Even for modest n, this becomes an enormous value.

For 23 people:

365^23

has a magnitude far beyond what is convenient to write manually.

This is why probability formulas usually work with products, ratios, logarithms, or scientific notation instead of listing all possible assignments.

The methods for interpreting digit length and numerical scale are covered under big numbers.

Birthday Paradox and Independence

The standard model assumes each person’s birthday is independent of the others.

That means knowing one person’s birthday does not change the probability distribution assigned to another person’s birthday.

However, the events:

Person A matches Person B

and:

Person A matches Person C

are not simply combined as unrelated mutually exclusive events.

That dependence among overlapping pair events is another reason direct pair-probability addition is not exact.

Real Birthdays Are Not Perfectly Uniform

Actual birthdays are not distributed perfectly evenly across all calendar dates.

Seasonal patterns, scheduled births, holidays, and other effects can make some dates more common than others.

The classic birthday paradox deliberately ignores those complications to create a clean probability model.

If birthday probabilities are unequal, the exact collision probability changes.

The familiar:

50.73% for 23 people

belongs to the idealized 365 equally likely-day model.

What About Leap Day?

The standard calculation normally ignores February 29 and uses:

365 days

A model including leap day could use 366 categories, but the real situation is more complicated because February 29 is much less frequent than ordinary calendar dates across multiple years.

For the classic birthday paradox, the 365-day simplification is conventional and sufficient.

Birthday Paradox in Hashing

The same mathematics appears when values are randomly assigned to a finite number of possible outputs.

If a system has:

d possible outputs

then collisions can become likely after roughly:

√d

random selections rather than after d selections.

That square-root scale is often called a birthday bound.

The birthday paradox therefore has applications well beyond calendars.

Example With 100 Possible Categories

Suppose each observation is independently assigned to one of:

100 equally likely categories

For n observations:

P(no collision) = (100/100)(99/100)(98/100)…

and:

P(collision) = 1 – P(no collision)

A 50% collision probability occurs with far fewer than 100 observations because every new observation can collide with all earlier observations.

This is the same mathematical structure as the birthday paradox with d = 365.

Why Binary Output Spaces Can Still Have Collisions

A system producing n-bit outputs has:

2^n

possible bit patterns.

The relationship between bits and possible patterns comes from binary numbers.

If outputs behave like independent uniform selections, a birthday-style collision analysis uses:

d = 2^n

The rough 50% collision scale is therefore proportional to:

√(2^n)

which is:

2^(n/2)

This is a direct application of the generalized birthday principle, not a claim that ordinary binary arithmetic itself creates collisions.

Simulation of the Birthday Paradox

The birthday paradox can also be estimated experimentally.

A simulation can:

  1. Generate n random birthday values from 1 to 365.
  2. Check whether any value appears more than once.
  3. Repeat the experiment many times.
  4. Divide the number of trials containing a collision by the total number of trials.

As the number of simulation trials increases, the estimated probability should approach the theoretical value when the random generator follows the same assumptions.

For n = 23, a sufficiently large simulation should approach:

≈ 0.5073

Common Birthday Paradox Mistakes

Comparing 23 Directly With 365

The probability is driven by pair opportunities, not simply the ratio:

23/365

Asking About One Specific Birthday

The standard birthday paradox asks whether any pair shares a birthday.

That differs from asking whether someone matches one predetermined person’s birthday.

Adding Pair Probabilities Directly

The pair events can overlap, so:

C(n,2)/365

is not the exact probability.

Forgetting the Complement

The simplest exact route is:

P(match) = 1 – P(no match)

Treating 50.73% as Exactly 50%

For 23 people, the standard probability is approximately:

50.73%

not exactly 50%.

Ignoring Model Assumptions

The familiar result assumes 365 equally likely independent birthday dates and excludes leap day.

Thinking “Paradox” Means Contradiction

The mathematics is internally consistent. The result is called paradoxical because it conflicts with common intuition.

Worked Birthday Paradox Example

Find the probability that at least two people share a birthday in a group of:

4 people

Assume 365 equally likely birthdays.

First calculate the probability of no match.

The first person can have any birthday:

365/365

The second must differ:

364/365

The third must differ from both earlier birthdays:

363/365

The fourth must avoid all three used birthdays:

362/365

Therefore:

P(no match) = (365/365)(364/365)(363/365)(362/365)

Approximately:

P(no match) ≈ 0.983644

Then:

P(match) = 1 – 0.983644

≈ 0.016356

So the probability of at least one shared birthday is approximately:

1.64%

The probability is still small with four people, but it accelerates as the number of possible pairs grows.

Frequently Asked Questions

What is the birthday paradox?

The birthday paradox is the result that a relatively small group can have a surprisingly high probability of containing at least one pair of people with the same birthday.

How many people are needed for a 50% birthday match probability?

Under the standard 365-day model, 23 people give a probability of approximately:

50.73%

which is the first group size above 50%.

What is the birthday paradox formula?

For n ≤ 365:

P(match) = 1 – 365! / [(365 – n)!365^n]

Why do you calculate no matching birthdays first?

The no-match event has a simple sequential product. The desired event is its complement:

P(match) = 1 – P(no match)

How many pairs are there among 23 people?

C(23,2) = 253

Does 23 people mean someone probably shares my birthday?

No. The 50.73% result refers to any pair among the 23 people, not a match with one specified person.

What is the probability with 50 people?

Under the standard assumptions, the probability of at least one shared birthday is approximately:

97.04%

When does the probability exceed 99%?

At about:

57 people

the standard probability is approximately 99.01%.

Is a shared birthday guaranteed with 366 people?

Yes, under a 365-day birthday model. With 366 people and only 365 possible birthday categories, at least two must share a category.

Why is it called a paradox?

Because the result often conflicts with intuition. It is not a logical contradiction.

Does the classic formula account for leap years?

Usually not. The standard model uses 365 equally likely birthdays and ignores February 29.

Where else does the birthday paradox apply?

The same collision mathematics appears whenever many random selections are made from a finite set of possible values, including hashing and other identification or assignment systems.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button