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.3 required=5.0 tests=BAYES_00,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: 1014db,be6b7e036aa9236c X-Google-Attributes: gid1014db,public X-Google-Thread: fa0ae,be6b7e036aa9236c X-Google-Attributes: gidfa0ae,public X-Google-Thread: 1094ba,be6b7e036aa9236c X-Google-Attributes: gid1094ba,public X-Google-Thread: 101deb,be6b7e036aa9236c X-Google-Attributes: gid101deb,public X-Google-Thread: 103376,be6b7e036aa9236c X-Google-Attributes: gid103376,public X-Google-Thread: 1164ba,be6b7e036aa9236c X-Google-Attributes: gid1164ba,public From: "Daniel J. Long" Subject: Re: language wars (results 13 September) last posting Date: 1996/09/19 Message-ID: <32414A27.14E@cat.com>#1/1 X-Deja-AN: 183935891 distribution: inet references: <51bv60$8d@pheidippides.axion.bt.co.uk> content-type: text/plain; charset=us-ascii organization: Caterpillar Inc. 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 3.0 (Win95; I) Date: 1996-09-19T00:00:00+00:00 List-Id: James Giles wrote (with deletions) : > > > Skeptics are invited to write a program to do the calculation for > > themselves. > > Assuming that *you* have done so, please have the courtesy to run it > 2800 years and note that the 13th is equidistributed in weekdays. > Then you can come back and apologise. You have to run it more than > 400 years because you have to go through a complete cycle of exceptions > to the century rule. > > J. Giles > Ricercar Software Ok, here is my program, written in Smalltalk, to calculate the distribution of Friday the 13ths for a 2800 year period from 1996 to 4795. BTW, Friday did turn out to be the most likely 13th. Dan | anArray | anArray := Array new: 7 withAll: 0. 1996 to: 4795 do: [:year | 1 to: 12 do: [:month | | day | day := (Date newDay: 13 monthNumber: month year: year) weekdayIndex. anArray at: day put: ((anArray at: day) + 1)]]. anArray inspect Result: Mon Tues Wed Thur Fri Sat Sun #(4795 4795 4809 4788 4816 4788 4809)