Centuries on Sunday

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math Topics]   [Library]   [Utilities]

Search

 

Search DelphiForFun.org only

Support DFF

 

If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.

In Association with Amazon.com

 

Support DFF

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

 

 

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

 

Search DelphiForFun.org only

 

 

 

 

 

Centuries That Start on Sunday

Problem Description

I can't remember where I ran across this one,  but the problem is to calculate the probability that a century begins on a Sunday.   

Background and techniques

The attached program calculates and prints the day of week for January 1sts for centuries between 1500 and 4500 AD.  The problem assumes the Gregorian calendar, the one we use today implemented by Pope Gregory in 1584.    When you see the results, the problem will switch from the probability of Sundays to explaining the results you observe.   The source code has extensive comments explaining things,  but I encourage you to run the program and  think about it  first.  

Exploring the Program 

bulletDownload source
bulletDownload  executable

Suggestions for Further Study

If the leap year rules are correct we should be able to calculate the true number of hours per day quite accurately, maybe within 1 day per 400 years?    
 

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2011, Gary Darby    All rights reserved.