Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Friggatriskaidekaphobia

Status
Not open for further replies.

CajunCenturion

Programmer
Mar 4, 2002
11,381
US
I hope everyone has a fearless Friday, the 13th.

--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
Wise men speak because they have something to say, fools because they have to say something. - Plato
 
I never notice it is Friday the 13th until someone else mentions it, then I get a little superstitious. I didnt know there was an actual "phobia" for it or a name for it. At least it is easy to pronounce. [wink]
Come to think of it, a dark colored squirrel did try to cross the road in front of me on the way to work this morning......



Learning - A never ending quest for knowledge usually attained by being thrown in a situation and told to fix it NOW.
 
On my way to work I passed by a car fire on the highway. Someone was obviously having an unlucky day.
 
Found a penny this morning. Gotta be good luck!

Aspiring to mediocrity since 1957
 
Heads up or down?

Learning - A never ending quest for knowledge usually attained by being thrown in a situation and told to fix it NOW.
 
I'm reposting an interesting tidbit I learned recently to this forum for those that might not have seen it in STC.

Statistically, the 13th day of the month falls more frequently on a Friday than any other day of the week. (the difference is insignificant but real)

Cool fact of the day.

**********************************************
What's most important is that you realise ... There is no spoon.
 
DrB0b said:
Heads up or down?
Hey, if I find a penny it's good luck regardless of which side is up or down. I'm a penny richer. ;-)


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
kwbMitel said:
I'm reposting an interesting tidbit I learned recently to this forum for those that might not have seen it in STC.

Statistically, the 13th day of the month falls more frequently on a Friday than any other day of the week. (the difference is insignificant but real)

Cool fact of the day.

I find that hard to believe. Given a long enough time span, I would think it would have a pretty even distribution across all days of the week.

Do you have a link to the thread where this was discussed?

 
What about 6, 20, and 27 they will fall on a Friday every time the 13 falls on a Friday.

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
OK, here's the scoop on the Frequency of the 13th for each day of the week.

For this year, 2012, the 13th of the month has this frequency...

Code:
13th frequency from January 2012 through December 2012

Sundays    = 1
Mondays    = 2
Tuesdays   = 2
Wednesdays = 1
Thursdays  = 2
[b]Friday     = 3[/b]
Saturdays  = 1

That is more Friday 13ths than any other day 13ths. Looking at the years 2000 through the end of 2012...

Code:
13th frequency from January 2000 through December 2012

[b]Sundays    = 23[/b]
Mondays    = 21
[b]Tuesdays   = 24[/b]
Wednesdays = 21
[b]Thursdays  = 24[/b]
Friday     = 22
Saturdays  = 21

...it looks like Tuesdays, Thursdays, and Sundays have the edge over Friday.

Checking it for January 1900 through the end of the year 2012, it looks like Tuesday has more 13ths than any other day, by a whopping 1. But it's still a very close even distribution across all days of the week.

Code:
13th frequency from January 1900 through December 2012

Sundays    = 193
Mondays    = 193
[b]Tuesdays   = 195[/b]
Wednesdays = 193
Thursdays  = 194
Friday     = 194
Saturdays  = 194

Here's the code if anyone wants to check it.

Code:
#!/bin/ksh

MIN_YEAR=1900
MAX_YEAR=2012

YEAR=${MIN_YEAR}

SUNDAY=0
MONDAY=0
TUESDAY=0
WEDNESDAY=0
THURSDAY=0
FRIDAY=0
SATURDAY=0

while (( YEAR <= MAX_YEAR ))
do
        for MONTH in 1 2 3 4 5 6 7 8 9 10 11 12
        do
          cal ${MONTH} ${YEAR} | grep 13 | tail -1 | read SUN MON TUE WED THU FRI SAT

          (( SUN == 13 )) && (( SUNDAY += 1 ))
          (( MON == 13 )) && (( MONDAY += 1 ))
          (( TUE == 13 )) && (( TUESDAY += 1 ))
          (( WED == 13 )) && (( WEDNESDAY += 1 ))
          (( THU == 13 )) && (( THURSDAY += 1 ))
          (( FRI == 13 )) && (( FRIDAY += 1 ))
          (( SAT == 13 )) && (( SATURDAY += 1 ))
        done

        (( YEAR += 1 ))
done

print
print "13th frequency from January ${MIN_YEAR} through December ${MAX_YEAR}"
print
print "Sundays    = ${SUNDAY}"
print "Mondays    = ${MONDAY}"
print "Tuesdays   = ${TUESDAY}"
print "Wednesdays = ${WEDNESDAY}"
print "Thursdays  = ${THURSDAY}"
print "Friday     = ${FRIDAY}"
print "Saturdays  = ${SATURDAY}"
print

# EOF

 
Perhaps Im missing a variable here, but are you taking into account, Feb = 28 days and every other month either 30 or 31? It appears to me you generalized the months to have the same number of days, but it is Friday and I may have my, "let's go home and take a nap" hat on...

Learning - A never ending quest for knowledge usually attained by being thrown in a situation and told to fix it NOW.
 
Sambones - you need to use a 400 year cycle minimum or multiple thereof to allow for the centuries that do not have leap years.

**********************************************
What's most important is that you realise ... There is no spoon.
 
Here's the link
thread1229-1673819

**********************************************
What's most important is that you realise ... There is no spoon.
 
4800 months is 400 years. Here's what my scripts gives for 400 years...

Code:
13th frequency from January 1613 through December 2012

Sundays    = 684
Mondays    = 685
Tuesdays   = 686
Wednesdays = 687
Thursdays  = 685
Friday     = 688
Saturdays  = 684

Friday is ahead by only 1. That's a 0.1% advantage. I'm not sure if that's significant or not.

My code choked on September 1752. There is no 13th in that month (according to the "cal" program").

Code:
$ cal 9 1752
   September 1752
 S  M Tu  W Th  F  S
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Running the scripts for 800 years, I get this...

Code:
13th frequency from January 1213 through December 2012

Sundays    = 1370
Mondays    = 1371
Tuesdays   = 1370
Wednesdays = 1374
Thursdays  = 1370
Friday     = 1375
Saturdays  = 1369

Friday is still ahead, but again, only by 1. That's only a 0.07% advantage.

 
@ Sambones - reread my original post and you will find the following:

(the difference is insignificant but real)

Some might even argue that .1% is not insignificant depending on your point of view


**********************************************
What's most important is that you realise ... There is no spoon.
 
DrB0b, the number of days in the month is accounted for. I'm using the "cal" utility to get the calendar for each month, then just pulling out the week with a 13 in it. I look to see what day that 13 landed on, then add one to that counter. Do it doesn't matter how many days are in the month. I'm trusting "cal" to give me a correct month.

Here's the "cal" output for this month...

Code:
$ cal 7 2012
   July 2012
 S  M Tu  W Th  F  S
 1  2  3  4  5  6  7
[b] 8  9 10 11 12 13 14[/b]
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

I've bolded the line that the script pulls out to test for which day it's on.

Just for grins, I ran it starting in the year 1. I realize our calendar didn't exist in its current form then, but here it is anyway.

Code:
13th frequency from January 1 through December 2012

Sundays    = 3449
Mondays    = 3448
Tuesdays   = 3449
Wednesdays = 3451
Thursdays  = 3448
Friday     = 3453
Saturdays  = 3445

Friday still in the lead.
 
Figured as much, just clarifying. Thanks for the follow up.

Learning - A never ending quest for knowledge usually attained by being thrown in a situation and told to fix it NOW.
 
>My code choked on September 1752. There is no 13th in that month (according to the "cal" program").

Correct. That was when we changed from The Julian Calendar to the Gregorian Calendar. Cal has the correct dates for September.

 
Cool factoid #2 - Sept 13, 1752 never happened.

**********************************************
What's most important is that you realise ... There is no spoon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top