comp.lang.ada
 help / color / mirror / Atom feed
From: Dr John Stockton <jrs@merlyn.demon.co.uk>
Subject: Re: Friday 13th, try it yourself (was Language Wars..)
Date: 1996/09/22
Date: 1996-09-22T00:00:00+00:00	[thread overview]
Message-ID: <BA625cA0uVRyEwp$@merlyn.demon.co.uk> (raw)
In-Reply-To: 51bv60$8d@pheidippides.axion.bt.co.uk


In article <521pfp$kec@ns.ccsn.edu> of Sat, 21 Sep 1996 17:16:25 in
comp.lang.pascal.misc, Russell Mosemann <mose@ns.ccsn.edu> wrote:
>Clinton Pierce <cpierce1@ford.com> writes:
>
>>See for yourself if the "Friday the 13th" thing is just a UL.  If you trust
>>UNIX's 'cal' program, and that it does the Right Thing with Leap Years, the
>>Gregorian/Julian switch etc..etc... This Perl script will show you the Truth:
>
>   I decided to write a script of my own for Solaris 2.4 and perl
>5.003 which calls cal for 1066 to 1996 and rips out the Fridays.  The
>following is the number of times a particular day of the month falls
>on a Friday.  The results are pretty evenly distributed, i.e. it is an
>Urban Legend.
...

You need to test over 400 years, rather than over a more-or-less
arbitrary period, because in the Gregorian calendar the length-of-month
rule repeats every 400 years, and 400 years happens to be an integer
number of weeks.

You will then find that Friday 13th is slightly more common that one
might at first expect.  Authority for this is excellent.


A.D. 2000 is a leap year. After (in the U.K.) 1752, every year divisible
by 4 is leap,
        EXCEPT if it is divisible by 100 but not by 400; so that:

Leap := (Year mod 4 = 0) xor (Year mod 100 = 0) xor (Year mod 400 = 0) ; 

For proof, read any of the following :
RGO, UK : 
  http://www.ast.cam.ac.uk:80/pubinfo/leaflets/leapyear/leapyear.html
  http://www.ast.cam.ac.uk:80/pubinfo/leaflets/2000/2000.html 
  http://www.ast.cam.ac.uk:80/pubinfo/leaflets/calendar/calendar.html 
Claus Tondering :
  ftp://login.dknet.dk/pub/ct/calendar.faq
  ftp://garbo.uwasa.fi/pc/doc-net/calfaq.zip
Prof. Timo Salmi :
  ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
any reputable encyclopaedia; 
or even Windows Calendar, set to Feb 2000.

The Gregorian Calendar repeats every 400 years, which is 146097 days (in
Octal, 435261 days) or exactly 20871 (Octal, 50607) weeks.

BTW, February 29th, in a "century" year, is always Tuesday 29/02/00.


-- 
John Stockton, Surrey, UK.  JRS@merlyn.demon.co.uk  Turnpike v1.12  MIME
    http://www.merlyn.demon.co.uk/




  parent reply	other threads:[~1996-09-22  0:00 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-13  0:00 language wars (results 13 September) last posting Roy Gardiner
1996-09-13  0:00 ` William Clodius
1996-09-13  0:00   ` Peter Seebach
1996-09-21  0:00     ` Robert Dewar
1996-09-21  0:00     ` Robert Dewar
1996-09-16  0:00   ` Robert Fahey
1996-09-18  0:00 ` James Giles
1996-09-18  0:00 ` Andrew Gierth
1996-09-18  0:00 ` Luke Chao
1996-09-18  0:00 ` Norman H. Cohen
1996-09-18  0:00 ` James Giles
1996-09-19  0:00 ` Andrew Gierth
1996-09-19  0:00 ` Daniel J. Long
1996-09-21  0:00   ` Ken Pizzini
1996-09-21  0:00   ` Ken Pizzini
1996-09-24  0:00     ` Art Schwarz
1996-09-26  0:00       ` Ken Pizzini
1996-09-29  0:00         ` Paul Gilmartin
1996-09-26  0:00       ` Matthew D. Healy
1996-09-29  0:00         ` Randy MacDonald
1996-10-03  0:00           ` galina.kasminskaya
1996-10-03  0:00             ` Dave Tholen
1996-09-19  0:00 ` Norman H. Cohen
1996-09-20  0:00 ` John Girash
1996-09-20  0:00   ` John Girash
1996-09-20  0:00 ` Friday 13th, try it yourself (was Language Wars..) Clinton Pierce
1996-09-21  0:00   ` Russell Mosemann
1996-09-21  0:00   ` Russell Mosemann
1996-09-25  0:00     ` Barrie Walker
1996-09-26  0:00       ` Jim Shapiro
1996-09-25  0:00     ` Ken Pizzini
1996-09-25  0:00       ` Results of my test: Re: Friday 13th, try it yourself Lee Crites
1996-09-25  0:00         ` William Clodius
1996-09-27  0:00         ` Dik T. Winter
     [not found]           ` <52qpqt$1b3l@ilx018.iil.intel.com>
1996-10-02  0:00             ` Dik T. Winter
1996-10-02  0:00             ` Ken Pizzini
1996-09-26  0:00       ` Dr John Stockton
1996-09-26  0:00         ` Dr John Stockton
1996-09-26  0:00         ` Lee Crites
1996-09-26  0:00           ` John Winters
1996-09-26  0:00           ` Daan Sandee
1996-09-26  0:00             ` Jeff Drummond
1996-09-30  0:00               ` Ray Dunn
1996-09-26  0:00           ` Adam Beneschan
1996-09-27  0:00             ` Glen Clark
1996-09-27  0:00           ` CHI Research, Inc. 
1996-09-27  0:00             ` Lee Crites
1996-09-28  0:00               ` John Winters
1996-09-30  0:00               ` Adam Beneschan
1996-10-01  0:00             ` Mike McCarty
     [not found]         ` <199609302101.JAA04610@kauri.vuw.ac.nz>
1996-09-30  0:00           ` Lee Crites
1996-09-23  0:00   ` Friday 13th, try it yourself (was Language Wars..) Matthew D. Healy
1996-09-23  0:00     ` Dik T. Winter
1996-09-25  0:00     ` Paul Gilmartin
1996-09-22  0:00 ` Dr John Stockton [this message]
1996-09-23  0:00 ` Dr John Stockton
1996-09-23  0:00 ` Randy MacDonald
1996-09-23  0:00   ` Dik T. Winter
1996-09-25  0:00   ` John Harper
1996-09-25  0:00     ` jupiter
1996-09-24  0:00 ` language wars (results 13 September) last posting Andrew Gierth
1996-09-24  0:00   ` Art Schwarz
  -- strict thread matches above, loose matches on Subject: below --
1996-09-25  0:00 Friday 13th, try it yourself (was Language Wars..) Barrie Walker
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox