Firepanda said:
Awesome, I do understand that, it would be great as an intro to my report :P
Considering the report is to do with modular arithmetic could you give me some of the concise approact? :P
Would it be about something to do with the 'amount of days in a month' mod 7?
thanks
Just so. You'd start by assigning the days of the week to a "clock" with seven positions, with Sunday as 0, Monday as 1, ... , and Saturday as 6. Fridays fall at 5, but since we want to look at Friday the Thirteenth, we could also treat the problem as the same as looking for Sunday the First.
You would then assign a value to each month, according its number of days (mod 7). So March is 3, April is 2, ... , and October is 3. You are then just looking for the sum of consecutive months that add to 0 (mod 7), starting from each "position on the clock". The month after the one that brings the sum to 0 is one with a Friday the Thirteenth.
In the first example, we started at 0, so March
is a month with a Friday the Thirteenth. (There may be others, but the proposition only asks that we show there is
at least one such month. We are doing what is called an "existence proof".)
In the second example where we started at 1, our sum ran
1 + 3 + 2 + 3 + 2 + 3 = 14 = 0 (mod 7) ,
as we went through March, April, May, June, and July. So the First of August is Sunday and thus August has a Friday the Thirteenth.
From there, you would look at the remaining starting positions and see how many months must be summed to get you to zero. It will work in each case by the time you reach October. This proves the proposition.
This is also handy for figuring out what day of the week a date will fall on, if you know which one it was on in some year. For instance, Christmas and New Year's Day fall on the same day of the week, being exactly a week apart. A year has 365 days, so 365 = 1 (mod 7); a leap year acts like 2 (mod 7). Christmas was on a Monday (1) in 2006, so it will fall on 1 + 1 = 2 or Tuesday this year, and 1 January 2008 will also be a Tuesday. Since 2008 is a leap year, it will shift the dates after 29 February by two, so Christmas 2008 will fall on 2 + 2 = 4 or Thursday, and so will New Year's 2009.
Something like this is also used to deal with calculating the "moveable feasts" like Easter, which brings you back to Zeller...