How many people do you have to put into a room before you are guaranteed that at least two of them share a birthday?

We all know and love the blissful feeling of winning an argument. Well, trust me, that’s an even better feeling if you’re a mathematician.

It’s not a matter of finding the right words – rather it’s the right ideas applied in a rigorous manner. And when this is done properly, the winner of the argument becomes known to everyone in the room.

The loser skulks back to his place of study, bloodied and bruised, to lick his or her wounds. What had seemed intuitively right is cancelled by a couple of lines of mathematics scrawled on the back of an envelope.

Maybe that’s why mathematicians live in harmony, at least most of the time. We understand that belief and intuition can guide us towards a result, but these are not vessels capable of delivering final proof.

The Monty Hall Problem, which I wrote about recently, is a fine example of simple mathematics defying general intuition. And when I say defying, I really mean guiding: every time we are subject to such a striking idea our intuition actually aligns itself just that little bit more with reality.

In the spirit of sharing more paradigm-shifting mathematical delights with you all, we will consider another problem which will hopefully tug your belief system that little bit more.

## A simple question

So, again:

how many people do you have to put into a room before you are guaranteed that at least two of them share a birthday?

The solution is fairly simple; there are 366 possible days (damn those leap years) that somebody can be born on. So if you had 367 people in a room, there’s no way to assign each of them a birthday without having to use a date more than once.

The above idea is known to mathematicians as the pigeonhole principle: if you have to sort items into pigeonholes, and there are more items than pigeonholes, then at least one pigeonhole has to contain more than one item.

The same principle lends itself to proving statements such as “in Sydney there will be at least two people with the same number of hairs on their head”.

## A less simple question

Have a think about the following related problem:

How many people do you have to put into a room before you have a more than 50% chance that at least two of them share a birthday?

Most people guess 184, as this is a bit more than half of 366.

But the correct answer is actually 23. If you throw 23 randomly selected people into a room then it’s more likely than not that two of them share a birthday.

I’ve never seen anybody ballpark this number, or anything remotely close to it. It’s a counterintuitive result. Of course, I’m hoping that I can convince you with the following argument (calculators out, please).

## The dirty details

Let’s make an assumption for simplicity, but this won’t void the argument. Just consider a regular year of 365 days and assume that all 365 birthdays are equally likely.

Sure, it’s known that in reality the birthdays of the population are subject to some variation but that’s OK – any sort of irregularities in reality would only increase the chances of a shared birthday.

So, we have a room of 23 people. We will actually calculate the probability that they all have different birthdays and show that this is less than 50%.

We walk in to our room, grab a person – Frank – and put him to the side. We then choose another person, Betty. The probability that Betty has a different birthday to Frank is 364/365, as there are 364 days in the year that Frank was not born on.

We then grab another person – Shazza – and bring her over to the side. There is a 363/365 probability Shazza doesn’t share a birthday with Frank and Betty, as there are 363 remaining days their birthday could fall on.

If we keep doing this, bringing a person over and calculating the probability that they don’t share a birthday with the group before adding them to the group, we generate a bunch of probabilities:

364/365, 363/365, 362/365, … , 344/365, 343/365

The first probability arose from demanding that Frank and Betty do not share birthdays. The second probability has that Shazza doesn’t share a birthday with Frank or Betty. The probabilities continue in this way.

If we wanted to know the overall probability – that is, the probability that no two people share a birthday – we need to multiply together all of the above probabilities. In doing so we get that there is a 49.27% that none of them share a birthday, and this means that there is a 50.73% chance that at least two of them share a birthday!

You can have a go at repeating the calculation for numbers other than 23. In particular, you can prove that 22 people isn’t enough for a more than 50% chance. Also, 57 people will give you a 99% chance of a shared birthday!

Here’s a graph that shows the probability of a shared birthday given different numbers of people in a room.

And if you happen to be celebrating your birthday today, many happy returns.

## Stephen Ralph

carer

I have 3 siblings. My sister's daughter and I share a birthday, and one brother's son shares a birthday with my other brother.......beat that.

## Hugh McColl

Geographer

For what it's worth, my wife's birthday is the same as both her mother's and father's.

## Stephen Ralph

carer

I think that wins.........perhaps we need odds from the experts!

## Reedan

logged in via Twitter

Stephen, I think we just did ;)

## Kenneth Mazzarol
Kenneth Mazzarol is a Friend of The Conversation.

Retired

I have two others who share my birthday, 12th September. I found four others but they didn't respond to my email. Anyone else interested???

## Mike Swinbourne

logged in via Facebook

12 September is my wife's birthday

## Kenneth Mazzarol
Kenneth Mazzarol is a Friend of The Conversation.

Retired

Thank you Mike. That's one out of how many readers?? How does the math stack up??

## Peter Boyd Lane

geologist

I have often wondered about chance and how maths compares to reality. Suppose you have a jar full of hundreds-and-thousands, just 2 colours, black and red. Maths may show you how many times it needs to be shaken to have all the reds at th bottom, all the blacks at the top. Fine. But is the realty that no matter how many times it is shaken, this will never happen?

## Joe Monterrubio

logged in via email @westnet.com.au

Depends.

If the jar is the size of a thimble then good luck and I hope you're really, really patient.

The bottom line is there are many, many more ways that the hundreds and thousands can be distributed that are disordered than are ordered. It'd be like shuffling a pack of cards and having them come out in suit and number order: there are only 4*3*2*2 different ways cards can be arranged thus. Choose one from the four suits, then one from the three remaining, then one from the two remaining then whether the cards are in ascending or descending order... plus I guess you could also have aces high or low. That's a very, very, very small number compared to 52 factorial!

52! = 52*51*50 ... *2*1

= 8.07 * 10^67

## Adrian Dudek

PhD Candidate at Australian National University

Thanks for the question Peter! Sure; the reality of the situation is very different to what we can model. The general idea is to make certain assumptions (for simplicity) before putting pen to paper. There is no exactness here, but we do (if our assumptions are fair) get a fair indication of what's going to happen.

Once we've modelled the scenario in a simple way, it's then time to try and make our assumptions more realistic. It's never perfect, and never claims to be, but the current state of…

Read more## Joe Monterrubio

logged in via email @westnet.com.au

Arthur C Clarke described the shared birthday problem in his novel A Fall of Moondust. On reading the title of this article, I remembered reading that the number of people needed to have a 50% chance of a shared birthday was about thirty... not too far off!

## Adrian Dudek

PhD Candidate at Australian National University

Thanks Joe! I've never read the book, though perhaps I have a reason to now! I've just done the calculation, and thirty people would give around a 70% chance of a shared birthday.

## Peter Boyd Lane

geologist

Thanks Adrian. I accept that, but my real concern is that although the maths may say I have a chance of winning the lottery, no matter how often I'd buy a ticket I never would!

## Adrian Dudek

PhD Candidate at Australian National University

Maths will meet reality almost exactly here, by saying that you have a small chance of winning the lottery.

For example, if you were to calculate the odds of winning the lottery in a given week as 1 in 40 trillion, then it's expected that you would need to buy close to 40 trillion tickets to win. So maths will say something like "your chances are absurdly low, but not impossible". Reality says the exact same thing, as people still win the lottery.

So sure, we probably shouldn't go spending our money on lottery tickets. But it's incorrect to say that we would never win. Only that it's ridiculously unlikely!

## Peter Boyd Lane

geologist

Shoud not have taken that so literally Adrian!

## Adrian Dudek

PhD Candidate at Australian National University

Apologies! It's hard thing to do for a mathematician :) Thanks Peter!

## Michelle O'Brien

logged in via email @gmail.com

Interesting piece.. My mother, maternal grandmother and I all share a birthday. Three generations of women on the one day. I was 3 weeks late and a 36hr labour so clearly determined to be on born on that date.

And to add to this quirk, my maternal grandmother had another child, a son, on her/our birthday, but very sadly he was stillborn.

I often wonder what are the chances. I'm yet to find someone else with 3 generations, from the same line, on the one day.

## Stephen Ralph

carer

Well that takes the birthday cake...................................

## Jim KABLE

teacher

Many years ago I read that the chances were that 20 (as I have always recalled it - not your more precisely calculated 23) people in a room would more than likely find two sharing a birthday. Teaching in Japan I can't remember the number of times with new class groups with whom I would prove this principle - in fact I can't recall a time with at least 30 in the class that it ever failed! It stills seems amazing - but there you are - I am not a mathematician.

## Adrian Dudek

PhD Candidate at Australian National University

Indeed, 30 people would give a 70% chance of a shared birthday. I think it's great that you had the students not only learn but see the solution to the puzzle. Certainly a nice fact to take home from the classroom.

## George Michaelson

Person

It crops up on the Internet in 'unique locally assigned' (ULA) Internet Version 6 Addresses, which are semi-random numbers generated by an entity which doesn't want to apply for centrally assigned global unicast IPv6 addresses, but just 'spins the dial' to pick a range which is probabilistically unique. They can then use this as a local Internet address range with very low risk of collision with anyone else, should their networks combine or talk to each other.

There was some concern of the risk of two or more entities managing to acquire the same random throw. In a room of 26 people its unlikely, but across the world?

## Roger Wilkins

Principal Research Fellow and Deputy Director (Research), HILDA Survey, Melbourne Institute of Applied Economic and Social Research at University of Melbourne

I am reasonably sure that you need fewer than 23 people for a 50% probability of 2 or more people sharing a birthday. Empirically, births are not equally distributed across all 366 days. Aside from February 29 birthdays being rare, there are seasonal patterns to births. This makes the calculation considerably more difficult, so I don't plan to prove it here.

## Tim McMaster

Software Developer/Environmental Mgmt Student

A more specific problem, and one that ties in to this is "How many people do I need in a room to have a > 50% chance that some one shares MY birthday?"

On the basis of the above calculations, one MIGHT assume that since having 23 people in a room gives a 50% chance of 2 people having a shared birthday, and my chances of being one of the 2 is 2 in 23, then I would need 23 / (2/23) people or 265 people.

I had a feeling that it might be a much larger number than this, but if calculated on the basis of the chances of each person not sharing MY birthday (i.e. 364/365 for each new person added), the actual number is 253 people.

## Warwick Smith

Postdoctoral research fellow in Environmental Economics at University of Melbourne

Hi Adrian,

Read moreThanks for the article but I don't really understand it. The latter probability problem makes perfect sense. The starting problem doesn't make any sense to me, nor the hairs on the head example. Here's the question:

"how many people do you have to put into a room before you are guaranteed that at least two of them share a birthday?"

To which my immediate and intuitive answer - before reading yours - was "an infinite number". I thought this because, unlikely though it may be, the first…

## Tim McMaster

Software Developer/Environmental Mgmt Student

Hi Warwick,

Isn't it just asking that 2 distinct people share the same day of the year as a birthday? Not that 2 distinct days of the year are shared...

If this is the case then both your examples of 1000 or 100,000 meet the first criteria don't they?

Maybe it's less complex than you think? Or are you playing semantics and word games that i've missed?

Cheers

Tim

## Adrian Dudek

PhD Candidate at Australian National University

Thanks for the questions Warwick!

You essentially suggested that one might avoid a shared birthday by postulating that the first 1000 people share a birthday. Though if the first 1000 people share a birthday then you already have a shared birthday. You have a shared birthday if even the first two people share a birthday.

Think of it this way. You've got a room and you slice it up into 365 different areas; one for each possible date of birth. As people walk into the room, you send them off into…

Read more## Greg Adcock

Scientist

Hi Adrian,

great article and well done for not introducing that damned exclamation mark.

I've used that exact question in many circumstances - the first time in public was"Einstein A Go Go", 3RRR 1989. It can engender a lot of interesting discussion and even works at parties.

Another way to ask it is, "What is the chance of two people sharing a birthday in an AFL football team (including the bench players)".

A team of 22 gives an answer close enough to 50% to armwave away the difference.

## Adrian Dudek

PhD Candidate at Australian National University

Thanks Greg! I love the example of an AFL team, though being a fan of good old 11-a-side soccer, I might look at birthday sharing on a pitch between the two teams.

## Greg Adcock

Scientist

Adrian, your football pitch idea is actually superior. The ref makes it 23.

## Adrian Dudek

PhD Candidate at Australian National University

Fantastic! This will make for some pleasant on-field chatter during my next game. Thanks Greg!

## Martin Nicholson

Energy researcher and author

So Adrian, how many people need to be in the room for two to have the same birthday AND are the same age (same birth date). I have a colleague who was born within 12 hours of me but on the opposite side of the world.

## Adrian Dudek

PhD Candidate at Australian National University

Hi Martin,

Great question! Just as we've assumed that every day of the year is equally likely as a birthday, we might also assume that all possible ages are likely too. It's likely that there are more youngs than olds in reality but let's see what happens mathematically. I'm going to assume that we are selecting randomly people between the ages of 0 to 100.

My calculation says that 227 is the required number in the room (with the above assumptions). How many are at your work Martin?

By assuming that days and years are distributed uniformly we actually get the worst possible estimate. We would actually expect less people needed in reality.

## Martin Nicholson

Energy researcher and author

It's actual my Bridge Club. There are probably 100 members and our ages would span probably not much more than 30 years. So it is quite likely that someone else shares by birth date.

When I ask people in the club what they think the number should be they usually suggest thousands to even millions. When I tell them it is quite likely given the age span and number of members in the club they find it hard to believe.

## Adrian Dudek

PhD Candidate at Australian National University

It can be hard to believe! I've chucked in the age span of 30 and with 100 people in the room it makes for a 36% chance of a shared same-age birthday. You would need 124 people with an age span of 30 to get over 50%.

## Martin Nicholson

Energy researcher and author

I just got lucky I guess. I call him my twin brother :)

## Reedan

logged in via Twitter

I have 2 children.I share my birthday with my son and my daughter share hers with her mother. We are curious to know how many people can say that.

## Reedan

logged in via Twitter

Adrian, what are the odds of that happening?