From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7be1,be6b7e036aa9236c X-Google-Attributes: gidf7be1,public X-Google-Thread: 11390f,be6b7e036aa9236c X-Google-Attributes: gid11390f,public X-Google-Thread: 101deb,be6b7e036aa9236c X-Google-Attributes: gid101deb,public X-Google-Thread: 1014db,be6b7e036aa9236c X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,be6b7e036aa9236c X-Google-Attributes: gid103376,public X-Google-Thread: 1164ba,be6b7e036aa9236c X-Google-Attributes: gid1164ba,public X-Google-Thread: fa0ae,be6b7e036aa9236c X-Google-Attributes: gidfa0ae,public X-Google-Thread: 1094ba,be6b7e036aa9236c X-Google-Attributes: gid1094ba,public From: Clinton Pierce Subject: Re: Friday 13th, try it yourself (was Language Wars..) Date: 1996/09/20 Message-ID: <3242D1EB.3F54@ford.com>#1/1 X-Deja-AN: 184274679 distribution: inet references: <51bv60$8d@pheidippides.axion.bt.co.uk> to: Andrew Gierth content-type: text/plain; charset=us-ascii organization: Ford Motor Company mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.apl,comp.lang.basic,comp.lang.c,comp.lang.fortran,comp.lang.perl.misc,comp.lang.pl1,comp.lang.rexx,comp.lang.pascal.misc,comp.lang.smalltalk x-mailer: Mozilla 2.0 (X11; I; AIX 1) Date: 1996-09-20T00:00:00+00:00 List-Id: Andrew Gierth wrote: > > >>>>> "Norman" == Norman H Cohen writes: > > > Andrew Gierth wrote: > >> The 13th day of the month is more often Friday than any other day > >> of the week. > Norman> I apologize for the off-topic posting (especially when it is > Norman> cross-posted to so many newsgroups, and thus off so many > Norman> topics at once), but it should be pointed out, before this > Norman> becomes an urban legend, that this "factoid" is patently > Norman> false! > Oh dear. I don't have alt.folklore.urban on my server, or I might take > this discussion there; in the absence of any obvious other place to > direct followups to, we will have to stay off-topic for the time > being. Email might be a good move... > > Skeptics are invited to write a program to do the calculation for > themselves. > Let's get back on Topic, for comp.lang.perl at least. 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: #!/usr/bin/perl4 foreach $year (1066...1996) { $FRIDAYS=`cal $year | cut -c20-24,50-53 | grep [0-9]`; while($FRIDAYS=~/\d+/g) { $DAYOFMONTH{$&}++; } } foreach(1..31) { print "Day of month: $_ Freq: $DAYOFMONTH{$_}\n"; } Just make sure that your vendor's implementation of 'cal' puts Fridays in the specified columns. Use 'cal 1996 | cut -c20-24,50-53' and make sure you just get Fridays as output. -- ----------------------------------------------------------------------o------ Clinton A. Pierce | "If you rush a Miracle Man | \ / \ / cpierce1@ford.com | you get rotten miracles." | \ G / DCI, Inc. on loan to Ford. | --Miracle Max, The Princess Bride | / \ / \ ------------------------------------------------------------------Freemason-- Geek Code: GCM/GCSd-(++)s+:+a-C++UA++++$UIS+++$UL+++P++++L++E---W++N++w---O (Revised!) t++(+++)5+X+R-tv-b+++DI++++G++e+>++h----r+++y+++(--)>y* I'll be a Speaking Geek at LISA '96. Catch me on Wed AM, 11:30. Topic: Igor