[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums

Friday the 13th

Posted By: ah_clem
Date: Monday, 23 May 2011, at 4:04 p.m.

In Response To: Friday the 13th (Casper van der Tak)

Is there a clever shortcut in working this out, or do you need to rely on brute force?

The easiest way is brute force, assuming you have software that does date calculations. I've got an Oracle server at my fingertips, so it only takes a minute to calculate the number of Friday the 13th per epoch:

select count(*) from
(
select sysdate - rownum as d from any_big_table
where rownum <= 146097
)
where to_char(d, 'dd') = 13
and to_char(d, 'dy') = 'fri'

The answer is 688. Divided by 4800, it gives a number larger than 7. Thus the answer is B.

NOTE: 146097 is the number of days in the epoch (400 year long repeating cycle). 4800 is the number of months in the epoch, hence the number of 13ths of the month.

Messages In This Thread

 

Post Response

Your Name:
Your E-Mail Address:
Subject:
Message:

If necessary, enter your password below:

Password:

 

 

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums is maintained by Stick with WebBBS 5.12.