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=1.4 required=5.0 tests=BAYES_50,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: fa0ae,be6b7e036aa9236c X-Google-Attributes: gidfa0ae,public X-Google-Thread: 1094ba,be6b7e036aa9236c X-Google-Attributes: gid1094ba,public X-Google-Thread: 103376,be6b7e036aa9236c X-Google-Attributes: gid103376,public X-Google-Thread: 1164ba,be6b7e036aa9236c X-Google-Attributes: gid1164ba,public X-Google-Thread: 1014db,be6b7e036aa9236c X-Google-Attributes: gid1014db,public From: mose@ns.ccsn.edu (Russell Mosemann) Subject: Re: Friday 13th, try it yourself (was Language Wars..) Date: 1996/09/21 Message-ID: #1/1 X-Deja-AN: 184887667 distribution: inet references: <51bv60$8d@pheidippides.axion.bt.co.uk> <32406D89.233E@watson.ibm.com> <3242D1EB.3F54@ford.com> organization: Concordia College, Seward, NE 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 Date: 1996-09-21T00:00:00+00:00 List-Id: Reposting article removed by rogue canceller. Clinton Pierce 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. Day of month: 1 Freq: 1600 Day of month: 2 Freq: 1594 Day of month: 3 Freq: 1596 Day of month: 4 Freq: 1594 Day of month: 5 Freq: 1593 Day of month: 6 Freq: 1601 Day of month: 7 Freq: 1593 Day of month: 8 Freq: 1600 Day of month: 9 Freq: 1594 Day of month: 10 Freq: 1596 Day of month: 11 Freq: 1594 Day of month: 12 Freq: 1593 Day of month: 13 Freq: 1601 Day of month: 14 Freq: 1593 Day of month: 15 Freq: 1601 Day of month: 16 Freq: 1594 Day of month: 17 Freq: 1596 Day of month: 18 Freq: 1594 Day of month: 19 Freq: 1593 Day of month: 20 Freq: 1601 Day of month: 21 Freq: 1593 Day of month: 22 Freq: 1601 Day of month: 23 Freq: 1594 Day of month: 24 Freq: 1596 Day of month: 25 Freq: 1594 Day of month: 26 Freq: 1593 Day of month: 27 Freq: 1601 Day of month: 28 Freq: 1593 Day of month: 29 Freq: 1499 Day of month: 30 Freq: 1461 Day of month: 31 Freq: 930 The script is #!/usr/bin/perl @dom = (); for ($year = 1066; $year <= 1996; $year++) { open(CAL, "cal $year |"); $row = ; # Get rid of year $row = ; # A blank line while($row = ) { for ($cols = 0; $cols < 3; $cols++) { $day = substr($row, 15 + ($cols * 23), 2); $dom[$day]++ if $day =~ m/^( |\d)\d$/; } } close(CAL); } for ($day = 1; $day <= 31; $day++) { print "Day of month: $day Freq: $dom[$day]\n"; } -- Russell Mosemann Concordia College Voice: (402) 643-7445 Computing Center Seward, NE 68434 Fax: (402) 643-4073 "If Teflon is non-stick, how do they get it to stick to the pan?"