Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Day of the week from the date. The goal of this project is to derive a formula that gives the day of the week for

image text in transcribed
Day of the week from the date. The goal of this project is to derive a formula that gives the day of the week for any date in the Gregorian Calendar. The Gregorian Calendar accounts for the error in the 365-day year by designating the years divisible by 4 as leap years, except those divisible by 100 but not by 400. In the background section of your report provide some background information regarding the Gregorian Calendar, where did it come from, when was it adopted, etc. IF d denotes the day of the week as an integer, we can write d = 0 for Monday, d = 1 for Tuesday, d = 2 for Wednesday...., and d = 6 for Sunday. 1. Pick a reference date for which you know the day of the week (for example January 1 of a non leap year: January 1, 1995 was a Sunday or the day you were born). Was that year leap or why was 1995 leap? 2. Suppose the dates are numbered sequentially in the year, 1,..., 365. How would you determine the day of the week for any date on the reference year. 3. Now we want to figure out how to convert the information about months into days. Since January 1 has 31 days, and 31 = 3(mod 7), any date in February is 3 days ahead of the corresponding date in January. Suppose January 1 is the reference date and it is a Tuesday (d = 1). For January 17, as 17 - 1 = 2mod 7), we add 2 to 1 (for Tuesday) and obtain 3 (Thursday); therefore January 17 is a Thursday, February 17 is 3 days ahead: that is February 17 is Sunday. Determine the number to add for each month so that you can determine the day for any date in the reference year 4. Now, to go from one year to the next, we can use the fact that 365 = 1(mod 7), so we can add 1 every time the year changes (except for leap years when we must add 2). Explain how to use this information to find the day of the week. Why does this show that it is better to use March 1 as the reference date? Repeat parts (2) and (3) by taking March 1 of a nonleap year as the reference date. 5. Derive a formula for finding any day from the date of 1901 to 1999. Note that 1900 and 2000 are not leap years, so you will need to make an adjustment in your formula to find the day in another century

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance The Basics

Authors: Erik Banks

1st Edition

0415384575, 9780415384575

More Books

Students also viewed these Accounting questions

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

Did you cite the sources of the statistics?

Answered: 1 week ago