Jun 17, 2011 - 5 Doomsday method. Python code for doomsday of year y (does it work? why?) s = floor(y / 100) x = y % 100. # % is modulo in python if odd(x):.
Lycée du Parc (moving to Lycée La Martinière-Monplaisir)
The Doomsday rule
Outline 1 Introduction 2 The Gregorian calendar 2.1 Leap years in the Gregorian calendar 3 Doomsday 4 Doomsday formula 5 Doomsday method 5.1 Applications
Judicaël Courant
2
The Doomsday rule
6 Conclusion
Judicaël Courant
3
The Doomsday rule
1 Introduction What days of the week are: • January the first of 2011? • June the 6, 1944 • July the 14, 1789 • May 1st, 2012?
Judicaël Courant
4
The Doomsday rule
If you do not know the answer, could you compute it? Could you devise an efficient algorithm to calculate the day of the week of any given date (say from year 1 to 9999) in the Gregorian calendar? Goal: being able to calculate it mentally in a few seconds
Judicaël Courant
5
The Doomsday rule
2 The Gregorian calendar • The calendar we use today • Introduced by Pope Gregory XIII on 1582 • Similar to the previous Julian calendar; main difference: leap years
Judicaël Courant
6
The Doomsday rule
2.1 Leap years in the Gregorian calendar Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 is not a leap year; the year 2000 is a leap year.
Judicaël Courant
7
The Doomsday rule
3 Doomsday Day of the week of “march 0” (last day of february) Doomsday for 2011: Monday, for 2012: Wednesday. Doomsdays every year: • 4/4, 6/6, 8/8 and 10/10 • 5/9 and 9/5; 11/7 and 7/11 • Normal years: january 3 and february 0 • Leap years, january 4 and february 1 Judicaël Courant
8
The Doomsday rule
Applications: In 2011, what is the day of the week of • December, 25? • October, 17? • July, 14? • November, 11?
Judicaël Courant
9
The Doomsday rule
4 Doomsday formula Number the day of the week from 0 to 6, starting with Sunday. Then the Doomsday of year y is
2+y+
y y y − + 4 100 400
mod 7
Why? Not very easy to compute mentally.
Judicaël Courant
10
The Doomsday rule
5 Doomsday method Python code for doomsday of year y (does it work? why?) s = floor(y / 100) x = y % 100 if odd(x): x = x + 11 x = x / 2 if odd(x): x = x + 11 x = x + 2 * (s mod 4) return ((2 - x) % 7) Judicaël Courant
# % is modulo in python
11
The Doomsday rule
5.1 Applications What days of the week are: • January the first of 2011? • June the 6, 1944 • July the 14, 1789 • May 1st, 2012?
Judicaël Courant
12
The Doomsday rule
6 Conclusion • Doomsday rule is easy • Practice, practice, practice • Next challenge: convert calendar dates to ISO week dates (see Wikipedia, ISO_8601)
I just wanted to tell you that we're going to be away for a .... He carried the coffee cup into the bathroom and studied his image in the mirror. .... He was led into a private elevator that Keller operated with a key. .... but he had a feeling the a
This logarithmic scale has the noteworthy property that if you translate a cursor on this scale by some length k starting from any number a, you will find this ...
Projectiles A La Fonderie De, Design Japan 50 Creative Years With The Good Design Awards, Detail. 3 Interior Architecture, Die Mysterienheiligt Mer In Eleusis ...
Sep 9, 2017 - When I worked briefly as a junior doctor in Rhodesia, as it then still .... 5/10. Horrifying: 23 Gorgeous Stars Who Became Monsters ... 7 days ago.
Utilisation du réseau ainsi que taxes et redevances ... Produit d'utilisation du réseau BT2. Prix de la ... fourniture d'énergie électrique aux consommateurs finaux.
The Book meeting on doomsday rendezvous au jugement dernier french is free to download and read online at Online Ebook Library. Get meeting on doomsday ...
fortement impacté les flux de trésorerie générés par l'activité qui sont de 61K€ en 2018 contre. 1.424K€ en 2017. La trésorerie nette*** est en progression au 31 ...
Sep 23, 2014 - âA Mathematical Theory of Communication,â The Bell System Technical Journal, Vol. 27, pp. ..... and R. S. Ware, are particularly appreciated.
The winner is the player whose squad defeats all the enemy characters. For other .... vast powers and Imperial war machine to subjugate planets, bolster his ...
Rebel Storm⢠set checklist .... Each character has a corresponding stat card that lists game .... bases and constantly on the move, the Rebels revere the ideals.
Grandmontine monks in the following years and centuries. Rule of St Stephen, some extracts. Prologue: The one primary and fundamental Rule of Rules for.
"The beautiful simplicity and extreme perfection of the game, as it is ... research came about because science too is by no means free from the restraints of its day ...
The pool was an extra-dimensional portal which game Tyranthraxus access .... In the river are my dragon navy and soon the gargoyles shall arrive to control the ...