What is the probability that at least two students have the same birthday

Probability of Shared Birthdays
or, How to Win Money in Bar Bets

Copyright � 2001�2022 by Stan Brown, BrownMath.com

Summary: In a group of 30 people, would you be surprised if two of them have the same birthday? As it turns out, you should be more surprised if they don�t.

There are 365 possible birthdays. (To keep the numbers simpler, we�ll ignore leap years.) The key to assigning the probability is to think in terms of complements: �Two (or more) people share a birthday� is the complement of �All people in the group have different birthdays.� Each probability is 1 minus the other.

(a) What is the probability that any two people have different birthdays? The first person could have any birthday (p = 365�365 = 1), and the second person could then have any of the other 364 birthdays (p = 364�365). Multiply those two and you have about 0.9973 as the probability that any two people have different birthdays, or 1−0.9973 = 0.0027 as the probability that they have the same birthday.

(b) Now add a third person. What is the probability that her birthday is different from the other two? Since there are 363 days still �unused� out of 365, we have p = 363�365 = about 0.9945. Multiply that by the 0.9973 for two people and you have about 0.9918, the probability that three randomly selected people will have different birthdays.

(c) Now add a fourth person, and a fifth, and so on until you have 22 people with different birthdays (p ≈ 52.4%). When you add the 23rd person, you should have p ≈ 49.3%.

(d) If the probability that 23 randomly selected people have different birthdays is 49.3%, what is the probability that two or more of them have the same birthday? 1−0.493 = 0.507 or 50.7%. In a randomly selected group of 23 people, it is slightly more likely than not that two or more of them share a birthday.

For n people (n ≤ 365), your chain of n fractions would be

and therefore

On your TI-83, to get 365Pn you first enter the 365, then press [MATH] [◄] to get the PRB menu and [2] for nPr, then enter the second number (n). In Excel, it�s PERMUT(365,n).

What if n > 365? In this case there is no need for any calculations (and in fact the above formula won�t work). If there are 366 or more people, but only 365 possible birthdays disregarding leap year, then two or more of them must share a birthday.

Here are some sample results:

Probability in a group of n people
that 2 or more have the same birthday
10 0.117
20 0.411
22 0.476
23 0.507
30 0.706
40 0.891
50 0.970

You can see that the dividing line is between 22 and 23 people. In a group of 22 people, the odds are less than 50�50 that two share a birthday; in a group of 23, the odds are better than 50�50. In a bar with even a small crowd, if you can get someone to take your bet that two people share a birthday, you�ll win more often than you lose.

In a randomly selected group of 50 people or more, it is nearly certain that two or more will share a birthday (p ≥ 97%). On a crowded Friday night you can really clean up � if nobody else in the bar knows probability!

Excel Workbook

You can download an Excel workbook to compute the probability of shared birthdays for any size group.

The workbook uses two methods to compute these probabilities. Method 1 uses the formula shown above. You�ll notice #NUM errors for groups larger than n = 120, because 365121 is bigger than the largest number Excel can handle. In this particular case that�s not a problem, because the probability is effectively 1 for n > 118 anyway, but still all those #NUM cells look strange.

Method 2 solves this by computing the probability for each size group from the probability for a group one person smaller, just as I did in steps (a) through (d) above. That way Excel never has to deal with numbers bigger than 365 in any one step, and the #NUM errors are avoided.

What�s New?

  • 19 Sept 2020: Added an Excel workbook.
  • 25 May 2003: New article.

Today’s problem goes out to a special new member of the family. Welcome to the world my niece, Edison Grace Berry! My brother’s beautiful baby girl was born on his 36th birthday this past Saturday and of course this coincidence made me think of the Birthday Problem.

So here it is: a special math problem for a special little girl. Someday you’ll know all the math to understand this post (trust me, I’ll make sure of it!).

→ For more math tutorials, check out Math Hacks on YouTube!

The Birthday Problem in Real Life

The first time I heard this problem, I was sitting in a 300 level Mathematical Statistics course in a small university in the pacific northwest. It was a class of about 30 students and the professor bet that at least two of us shared the same birthday.

He then proceeded to have everyone state their birthday. When it came to my turn I stated my birthdate as “two cubed, three cubed,” which made the class laugh as our cerebral professor took awhile to decipher the date.

Anyway like he predicted before he got to the last student a pair of matching birthdays had been found.

So how lucky was it that he found a matching pair?

Warm-Up

Assumption: for the sake of simplicity we’ll ignore the possibility of being born on Feb. 29th.

Let’s begin with a simple example to warm up our brains:

What is the probability that two people share the same birthday?

Person A can be born on any day of the year since they’re the first person we’re asking. The probability of being born any day of the year is 1 or more specifically: 365/365.

Since Person B must be born on the same day as Person A their probability is 1/365.

We want both of these events to happen so multiply the probabilities:

The probability that any randomly chosen 2 people share the same birthdate.

So you have a 0.27% chance of walking up to a stranger and discovering that their birthday is the same day as yours. That’s pretty slim.

But what about a larger group?

What’s the chance that at least 2 out of 4 people share the same birthday?

Well to solve this problem we’d have to calculate all ofthe following:

  • Probability A and B share the same birthday
  • Probability A and C share the same birthday
  • Probability A and D share the same birthday
  • Probability B and C share the same birthday
  • Probability B and D share the same birthday
  • Probability C and D share the same birthday
  • Probability A, B and C share the same birthday
  • Probability B, C and D share the same birthday
  • Probability A, C and D share the same birthday
  • Probability A, B and D share the same birthday
  • Probability A, B, C and D all share the same birthday

Yuck, that’s a lot of calculations! Imagine how many probabilities we’d have to calculate for a classroom of 30 students!

There’s gotta be a better way…

A Better Way: the Trick of the Complement

The simplest way of getting around calculating a bajillion probabilities is to look at the problem from a different angle:

What’s the probability that no one shares the same birthday?

This alternate exercise is helpful because it is the complete opposite of our original problem (i.e. the complement). In probability, we know that the total of all the possible outcomes (i.e. the sample space) is always equal to 1, or 100% chance.

Since the probability of at least 2 people having the same birthday and the probability of no one having the same birthday cover all possible scenarios, we know that the sum of their probabilities is 1.

Or equivalently:

Using the complement to solve our problem

Yay! That’ll be much easier to calculate.

The Calculation

Awesome! We’re finally ready to find out how safe a bet the professor made.

Let’s work out the probability that no one shares the same birthday out of a room of 30 people.

Let’s take this step by step:

  • The first student can be born on any day, so we’ll give him a probability of 365/365.
  • The next student is now limited to 364 possible days, so the second student’s probability is 364/365.
  • The third student may be born on any of the remaining 363 days, so 363/365.

This pattern continues so that our last student has a probability of 336/365 (365 – 29 days since the students before her used up 29 potential days).

Again multiply all 30 probabilities together:

probabilities 361/365 to 338/365 not shown

Hold up! That’s a little messy. Let’s clean this up.

Since the denominator is thirty 365’s multiplied together, we could rewrite it as:

Let’s use factorials (symbolically: !) to further clean this calculation up.

(Remember factorials are handy for multiplying together descending positive integers. For example 5! equals 5•4•3•2•1 = 120.)

Using factorials, 365! would equal the product of all descending integers from 365 down to 1. We only want the product of the integers from 365 to 336, so we’ll divide out the extraneous numbers by dividing 365! by 335!.

Note: if this confuses you try a smaller value like 5!/3! = 5•4•3•2•1 / 3•2•1. Notice how the 3•2•1 are in both the numerator and denominator. They ‘cancel out’ making 5!/3! = 5•4.

Putting it all together we now have an expression that can be easily entered on a scientific calculator:

the simplified form of the 30 probabilities product from above

This computes to 0.294 or 29.4% chance no one in the class has the same birthday. Of course, we want the complement so we’ll subtract it from 1 to find the probability that at least 2 people in a group of 30 share the same day of birth.

The probability at least 2 people in 30 share the same birthday

Turns out it was a pretty safe bet for our professor! He had a nearly 71% chance that 2 or more of us would share a birthday.

A Fifty-Fifty Chance

Many people are surprised to find that if you repeat this calculation with a group of 23 people you’ll still have a 50% chance that at least two people were born on the same day.

That’s a relatively small group of people considering that there are 365 possible birthdays! Meaning that in any group of more than 23 people it is likely that at least 2 people share the same day of birth.

What a crazy little factoid!

❤ STAY CONNECTED ❤

Stay up-to-date with everything Math Hacks is up to!

Instagram | Facebook | Twitter

Related Reading

What is the probability that at least 2 students have the same birthday?

What's the chance that two people share the same birthday? The first person can be born on any day of the year, this means that the probability is 365/365 = 1. The second person has to be born on the same day as the first and there is a 1/365 chance of that happening.

What is the probability that two people share the same birthday?

The birthday paradox - also known as the birthday problem - states that in a random group of 23 people, there is about a 50% chance that two people have the same birthday. In a room of 75 there's even a 99.9% chance of two people matching. The birthday paradox is strange, counter-intuitive, and completely true.

What is the probability that at least 2 students will have the same birthday in a class of 45 students?

The chance that THEY have the same birthday is 1/365. Consider the remaining 27. The first of them has a chance of 364/365 of not having the same birthday as the selected two.

How do you calculate the probability of the same birthday?

The goal is to compute P(A), the probability that at least two people in the room have the same birthday. However, it is simpler to calculate P(A′), the probability that no two people in the room have the same birthday. ... Calculating the probability..

Chủ đề