### CBD

Okay, here's something I wanted to write about a while ago, and then completely forgot about...

*MATHS WARNING: If you are allergic to Mathematics, please stop reading now.*

Around two months ago, the 27th of February to be precise, it was my birthday. On one of my birthday cards, the date had been written: 27.02.90. Upon seeing it, I paused for a moment, becuase it was as if there was something familiar, yet not quite right about this sequence of numbers. Then it dawned on me: it was a simple permutation of the daate of my birth, 27.02.90, a sequence I happen to see quite often. And that got me thinking... how many permutations of my birth date exist?

Now, mathematically speaking, there are 720 ways to permute a set with 6 distinct elements (digits in this case). In this case, two pairs of digits are the same, the 2's and the 0's, so in total there is 180 distinct permutations. But there's more to it. Indeed, not all of these 180 sequences are valid dates. For instance, 79.20.02 is not good, because there's is no 79th day in the Month of Octodecember. More generally, the days must be between 1 and 30/31, the months between 1 and 12, etc. Formally, the following restrictions are imposed on the sequence D1-D2-M1-M2-Y1-Y2:

-D1 and D2 cannot both be 0

-M1 and M2 cannot both be 0

-D1 cannot exceed 3 [Less than 40 days in a month]

-If D1 is 3, then D2 cannot exceed 1 [At most 31 days in a month]

-If M1 is 0, M2 is 4,6 or 9, and D1 is 3, then D2 must be 0 [30 days in April, June and September]

-If M1 is 1, M2 is 1, and D1 is 3, then D2 must be 0 [30 days in November]

-If M1 is 0, and M2 is 2, then D1 cannot exceed 2 [Less than 30 days in February]

-If M1 is 0, M2 is 2, and D1 is 2, then D2 cannot exceed 8 [28 days in February]

-M1 cannot exceed 1 [Less than 20 months in a year]

-If M1 is 1, then M2 cannot exceed 2 [12 months in a year]

Notice first that I have ignored leap years. Those can be taken care of "manually".

Now, with those rules in mind, we can get a computer to work out how many permutations of my birth date exist. Henceforth, I shall call these Co-Bithdates, or CBDs. An example would be 29.07.02. Note that the year, "02" could mean anything, like the year 2, or 1902, or 2502. So to make sure that each CBD points to a unique date, we'll take it to be the first date after my birth. In other words, all my CBDs are going to lie between the 27th of February 1990 and the 27 of February 2090.

The only thing left to do is to write the program that is going to work out my CBDs. Which I did. In Python (I'm always a bit ashamed when writing "simple" linear programs in Python, since it has so much potential as an object-oriented programming language that I feel like I'm abusing it, but it's such a handy tool when it comes to these kind of I-need-a-small-and-simple-program-and-I-don't-want-it-to-take-ages-to write-situation). If there the least interest from people, I'll gladly send the source code to you, print it in another blog post, or just tell you when your Co-Birthdays lie if you're not that much into programming.

The conclusion of it all, is that I have 26 CBDs, not including the day I was born (My potential leap CBDs are the 29.02.07 and 29.02.70, but none of these are leap years). I have already missed 9 of them, which means I've got 17 left in my entire life, assuming that I live for 89 years or more, thus experiencing my last one on the 20th February 2079. The next one is on the 22nd July this year. I'll try and make something special out of every one of them from now on.

## 2 comments by 1 or more people

## Tom

This could have been a lot less interesting if you’d have been born on the 9th of September :)

06 May 2009, 09:53

My birthday is really lame: 22/09/88. I stared at it a bit and found 8, assuming I die before I’m 94 (but I might have missed some). And I’ve already 5 of them! Shame.

28 Jul 2009, 13:48

## Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.