Bored? You must be; you’re reading my blog.

So, here’s a quiz for you. You choose the category: “Math” or “Obscure Pop Culture.”

If you chose **OBSCURE POP CULTURE**, here is your question:

*What does the date today have to do with the lowly salt marsh harvest mouse?*

If you chose **MATH**, here is your question:

*Ten people are in the room. What is the probability that any of them either share a (calendar) birthday or have birthdays on adjacent calendar days?*

Trackback Pings

TrackBack URL for this entry:

http://www.drmomentum.com/cgi-bin/mt-tb.cgi/2040

I don't know what today's date has to do with the salt marsh harvest mouse, but it's the cutest damned mouse I've ever seen with its cinnamon-colored fur!

Posted by: Patti M. at March 31, 2008 1:04 PMI'll combine the two questions and say that today is the mouse's birthday.

I remember discussing the second question in a class when I was in high school. I think the teacher said that in a class of 25, it was "likely" (I don't remember the probability) that two of us had the same birthday. If you add adjacent calendar days that should improve the odds, though, so without resorting to any complicated numbers I'll just say 95%.

I hope you're happy, because that was my allotted five minutes of fun for the day.

Posted by: Julie at March 31, 2008 1:05 PMIs this the day that it was first placed on the endangered species list?

Posted by: briwei at March 31, 2008 1:29 PMIt's much, much sillier than that.

Here is a hint-cloud:

comedy, weather, classic, television

Posted by: James at March 31, 2008 1:41 PMDanger Mouse is right out as it was an English cartoon.

Hmm...

Posted by: Patti M. at March 31, 2008 1:44 PMI guess I'll take the math question. Hmm.

The chance that my birthday is the same as yours is 1-in-365, right? My birthday is just one date in 365. If you want to widen it to the day before or after my birthday, then you end up with 3-in-365 chance (about 1-in-122) of having a matching date. But if you start talking about more people it gets more complicated--you have a 3-in-365 chance to match my birthdate, but you also have a 3-in-365 chance to match Julie's birthdate, and she gets a 3-in-365 chance to match mine. What is the probability that at least one of these chances will be a hit?

I suspect it's easier to figure out what the chance is that NONE of them will match, and then take the inverse, since the likelihood of there being a match plus the likelihood of there not being a match must equal 100%.

If I get 1 day out of 365, then in order for your birthday to not match you only have 364 days to pick from. If then Julie has to pick another nonmatching day she has 363 days to pick from. So the chances that all three of our birthdays are distinct is 365/365 x 364/365 x 363/365 or (1) x (99.7%) x (99.4%) which works out to a 99.2% chance that there is no match (and therefore only an 0.8% chance that there is 1 or more matches.)

If you want to go with the adjacent days, now each choice reduces the number of choosable days even further. If my birthday is October 24, then you can't pick the 25'th or the 23'rd if you want to have a nonmatching date. So for 3 people to avoid having a matching date it would be 365/365 x 362/365 x 359/365 or (1) x (99.2%) x (98.4%) which works out to a 97.5% chance that there is no match (and therefore a 2.5% chance that there is 1 or more matches.)

So for 10 people, the chance that two or more have a matching birthday is

= 1-[(365/365)x(364/365)x(363/365)x(362/365)x(361/365)x(360/365)x(359/365)x(358/365)x(357/365)x(356/365)]

= 1-[88.3%]

= 11.7%

If you want to go to the adjacent days, then the chance that two or more have a birthday within a day of each other is

= 1-[(365/365)x(362/365)x(359/365)x(356/365)x(353/365)x(350/365)x(347/365)x(344/365)x(341/365)x(338/365)]

= 1-[68.4%]

= 31.6%

Which means that if 10 people are in a room, the chances that any of them share a birthday is about 1-in-10, and the chance they any of them have a birthday that is equal to OR adjacent to another's birthday is about 1-in-3.

Posted by: Chuck S. at March 31, 2008 2:10 PMHooray, Chuck! Either you're right, or both our reasoning and calculations are off. :)

I think it's interesting that you put the (365/365) multiplier in there, representing the chance that the first person's birthday either matches or is adjacent to itself. That probability is 1, and of course it does not affect the outcome of the problem.

It bothered me that, in my calculation, there were only nine things to multiply with each other, even though there were 10 people in the problem. By bringing it to 10, you have silenced a little obsessive compulsive voice in my head. So, thanks for that.

Posted by: James at March 31, 2008 2:23 PMHmmm...could it be John Belushi on SNL Weekend Update making the statement that in Honduras "March comes in like a lion and goes out like a Salt March Harvest Mouse"????

Full text found at:

http://whatsit2you.blogspot.com/2008/02/march-comes-in-like-lion-but-goes-out.html

Posted by: Bull at March 31, 2008 2:52 PMI actually think that here in Boston March is going out like a lamb...

Satan's rabid, spitting, bastard lamb!

Posted by: Bull at March 31, 2008 2:55 PMBill, I agree. It is quite crappy out today. However, tomorrow is projected to be 64 degrees.

Oh to be a salt marsh harvest mouse, munching on pickleweed, not caring if it rains...

Posted by: Patti M. at March 31, 2008 3:17 PMBTW - the reason I was thinking about this problem at all is that we have 10 people working in our center, and I learned today that there is a birthday adjacency among us. So I wondered what the chances were. I figured they were pretty good. About 1 in 3 ain't bad.

BTW - to calculate this sort of thing, I always start with the matching birthday problem that both Chuck and Julie refer to. When Julie's teacher said "likely" he probably meant "better than 50%." I think 24 people is the "better than 50%" mark for people in a group to share a birthday.

Matching actually crosses the 50% mark at 23 people, where is is 1 - ((365!/342!)/365^23) or a probability of 0.507297.

At 25 people, adjacent birthdays are really likely. Something like 93% of the time you'll have a match or an adjacency.

I used this formula in Mathematica:

N[1 -(Product[365 - 3 x, {x, 1, 24}]/365^24)]

(Essentially, I'm using a product of a function defined as 365 minus multiples of three to replace factorials. You cover three days when you allow adjacent birthdays. I just installed Mathematica last week. University has a license. Should have done this years ago.)

Posted by: James at March 31, 2008 3:19 PMHow many times in a post am I allowed to use "BTW?"

Bull is correct - my OBSCURE POP CULTURE reference was to John Belushi's segment on March coming in like a lion and going out like a number of different animals in other parts of the world.

But did you know that March behaves differently in other countries? In Norway, for example, March comes in like a polar bear and goes out like a walrus. Or, take the case of Honduras where March comes in like a lamb and goes out like a salt marsh harvest mouse.

The segment ends, in classic style, with Belushi having some sort of seizure.

Now look, pal! I know a country where March comes in like an emu and goes out like a tapir. And they don't even know what it means! All right?Posted by: James at March 31, 2008 3:23 PM

Math: Let's see. If there was no overlap, that would mean that each person had a unique block of 3 days. So, there are 30 days out of 365. That means the answer will be 1 minus the odds of selecting these 10 groups of 3 out of 365. The problem becomes more complicated by the fact that you are not selecting 30 unique items, but rather 10 unique 3 day blocks. It is more complicated by the fact that if two birthdays were separated by two days, they are not adjacent, but share an adjacent day. Yuck. My head hurts. I'll have to meditate on the actual math and come back later, but I'd say the overall probability is much lower than what Julie was guessing. The probability of selecting 30 unique somethings out of 365 is on the order of 27%. I can't see the adjacency rules adding significantly to this.

Posted by: briwei at March 31, 2008 4:32 PMLate to the party as usual.

The only flaw in your and Chuck's reasoning is that it does not necessarily eliminate three days for the reason I mentioned in my comment. It my birthday is October 28 and James' is October 30, we both share the 29th as an adjacency, but we are not adjacent. So, there are cases of overlap to be subtracted out. :)

Posted by: briwei at March 31, 2008 4:36 PMIt is more complicated by the fact that if two birthdays were separated by two days, they are not adjacent, but share an adjacent day

I had that gut feeling at first, too.

But when you go the "easier to calculate the odds of NOT matching" route, you find that eliminating sets (or "windows") of three days does not have the complication of overcounting nonadjacent birthdays separated by 1 day.

You can think of building the series like an algorithm. As you add a multiplier on for each extra person, you only care whether that person's birthday is in one of the previously counted windows. It doesn't matter if his new window will overlap any of the counted ones, only if his birthday falls among the previously eliminated days.

This method allows for overlapping windows, and doesn't count them as matches.

Posted by: James at March 31, 2008 4:44 PMSorry - it's not a series, it's a product. I should have written "you can think of building the product like an algorithm."

Posted by: James at March 31, 2008 4:45 PMHmmm. Now that I think about it, perhaps there is an issue with overcounting the eliminated days. The error becomes obvious if you imagine a much smaller year with 9 days.

Oh, darn. That calls for a different approach.

But, oh goody - a chance to hone soem mad probability skillz.

Wellllll...

If the year had only nine days like this 123456789 and my birthday was day 1, there would be 3 days your birthday could not be: 1,2, and 9. That leaves 6 days left for you to choose from. The problem is that you might choose 8, which is perfectly valid, but one of the days next to 8 is 9 which is already eliminated, so in fact picking 8 eliminates only two additional days (7 & 8), not 3. The next person could pick 6, again eliminating only two days.

The problem if you stretch the year out to 365 days, is your chances of eliminating only a couple days instead of 3 are very small, but go up slightly with each block of days removed, but not in a predictable fashion. If removal A takes out days 100-102, then there are 360 chances for the next removal to knock out 3 days and 2 chances for the next removal to knock out 2 (by picking 99 or 103). If the next removal only knocks out 2 days, then the number of chances to knock out 2 days remains 2, if the next removal knocks out 3 days then the number of chances to knock out 2 MIGHT go up by two, unless those 3 days are adjacent to days already removed.

Leave it to you James, to pose such a thorny question.

Posted by: Chuck S. at March 31, 2008 6:35 PMRight. Because you are not necessarily eliminating 3 days every time. I did a little Perl script to find out empirically what the results are. Assuming my algorithm is good, the impact of overlapping days is minimal. I've run 5 iterations of one million trials and I got 31.45%, 31.44%, 31.48%, 31.50%, and 31.36%. That clusters pretty nicely around 31.45%, so I'd say the impact is minimal.

Posted by: briwei at March 31, 2008 6:45 PMI think my teacher was suggesting that the odds were much better than 50%, because he was willing to bet homework on it. And he was the kind of person who felt that not assigning homework would be as detrimental to our well-being as not letting us eat.

Which is ironic since he also wouldn't let us eat, but never mind that.

And his name was Mr. Dube. (Pronounced "doobie")

Since it was a trig class, someone asked "is this going to be on the test," and after he assured us that he was only sharing it with us because it was so fascinating, I guess we tuned him out. That is, I do remember being impressed with the result, but not enough to pay much attention to how he got it.

Posted by: Julie at March 31, 2008 6:56 PMWell, you're only knocking out three days on one side, right? Your birthday creates a three-day window for every other person's *one* day to fit into.

How to do da math on dat, I dunno.

Posted by: Julie at March 31, 2008 7:08 PMJulie: assuming 356 days in the year and an even distribution of births, the 50% point is 23 people, and at 25 people he would definitely be more likely on the winning side if he were to repeatedly make that bet.

However, it's about 11 to 14 odds, which means that for every 14 such bets he wins, he'd lose about 11. Since he doesn't get anything (but satisfaction) by winning, it's all upside for the students and there is no reason for them not to take the bet. In that situation, 11 to 14 are crappy odds. In a for-satisfaction-only bet, I think I'd want to win AT LEAST 3 times for every time I lost.

It sounds like Mr. Dube was either a crappy gambler or he valued satisfaction much more highly than I do and didn't care if the students didn't have to do their homework.

Posted by: James at March 31, 2008 7:23 PMSimulposting. :)

Jules: The issue is in how you count how many days you've eliminated. With only 2 people's birthdays it's easy because overlap doesn't matter. But with the third person it turns out that you can't assume the previous windows weren't overlapping. It screws up the ratio. :(

I'm working on another approach, but I've already eliminated two more. Trying to come up with a different way of counting "hits" vs. "misses."

Posted by: James at March 31, 2008 7:27 PMBrian: I'm not surprised the experimental results are so close to our calculations. It's only 10 choices out of 365 days, so the sort of clustering that would reduce the number of hits is unlikely. Still, this is really bugging me.

The chance of overlapping windows reduces the probability of an adjacent match because one overlap eliminates one possible adjacent space -- two windows share one of their spaces and free up another one for a "no match" space.

At least, that's what I think.

Posted by: James at March 31, 2008 7:37 PMOK - I've got the answer now. Phew!

Here is the equation for the probability of adjacent (or coincident) birthdays:

P(B) = 1 - (365 - 2N + N - 1)!/((365 - 2N)! 365^(N-1))

P(B) = 1 - (365 - 20 + 10 - 1)!/((365 - 20)! 365^9)

= 0.314717

(Where N is the number of people... in this case 10)

A little less probable than what Chuck and I figured (which is what we expected because we eliminated overcounting), and in line with Brian's simulations.

Here's how you have to figure it.

First, you have to separate out the coincident birthdays from the adjacent days, because it's easier to figure out the adjacent days if you can assume no coincident overlap -- as if you're moving pieces around on a board.

When you calculate the probability of event A given that event C is already true, to combine the probabilities you multiply -- probability of A times probability of C.

Say "A" means adjacent and "C" means coincident and "B" means both adjacent and coincident.

P(not B) = P(not A assuming not C) * P(not C)

And 1-P(not B) gives you the probability of (B). Which is what we're after.

P(not C) is from the classical birthday problem we've already talked about. It's choosing 10 days such that no two are the same.

The reasoning behind the adjacent days calculation is simple: Instead of trying to count days, you figure that 10 days (birthdays) are like extra puzzle pieces that have another piece stuck on -- a blank day -- that prevents the birthday days from being adjacent. So, each birthday eats up another day. So, instead of 365 days, you have 345 non-birthday days, plus 9 birthday-plus-a-day chunks, plus the first arbitrarily chosen birthday-plus-a-day. The first birthday is a freebie, so you calculate the probability of choosing 9 more birthdays and fitting them in without overlapping.

It's basically a question of how many ways of choosing 356 things nine-at-a-time.

I knew there had to be a different way of counting the days, and after a couple of failed attempts at grouping them, I looked up basic probability theory that I thought I might be forgetting (to enable me to separate out the coincident birthdays).

And in my search, I found a journal article which gives a general solution to the problem and explains it.

Unfortunately, I don't think I can link to it because I had to search using the university's

access. But you may have your own access to JSTOR. So here's the citation:

The Teacher's Corner

An Extension of the Birthday Problem

Joseph I. Naus

The American Statistician, Vol. 22, No. 1. (Feb., 1968), pp. 27-29.

Stable URL: http://links.jstor.org/sici?sici=0003-1305%28196802%2922%3A1%3C27%3AAEOTBP%3E2.0.CO%3B2-J

So, um. It was a slightly more difficult question than I had thought. But not by much. It's just that my probability was rusty. The funny thing is, the point of the article is that the question of adjacent birthdays makes for a good classroom exercise in small classrooms because it's more probable to get adjacent birthdays, which means the students might be more likely to connect with the example.

I guess this is what happened to me in reverse. We had an adjacent birthday, which motivated me to look into the probability.

Some day I'll get this stuff right on the first try. Maybe.

Posted by: James at March 31, 2008 11:53 PMWow...just a shade over 12 hours!

Posted by: Bull at April 1, 2008 12:04 AMAnd to think, I THOUGHT I had the answer when I posted this.

Thanks to Bri for putting the bug of doubt in my head.

A perfect example of why intelligent doubt is good. It leads to learning, and then better understanding of the world!

Posted by: James at April 1, 2008 12:08 AMThis is eerily reminiscent of a scene from "The Big Bang Theory" where they're showing off their white boards full of equations... (I love that show).

This has been fun to follow, even if I find it a wee bit confusing!

Posted by: Patti M. at April 1, 2008 8:38 AMDueling white Boards , eh? Perhaps with the theme from Deliverance as played by They Might Be Giants (complete with accordian) playing in the background?

Posted by: B.O.B. (bob) at April 1, 2008 9:13 AMMaybe you should suggest that to the show's producers.

Posted by: Patti M. at April 1, 2008 9:27 AMCopyright © 1999-2007 James P. Burke. All Rights Reserved