From Birthdays to Breakthroughs: Problem Solving with Forward Chaining

During a Slack conversation at work today, my manager asked us what the chances are that any of us have the same birthday. This reminded me of something I read a while ago on “the birthday paradox,” where the chances of two or more people having the same birthday in any given group is surprisingly much higher than you would naturally expect. I decided to try and work it out myself.

Sometimes, when you set out to solve a problem, you already know what steps you need to take, but for more difficult problems, or problems in a domain you don’t have much experience in, you need to figure out “how to figure out” the solution. In this case, a good approach to take is to work on a highly simplified version of the problem, then work your way up to the problem at hand. This is a form of forward-chaining, a problem solving approach I outline in my book Method Matters.

For this question, I started with this simplified version: what are the chances that two people have the same birthday if a year only lasts three days? The chances would be one third, since there are only two people and one out of three days that the second person has to match with the first person. Now, what if there are three people?

Let’s switch our problem to ask what the chances are that nobody has the same birthday, since the three of them could share the same birthday (this makes it much easier to think about). The 2nd person has a 2/3 chance of having a different birthday, and the 3rd person has a 1/3 chance of having a different birthday than both of the others. To combine these two figures, multiply them together: 2/3 * 1/3 = 2/9, roughly 22%. That means in this example, there’s a 78% chance at least two of them share the same birthday. The reason we multiply these, instead of adding, is because there is a 1/3 chance the 3rd person doesn’t share a birthday with either of the first two for each possible arrangement of birthdays for the first two.

If we had three people in a year with six days, the math would be very similar: 5/6 * 4/6 = 20/36, roughly a 44% chance at least two have the same birthday. Now, we see a pattern: the number of days in the year is on the bottom of the fractions, the denominator, and a sort of countdown from the number of people is on the top of the fractions, the numerator. We can say that for a year with 365 days and for n people, there is a (n-1)/365 * (n-2)/365 * … * 1/365 probability that nobody will share the same birthday. Then, subtract 1 by that value to get the chances at least two will have the same birthday. I took some extra time to see how we could phrase that equation without the ellipses, and found 1-[365!/(365^n*(365-n)!)] (this part’s not important compared to the main discovery). In an team with 15 people, there would be a 25% chance at least two would have the same birthday. This is surprisingly high, considering the fact there are only 15 people but 365 days in the year. Technically, this doesn’t account for leap years, but it’s close enough for our purposes, though I might write up on that in a future post. As a bonus, this approach to problem solving gave me a more generic solution, for any number of people n and number of days in a time period x, there is 1-[x!/(x^n*(x-n)!] probability that two people would have the same “event-day” over that period (since “birthday” would lose meaning here).

This demonstrates the power of an incremental, start-small and build-up approach to problem solving. I found the solution to a complex problem with factorials (!) and repeated multiplications simply by asking “what are the chances two people have the same birthday in a year that only has 3 days,” a question with an easy answer. In my experience, I’ve found this method of problem solving to be highly effective, both in finding solutions, and in reducing the time it takes to find them, even in situations where the solution might seem elusive and out of reach. If you encounter such a problem in the future, I encourage you to try this method of problem solving; you’d be surprised at how well it can work for you.


Leave a Reply

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

BRANDON QUINN
SUBSCRIBE TO MY NEWSLETTER

© 2023 Brandon Quinn. All Rights Reserved