Birthday Problem (variation)

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

knight427
Worshipful Sycophant
Posts: 240
Joined: Mon May 14, 2007 6:45 pm UTC
Location: Wisconsin
Contact:

Birthday Problem (variation)

Someone made a claim about birthdays that made me think of the well-known birthday problem. I wanted to compute the probability but was unable to. I'd appreciate your help.

What is the probability that at least 15 students in a class of 20 share the same birth month (assuming equally likely birth months).

For bonus points, generalize it to:
What is the probability that at least n things in a group of p things share a characteristic from a set of q possibilities.

Thanks
knight427

If you GIVE a zombie a fish, you will feed him for minute.
If you TEACH a zombie to fish, he will be munching on you for hours.

Kuben
Posts: 1
Joined: Sat Feb 23, 2013 11:27 pm UTC

Re: Birthday Problem (variation)

Hmm this was harder then I thought, can't figure it all out but feel like I should know how to do it. Anyway here is what I think.
First we see how many ways we can pick 15 from a group of 20.
That is 20!/(15!*5!) = 15504
Then we take this times (1/12)^15 to see the chance of all of them having the same specific birthday month. Multiply with (11/12)^5 so that none of the remaining are born the same month.
Then repeat for case 16, 17, 18, 19 and 20 and ad it all up.

General formula with n, p, q:
Sum p!/(k!(p-k)!q^(k-1))*((q-1)/q)^(p-k) for k=n to k=p
To get ~8.04*10^-12

This is where I got a problem, I think we should just multiply with 12 since we don't care what month it is.
But then the formula doesn't work for n=3 and if we take 1-(1-sum)^12 then the formula doesn't work for n=2.
I'm sure that the first sum formula works for specific months but the problem occurs when n is smaller then p/2 and we want to
know any month since the sum formula doesn't take into account if there are multiples of the same month in the remaining set.

snowyowl
Posts: 464
Joined: Tue Jun 23, 2009 7:36 pm UTC

Re: Birthday Problem (variation)

The probability that at least 15 students were born in January is given by this WolframAlpha calculation. It comes to about 6.7x10-13. The probability that at least 15 students were born in the same month (any month) is clearly 12 times this. Pretty much negligible.

The general problem seems harder to me, because you have to account for the possibility that there are several groups of n things that were born in the same month (if n≤p/2).
The preceding comment is an automated response.

Gwydion
Posts: 336
Joined: Sat Jun 02, 2007 7:31 pm UTC
Location: Chicago, IL

Re: Birthday Problem (variation)

Spoiler:
At least 15 means 20, 19, 18, 17, 16, or 15 sharing a birth month. The likelihood of n people out of 20 sharing a birth month is (20Cn)*11^(20-n)/12^19, where 20Cn represents the number of ways n things can be chosen from a pool of 20. The rest is simplified from (1/12)^n times (11/12)^(20-n), multiplied by 12 since there are 12 months for those people to share. Wolfram alpha calculates the sum of these terms for n=15 to n=20 to be about 1x10^-9.

The above only works for n>10, since for smaller values you would need to subtract out the possibility of having two groups of n students that each share a different birth month. As a limiting case, for n=2, the probability is 1 by the pigeonhole principle.

I'm at work and don't have time to finish the general case, but here's a start:
For n>p/2, the general case simplifies to the sum above: (pCk)*(q-1)^(p-k)*(1/q)^(k-1) summed over k= n to k=p.
For n<p/q, P=1
For p/q<n<p/2...

knight427
Worshipful Sycophant
Posts: 240
Joined: Mon May 14, 2007 6:45 pm UTC
Location: Wisconsin
Contact:

Re: Birthday Problem (variation)

Thanks snowyowl and Gwydion.
knight427

If you GIVE a zombie a fish, you will feed him for minute.

If you TEACH a zombie to fish, he will be munching on you for hours.

patzer
Posts: 432
Joined: Fri Mar 30, 2012 5:48 pm UTC
Contact:

Re: Birthday Problem (variation)

generalized solution
Spoiler:
the number of possible ways to get N things out of P things is :
N/P * (N-1)/(P-1) * (N-2)/(P-2) ...
= N!/(P!/(P-N!))
= N!*(P-N)!/P!

when you have the specific set of N things:
remove a random one of the N things
the chances of any other one of these things being the same as the randomly chosen one is 1/Q
therefore the chances of all of the other things being the same as the randomly chosen one is 1/QN-1

multiply this by the number of ways to choose that set of N things

[N!*(P-N)!] / [P!*QN-1]

sorry if my explanation wasn't very clear, but i think it's correct

EDIT: rechecked that answer, I think it is wrong.
EDIT2: indeed, it is very wrong. must stop doing maths when I'm tired.
If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family Anatidae on our hands. –Douglas Adams

Posts: 69
Joined: Sat Mar 21, 2009 3:45 am UTC
Location: Perth, Western Australia

Re: Birthday Problem (variation)

This is only tangentially related, but I want thoughts on it:

I found out that my new boyfriend and my most recent ex-boyfriend have the same birthday (but 9 years apart). I told the new boyfriend this, thinking it's an amazing coincidence, and he said that it's not amazing at all because of the birthday problem. Whilst I agree with the probabilities associated with the birthday problem, I haven't dated 20 men (I've dated 5, fwiw), and the fact that they're consecutive makes it an interesting coincidence.

What probability is best ascribed to this circumstance?

Furthermore, my boyfriend insists that it's more interesting that he and a friend of mine have the same favourite youtube video, but I contend that the video in question (the japanese video with Ronald McDonald doing all sorts of crazy stuff) is probably at least in the top 200 viral youtube videos, so it's a less interesting coincidence. Not to mention it's a friend who likes the video rather than my previous boyfriend, which is a less "special" person; I have dozens of friends who could have had that favourite video and still impressed him.

I'm writing a supernatural romance novel, it updates the first weekend of every month. You can find it here.

Xias
Posts: 363
Joined: Mon Jul 23, 2007 3:08 am UTC
Location: California
Contact:

Re: Birthday Problem (variation)

Madge wrote:This is only tangentially related, but I want thoughts on it:

I found out that my new boyfriend and my most recent ex-boyfriend have the same birthday (but 9 years apart). I told the new boyfriend this, thinking it's an amazing coincidence, and he said that it's not amazing at all because of the birthday problem. Whilst I agree with the probabilities associated with the birthday problem, I haven't dated 20 men (I've dated 5, fwiw), and the fact that they're consecutive makes it an interesting coincidence.

What probability is best ascribed to this circumstance?

Even if you had dated 20, 30, or even 1000 men, the probability of getting the same birthday twice in a row is incredibly small. In fact, the more guys you date, the probability of none of them sharing a birthday except the two most recent ones shrinks.

The probability of your exact situation (five guys, where the last three share a birthday and none of the rest do) is a bit less than 3 in one thousand. (365/365 * 364/365 * 363/365 * 362/365 * 1/365 = 0.0026949153).

Of course, you probably have an ideal age, with a normal distribution around it, of guys that you like to date, so days closer to that ideal age may be more probable - made even more silly when you consider leap years.

Madge wrote:Furthermore, my boyfriend insists that it's more interesting that he and a friend of mine have the same favourite youtube video, but I contend that the video in question (the japanese video with Ronald McDonald doing all sorts of crazy stuff) is probably at least in the top 200 viral youtube videos, so it's a less interesting coincidence. Not to mention it's a friend who likes the video rather than my previous boyfriend, which is a less "special" person; I have dozens of friends who could have had that favourite video and still impressed him.

Given that you hopefully have more than one friend, and they aren't ranked in any order (such as chronological, like your boyfriends) I'd say the odds of finding some friend who likes the same popular video is incredibly high. Much, much higher than 3/1000.

Posts: 69
Joined: Sat Mar 21, 2009 3:45 am UTC
Location: Perth, Western Australia

Re: Birthday Problem (variation)

Thanks for the insight! I must have phrased it wrong, but it's only the two most recent chronologically by start date of relationship that share a birthday. I'm polyamorous so I can have multiple relationships going at once which confuses matters depending on how we're going to count chronology.

So, to make things clearer, I have:

#1, birthday October 30th 1988 (I think), dated circa 2006
#2, birthday February 17th 1987, dating since 2007
#3, birthday sometime in June/July 1985, dated between September 2011 and June 2012
#4, birthday August 31st 1987, dated between April 2012 and Jan 4 2013
#5, birthday August 31st 1978, dating since Jan 28 2013

It's all moot, though, since it's still clearly more interesting than the youtube video. (Especially when you take into account that some youtube videos have qualities that make them more appealing as favourites; doubly so when you consider friends and boyfriends will likely have similar interests/personalities)

But I've just realised #4 and #5 have the same digits in their years, just transposed! That's even cooler.

I obviously have a preference in the age of guys I date (people who are in their mid-late 20s at the moment), but the time of year doesn't seem to matter.
I'm writing a supernatural romance novel, it updates the first weekend of every month. You can find it here.

mike-l
Posts: 2758
Joined: Tue Sep 04, 2007 2:16 am UTC

Re: Birthday Problem (variation)

The odds are indeed pretty slim, but the only reason you're considering the criteria is because its true in your case. The number of possible patterns you might notice vastly exceeds the odds of them happening. I happen to share a birthday with my sister, my uncle, and my friend, the odds of which are probably pretty low, but again I'd only calculate the odds because its something that I observed happening.
addams wrote:This forum has some very well educated people typing away in loops with Sourmilk. He is a lucky Sourmilk.

Posts: 69
Joined: Sat Mar 21, 2009 3:45 am UTC
Location: Perth, Western Australia

Re: Birthday Problem (variation)

That's more or less what he said to me:

The birthday thing is confounded by the fact that it's not clear what we're
comparing. I agree that the probability of dating five guys, exactly the
last two of whom share a birthday, is incredibly small; but that's a silly
probability to use. Indeed, the probability of any particular permutation
of birthdays is exactly the same, so if you get specific enough, they're
all equally unlikely. For example, the probability of getting 30/10/88,
17/2/87, x/y/85, 31/8/87, and 31/8/78 (for any particular x and y) is
exactly the same as the probability of getting 1/1/81, 2/2/82, 3/3/83,
4/4/84, and 5/5/85.

...

The only way to avoid hindsight bias is to specify up-front what
you would consider an impressive coincidence/prediction. But it's too
late for that in this case, so the next best thing is to ask what sort
of coincidence would have impressed you.

I think you'd have been impressed if I had the same birthday as any of
your other boyfriends. I don't think impressing you would require that
my birthday be the same as your last ex-boyfriend's birthday specifically;
rather, that's just an extra bit of specific information that you noticed
after the fact.

Similarly, I don't think the "reverse year digits" thing is part of what
it would take to impress you. It also occurs to me that once you're
allowed to manipulate numbers like that, it becomes much easier to find
coincidences. Indeed, that's basically what the Bible Code is all about.

Meanwhile, I don't accept that the Ronald McDonald Insanity video is all
that popular: it has fewer than seven million views, which really isn't
much for a popular video on YouTube.

Of course, it's worth noting that I'd have been impressed if I had the
same favourite YouTube video as any of your close friends (n ~= 20?),
whereas you'd only be impressed if I had the same birthday as any of
your other boyfriends (n = 4), so that works in your favour.
I'm writing a supernatural romance novel, it updates the first weekend of every month. You can find it here.

Vytron
Posts: 432
Joined: Mon Oct 19, 2009 10:11 am UTC
Location: The Outside. I use She/He/Her/His/Him as gender neutral pronouns :P

Re: Birthday Problem (variation)

Madge wrote:This is only tangentially related, but I want thoughts on it:

I found out that my new boyfriend and my most recent ex-boyfriend have the same birthday (but 9 years apart). I told the new boyfriend this, thinking it's an amazing coincidence, and he said that it's not amazing at all because of the birthday problem. Whilst I agree with the probabilities associated with the birthday problem, I haven't dated 20 men (I've dated 5, fwiw), and the fact that they're consecutive makes it an interesting coincidence.

What probability is best ascribed to this circumstance?

Supplemental non-scientific commentary
Spoiler:
Did you know that Zodiacally you're more likely to date people of the same sign, or to some signs while not others? And also, that you're more unlikely to date someone that has the same sign as you? (unless you're a Capricorn.)

Taking this into account, it is more likely that two of the persons you date share the same birthday, moreso than the expected distribution. I'd bump your chances of your last two boyfriends sharing the same birthday to "just" 0.0080847459.

Also, by the same metric, people of the same sign tend to have similar personalities (though, this is heavily influenced by the hour of birth) which would make it more likely to have the same favorite video (at least, people being born on the same date are - if only because they'd share a similar list of videos they dislike, and they'd be ruled out from the formula.)

The guys that you like to date will have an ideal personality matching some signs ranges, which will make the signs you're incompatible with to appear less often[citation needed].
Go! Go! You can do it username5243!
Cheers Marsh'n!