### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,126 hits

Programming Enigma Puzzles

27 August 2018

Posted by on **From New Scientist #2203, 11th September 1999** [link]

Someone has told George that the 13th of a month is more likely to be a Friday than any other day of the week, but he is not sure whether he should believe it.

This year, 1999, the date Friday the 13th occurs only once, in August. Last year, 1998, it occurred three times, in February, March and November. It is clearly somewhat irregular.

If George choose a random month in a random year on the Gregorian calendar, what is the probability that it will include Friday the 13th? Please give your answer as a fraction in its lowest terms.

[enigma1047]

%d bloggers like this:

The Gregorian Calendar repeats in cycles of length 400 years.

So we can just count the weekdays that the 13th of each of the 4800 months in a 400 year span occur on.

This Python program runs in 88ms.

Run:[ @repl.it ]Solution:The probability that a randomly chosen month has a Friday 13th is 43/300.Of the 4800 13th’s of the month, Friday is the most likely day with 688 occurrences, then Sunday and Wednesday with 687 occurrences, then Monday and Tuesday with 685 occurrences, and finally Thursday and Saturday with 684 occurrences.

So the 13th of the month

isslightly more likely to be a Friday than any other given day of the week.Ah yes. This does indicate how ‘random’ is not random when there is an underlying pattern. Then again, my son does a calculation when working out whether to buy a monthly season ticket on the train, rather than a weekly one.

If we take any 28-year period (336 months) between March 1900 and February 2100, then the 13th occurs on a Friday a total of four times in each of the 12 months. That is a probability of precisely 1 in 7.

However, in any 400 years three that are multiples of 4 (e.g. 1800, 1900, 2100) are not leap years in the Gregorian calendar. There are thus four types of century year, with Friday 13th falling in:

1600, 2000, etc.: October 1700, 2100, etc.: August

1800, 2200, etc.: June 1900, 2300, etc.: April and July

400 years = 146097 days, a multiple of 7, so the days of the week repeat,

and it doesn’t matter which span of 400 we take.

My frequencies agree with Jim’s. Total 4800 as expected (though I admit I did not expect the result until I worked it out for myself).