The Usual Tech Ramblings

Five Saturdays

Note: I started writing this post at the beginning of December, but due to time issues, and working on blog migrations, I never got around to posting. I’ve still decided to post because it throws in some PowerShell goodies.

The internet is such a gullable place. Really it is. People post to Facebook nearly everything they see anywhere because it sounds like it’s quite possible, and usually accompanying some cool picture to make it seem more important.

An example of one that keeps coming up…

This year, December has 5 Saturdays, 5 Sundays, and 5 Mondays. This only happens once every 824 years.

Along with some blah blah crap about money, and Chinese superstitions. I’m not sure why people don’t stop and think for just a second, and wonder how that could be possible.

Lets do some mental math, and see what happens. December has 31 days, so regardless of what year it is, there will always be 3 days that occur 5 times that month. What are the chances that any other month with 31 days, would start on a Saturday? You’d think pretty high, and I’m guessing a little more frequently than once every 824 years.

To prove the point, I threw together some PowerShell to figure out how many might occur within the next 20 years.

$date = Get-Date "00:00:00 11/01/12"

1..300 | %{
     $date = $date.AddMonths(1)
     $mo = $date.Month
     $yr = $date.Year
     $dy = $date.DayOfWeek
     $dim = [System.DateTime]::DaysInMonth($yr, $mo)
     if (($dim -eq 31) -and ($dy -eq [System.DayOfWeek]::Saturday)) {
          "{0}`t{1}" -f $yr, $mo

So what is this doing? The first line is grabbing November 1st, and the it loops 300 times. Each loop it adds a month, and figures out what day it is, and the number of days in the month. If there are 31 days in the month, and the day is Saturday, it outputs the year and the month. So how did it look? Did I get no results because I’m inside the 824 years? Far from it…

2012     12
2014     3
2015     8
2016     10
2017     7
2018     12
2020     8
2021     5
2022     1
2022     10
2023     7
2025     3
2026     8
2027     5
2028     1
2028     7
2029     12
2031     3
2032     5
2033     1
2033     10
2034     7
2035     12
2036     3
2037     8

So it looks like it occurs quite frequently. Lets also assume just for a second that they meant only December, if we look at the results, we can see it’s pretty consistent. 6 years until the next even, then 11 years, then another 6 years, much more frequently than 824 years.

As a side note, Snopes covers this issue as well.

So my tip of the day, if you feel the urge to repost somebody’s random image and something doesn’t seem right, hit Google or Bing, and search for part of the phrase and see what you come up with.