comp.lang.ada
 help / color / mirror / Atom feed
From: Lee Crites <adonai@jump.net>
Subject: Results of my test: Re: Friday 13th, try it yourself
Date: 1996/09/25
Date: 1996-09-25T00:00:00+00:00	[thread overview]
Message-ID: <Pine.SOL.3.91.960925162108.6568A-100000@serv1.jump.net> (raw)
In-Reply-To: 52bmft$f3l@news1.halcyon.com



For the most part, I've ignored this friday the 13th thread.  However,
something someone said got my interest.  Basically the statement was that
the same date 400 years later would fall on the same day.  I thought I'd
check it out and see.  Unfortunately, it did not work on the dates I
checked. 

There was also another comment about having to stay after 1752.  So I
decided I could toss together a quick csh script to call cal for 400
years, strip out the Fridays, and use awk to summarize them into which
date happened most often -- if, in fact, any happened more often than
another. 

I *assume* the cal utility takes all of the funky leap-year triviality
into consideration.  If it doesn't, then my results are skewed.  I'm using
the assumption, though, that aix 4.1, which I have been told has had the
'year 2000' fix applied, would have a 'good' version of cal. 

In keeping with the 'show us your source' mindset, here's mine.  I've
tested this on a sun and an rs.  What I'm including is the rs/aix 4.1
version and output. 

This is the csh script that ran it all (No flames about me using csh will
be accepted; If you don't like csh, that's fine with me, please keep it to
yourself): 

#!/bin/csh -f

#
# get friday dates for 400 years
#
if (-e f13.out) then
  rm f13.out
endif

@ yr_base = 1752 # from Ken Pizzini
@ yr = 0

while ( $yr < 400 )

  @ yr ++
  @ year = $yr_base + $yr
  echo $year

  #
  # use cal to give me a calendar of the month in question, then
  # use cut to give me just the Fridays, tail to strip out the
  # cal header stuff, and awk to make sure we have valid numbers
  #
  @ month = 0
  while ( $month < 12 )
    @ month ++
    cal $month $year | \
      tail +2 | \
      cut -c21-22 | \
      awk '{x=int($0);if(x>0)print x}' >> f13.out
    end

  end

awk -f f13.awk f13.out > f13.rpt
cat f13.rpt

Just because it's there, here is a list of the first 20 entries in the
f13.out file (there were 20871 Fridays listed): 

5
12
19
26
2
9
16
23
2
9
16
23
30
6
13
20
27
4
11
18


This is the awk file used above:

BEGIN {
  cnt = 0
  x = 0
  for (x=1; x<32; x++) {
    dist[x] = 0
    }
}
{
  dist[$0]++
  cnt++
}
END {
  if (cnt==0) {
    printf("No values found\n")
  } else {
    printf("Summary of Friday dates for 400 years:\n")
    for (x=1; x<32; x++) {
      if (dist[x] > 0) {
        printf("%10d found %4d times\n", x, dist[x])
        }
      }
  }
}


And finally, here are the results of the run:

Summary of Friday dates for 400 years:
         1 found  687 times
         2 found  685 times
         3 found  685 times
         4 found  687 times
         5 found  684 times
         6 found  688 times
         7 found  684 times
         8 found  687 times
         9 found  685 times
        10 found  685 times
        11 found  687 times
        12 found  684 times
        13 found  688 times
        14 found  684 times
        15 found  687 times
        16 found  685 times
        17 found  685 times
        18 found  687 times
        19 found  684 times
        20 found  688 times
        21 found  684 times
        22 found  687 times
        23 found  685 times
        24 found  685 times
        25 found  687 times
        26 found  684 times
        27 found  688 times
        28 found  684 times
        29 found  643 times
        30 found  629 times
        31 found  399 times

If I'd made a wild guess of what the results would have been before I
started, I'd have come up with something similar to the above.  Uniform
distribution across all dates -- with diminished numbers from the 29th
through 31st. 

Realizing these results would not make the it's-not-uniform-distribution
group happy, I ran it again based upon 1800 instead of 1753, with exactly
the same results.  Since there will be those who want to analyze the cal
functionality, I've included the January calendar for the start of each
decade from 1760 through 2150 at the end of this message.  Knock yourself
out... 

I'm not stupid enough to believe this will settle the discussion
concerning the statistical nature of our calendar, but at least it's
something more concrete to work with.  And, as it is, I am satisfied with
the results. 

Lee Crites
Systems Consultant
Computer Mavericks
adonai@jump.net



       January 1760       
Sun Mon Tue Wed Thu Fri Sat  
         1   2   3   4   5
 6   7   8   9  10  11  12
13  14  15  16  17  18  19
20  21  22  23  24  25  26
27  28  29  30  31

       January 1770       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 1780       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 1790       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 1800       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 1810       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 1820       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 1830       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 1840       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 1850       
Sun Mon Tue Wed Thu Fri Sat  
         1   2   3   4   5
 6   7   8   9  10  11  12
13  14  15  16  17  18  19
20  21  22  23  24  25  26
27  28  29  30  31

       January 1860       
Sun Mon Tue Wed Thu Fri Sat  
 1   2   3   4   5   6   7
 8   9  10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31

       January 1870       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 1880       
Sun Mon Tue Wed Thu Fri Sat  
                 1   2   3
 4   5   6   7   8   9  10
11  12  13  14  15  16  17
18  19  20  21  22  23  24
25  26  27  28  29  30  31

       January 1890       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 1900       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 1910       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 1920       
Sun Mon Tue Wed Thu Fri Sat  
                 1   2   3
 4   5   6   7   8   9  10
11  12  13  14  15  16  17
18  19  20  21  22  23  24
25  26  27  28  29  30  31

       January 1930       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 1940       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 1950       
Sun Mon Tue Wed Thu Fri Sat  
 1   2   3   4   5   6   7
 8   9  10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31

       January 1960       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 1970       
Sun Mon Tue Wed Thu Fri Sat  
                 1   2   3
 4   5   6   7   8   9  10
11  12  13  14  15  16  17
18  19  20  21  22  23  24
25  26  27  28  29  30  31

       January 1980       
Sun Mon Tue Wed Thu Fri Sat  
         1   2   3   4   5
 6   7   8   9  10  11  12
13  14  15  16  17  18  19
20  21  22  23  24  25  26
27  28  29  30  31

       January 1990       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 2000       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 2010       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 2020       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 2030       
Sun Mon Tue Wed Thu Fri Sat  
         1   2   3   4   5
 6   7   8   9  10  11  12
13  14  15  16  17  18  19
20  21  22  23  24  25  26
27  28  29  30  31

       January 2040       
Sun Mon Tue Wed Thu Fri Sat  
 1   2   3   4   5   6   7
 8   9  10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31

       January 2050       
Sun Mon Tue Wed Thu Fri Sat  
                         1
 2   3   4   5   6   7   8
 9  10  11  12  13  14  15
16  17  18  19  20  21  22
23  24  25  26  27  28  29
30  31
       January 2060       
Sun Mon Tue Wed Thu Fri Sat  
                 1   2   3
 4   5   6   7   8   9  10
11  12  13  14  15  16  17
18  19  20  21  22  23  24
25  26  27  28  29  30  31

       January 2070       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 2080       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 2090       
Sun Mon Tue Wed Thu Fri Sat  
 1   2   3   4   5   6   7
 8   9  10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31

       January 2100       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 2110       
Sun Mon Tue Wed Thu Fri Sat  
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

       January 2120       
Sun Mon Tue Wed Thu Fri Sat  
     1   2   3   4   5   6
 7   8   9  10  11  12  13
14  15  16  17  18  19  20
21  22  23  24  25  26  27
28  29  30  31

       January 2130       
Sun Mon Tue Wed Thu Fri Sat  
 1   2   3   4   5   6   7
 8   9  10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31

       January 2140       
Sun Mon Tue Wed Thu Fri Sat  
                     1   2
 3   4   5   6   7   8   9
10  11  12  13  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30
31
       January 2150       
Sun Mon Tue Wed Thu Fri Sat  
                 1   2   3
 4   5   6   7   8   9  10
11  12  13  14  15  16  17
18  19  20  21  22  23  24
25  26  27  28  29  30  31






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

Thread overview: 66+ 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 ` Norman H. Cohen
1996-09-18  0:00 ` James Giles
1996-09-18  0:00 ` Luke Chao
1996-09-18  0:00 ` Andrew Gierth
1996-09-19  0:00 ` Andrew Gierth
1996-09-19  0:00 ` Norman H. Cohen
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       ` 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-26  0:00       ` Ken Pizzini
1996-09-29  0:00         ` Paul Gilmartin
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     ` Ken Pizzini
1996-09-25  0:00       ` Lee Crites [this message]
1996-09-25  0:00         ` Results of my test: Re: Friday 13th, try it yourself William Clodius
1996-09-27  0:00         ` Dik T. Winter
     [not found]           ` <52qpqt$1b3l@ilx018.iil.intel.com>
1996-10-02  0:00             ` Ken Pizzini
1996-10-02  0:00             ` Dik T. Winter
1996-09-26  0:00       ` Dr John Stockton
1996-09-26  0:00         ` Lee Crites
1996-09-26  0:00           ` Adam Beneschan
1996-09-27  0:00             ` Glen Clark
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-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
1996-09-26  0:00         ` Dr John Stockton
     [not found]         ` <199609302101.JAA04610@kauri.vuw.ac.nz>
1996-09-30  0:00           ` Lee Crites
1996-09-25  0:00     ` Friday 13th, try it yourself (was Language Wars..) Barrie Walker
1996-09-26  0:00       ` Jim Shapiro
1996-09-23  0:00   ` Matthew D. Healy
1996-09-23  0:00     ` Dik T. Winter
1996-09-25  0:00     ` Paul Gilmartin
1996-09-20  0:00 ` language wars (results 13 September) last posting John Girash
1996-09-20  0:00   ` John Girash
1996-09-22  0:00 ` Friday 13th, try it yourself (was Language Wars..) 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-23  0:00 ` Dr John Stockton
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-10-03  0:00 Results of my test: Re: Friday 13th, try it yourself James Gillespie
1996-10-03  0:00 ` Paul Skoczylas
1996-10-03  0:00 ` Dr John Stockton
1996-10-03  0:00 ` Daan Sandee
replies disabled

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