(TGI)Friday the 13th

Bar Charts, Heat Maps, Network Visualizations
Intro

I was born on November 13th, 1992. And, while that might be sufficient information to verify my identity to that pre-recorded human on the other end of my calls to the bank, there is an important detail always excluded in this formal expression of one’s birth date: the day of the week. And what makes this seemingly unremarkable fact about me exciting (or disturbing, depending on your take) is that pesky, frequently ignored detail. I was born on a Friday.

Yes, Friday the 13th, the universally proclaimed day of bad luck. Black cats, the devil, all that jazz. Despite the fact that it was the strong but random force of chance, not some meaningful destiny, that sealed my birth date, I still feel a personal tie to the dark and twisty combination. And, given this past February’s Friday the 13th immediately followed by another, today(!), in March, I decided to revisit an old question: how frequent is Friday the 13th anyway? And how often does this February-March combination happen? Are there other regular month combinations?

1985-2015

In response to the former, in the long run, Friday is actually the day of the week mostly likely to fall on the 13th! (Just by a tiny bit…the probability of a Friday being on the 13th is 0.1433 while the probabilities of other days falling on the 13th are 0.1425 (Thursday & Saturday), 0.1427 (Monday & Tuesday), and 0.1431 (Wednesday & Sunday).) Over the past thirty years, the average number of Friday the 13th’s in a year was approximately 1.74 (which is a higher average than expected if one assumed there was exactly a 1/7th chance of a Friday the 13th every month of every year: (1/7)*12=1.714). See below for a visualization of Friday the 13th (or F13 from now on) frequencies over the past three decades:

fri13bar

Plot made with ggplot2 package in R.

It is obvious from this graph that each of the past thirty years contain at least one F13. This is because it is actually impossible to have a year without any F13’s. In fact, this fact is pretty quickly mathematically proven. (See proof below. Or skip ahead if that’s not your thing.)

Quick proof

Quoting directly from a StackExchange solution:

A month has a Friday 13th if and only if it begins on a Sunday.

On a regular (non-leap) year, if January begins on day k, 0k6 (with k=0 being Sunday), then we have that:

  • January begins on day k;
  • February begins on day k+3mod7 (since January has 31 days, and 313(mod7);
  • March begins on day k+3mod7;
  • April begins on day k+6mod7;
  • May begins on day k+8=k+1mod7 (since April has 30 days, and 302(mod7));
  • June begins on day k+4mod7;
  • July begins on day k+6mod7;
  • August begins on day k+9=k+2mod7;
  • September begins on day k+5mod7;

With these, we already have day k, k+1, k+2, k+3, k+4, k+5, and k+6, so at least one of these months will begin on Sunday, guaranteeing at least one Friday 13th.

For Leap years, the analysis is similar, except that:

  • January begins on day k;
  • February begins on day k+3;
  • March begins on day k+4;
  • April begins on day k;
  • May begins on day k+2;
  • June begins on day k+5;
  • July begins on day k;
  • August begins on day k+3;
  • September begins on day k+6;
  • October begins on day k+1.

So at the latest, you will have a Friday 13th by October.

Less proofs, more visuals

The distribution of F13’s over different months is very evenly aggregated over the past thirty years; six months contained a F13 four times, while the other six months contained one five times. However, all months are not equally likely to share a F13 in the same year with all other months. For instance, in the past thirty years, March and November both had F13’s in five of the same years, while March and May never had a F13 in the same year. One can verify this claim that certain month combinations are more frequent that others by inspecting the following heat map visualization (click to enlarge):

fri13plotfinal

A box is red is that month-year combination included a Friday the 13th and grey otherwise. Plot made with ggplot2 package in R.

Most evident in the above plot is the February-March-November combination–immediately noticeable since February and March are right next to one another. It turns out that our current year, 2015, is one of five in the past thirty with three F13’s, and also one of four years (1987, 1998, 2009, 2015) in the past thirty featuring the February-March-November combination.

While the February-March-November combination is the most frequent trio in the past thirty years (the only other one being January-April-July in 2012), there are duos that are just as frequent during this time period. In order to best see the all the combinations of months that have had F13’s in the same year, I created a network visualization. This network features an bi-directional edge between two months (represented by red vertices) if they have both had a F13 in the same year. Alternatively, a vertex can also have a loop (an edge that connects it to itself) if it was the only month in a year to feature a F13.

monthsplot1

Network depicting edges between month vertices if the two have included a Friday the 13th in the same year. A loop is shown if a given month has been the only month in any year to have a Friday the 13th. Network made using the igraph package in R.

(There are no weights for the edges in this network. Instead, an edge between two vertices, a and b, is determined by the binary response to: in a given year, have months a and b ever both included a Friday the 13th? If no, no edge exists between a and b. If yes, an edge exists between a and b. However, one could easily extend this work by weighting the edges to depict frequencies of various month combinations.)

This network breaks down into four smaller graphs of sizes 1, 1, 5, and 7 (size in a graph is defined as the number of edges). From this network, one can see clearly that May is the only month in the past thirty years to have never shared a F13 with another month in the same year. Also, over this time periods, September had a F13 if and only if December did as well. Lastly, January, February, and April are the months that have shared a F13s with the most other months.

Endnote

Despite the fact that there is nothing mathematically extraordinary about occurrences of November Friday the 13th’s, I still hold tight to my personal connection to the date. While November Friday the 13th is not incredibly rare, it did turn out that 1992 was the only year in the past thirty to have a November Friday the 13th without both February and March Friday the 13th’s preceding it. (See the heat map!) And if that’s a fact I can use to infuse some sort of mathematical significance into my birthday then I am using it. After all, it is this very date that has given me an affinity for a number usually considered substandard as well as the birthright to scoff, personally offended, when an apartment building elevator disrespectfully skips from the 12th to the 14th floor.

Future work
  • Add weights to edges to depict frequencies of various month combinations
  • Use network centrality methods paired with edge weights to determine the months that are the most central. (At this moment, using simple degree centrality measures, the most central months would be January, February, and April–with June included if you count loops towards degree measures.)
Code

All data and R scripts needed to recreate these visualizations are available on my “Fri13” Github repo.


© Alexandra Albright and The Little Dataset That Could, 2016. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts, accompanying visuals, and links may be used, provided that full and clear credit is given to Alex Albright and The Little Dataset That Could with appropriate and specific direction to the original content.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s