Vietnam Quantitative Finance Society

User Name
Password
Reply
08-10-2007, 02:04 PM   #1
giangle

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 42
Thanks: 3
Thanked 4 Times in 4 Posts




Default Friday 13th

True or false: The 13th of a calendar month most likely occurs on Friday than on any other days of the week.
giangle is offline Reply With Quote
08-18-2007, 02:47 PM   #2
dexter8310

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 1 Time in 1 Post




Default

True, since people likely give more attraction to it and remember longer when it falls on Friday than other days of the week
dexter8310 is offline Reply With Quote
08-20-2007, 12:16 PM   #3
giangle

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 42
Thanks: 3
Thanked 4 Times in 4 Posts




Default

Good shot! But it is not that simple. In fact from 0007AD to 4007AD there are:

6845 Monday 13th
6843 Tuesday 13th
6864 Wednesday 13th
6834 Thursday 13th
6873 Friday 13th
6834 Saturday 13th
6863 Sunday 13th

Exercise: Write a program in whatever language you are comfortable with to verify the above results. Report the length of your program and execution time.

My R codes are 10 lines long and take 310 seconds to obtain the results.
giangle is offline Reply With Quote
08-25-2007, 02:52 AM   #4
htran

Member
No Avatar
 
Join Date: Aug 2007
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts




Default

Is this still true for any period and not just that span of 4000 years?
htran is offline Reply With Quote
08-27-2007, 10:13 AM   #5
giangle

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 42
Thanks: 3
Thanked 4 Times in 4 Posts




Default

Quote:
Originally Posted by htran View Post
Is this still true for any period and not just that span of 4000 years?
Check it yourself, this problem may be well in your next interview ;-)
giangle is offline Reply With Quote
02-17-2008, 09:32 PM   #6
dexter8310

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 1 Time in 1 Post




Default

Quote:
Originally Posted by giangle View Post
Good shot! But it is not that simple. In fact from 0007AD to 4007AD there are:

6845 Monday 13th
6843 Tuesday 13th
6864 Wednesday 13th
6834 Thursday 13th
6873 Friday 13th
6834 Saturday 13th
6863 Sunday 13th

Exercise: Write a program in whatever language you are comfortable with to verify the above results. Report the length of your program and execution time.

My R codes are 10 lines long and take 310 seconds to obtain the results.
Hey giangle,
Sorry haven't visited the forum for a while
I'm too lazy to run a program for that - or maybe i'm not good enough to write it - both might be true. I think your calculation fell short of something. I expected the total number of 13th day is 4001 * 12 = 48012, but the total I saw from your calculation is 47956. Where're the others? Or I am missing something here?
dexter8310 is offline Reply With Quote
The Following User Says Thank You to dexter8310 For This Useful Post:
giangle (02-18-2008)
02-18-2008, 10:58 AM   #7
giangle

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 42
Thanks: 3
Thanked 4 Times in 4 Posts




Default

Thank dexter8310 for spotting this out. The discrepancy comes from my misreporting the time span in the previous post (0007AD to 4007AD). In fact, the time span was generated by the following code:

many.years=seq((today-(num.years-1)*365),(today+num.years*365),1)

where num.years=2000. Thus, many.years is obviously not 4000 years because of the leap year effect. After rerunning the program today, I get the actual time span from 17/06/0010AD to 21/10/4006AD which covers exactly 47956 full months.

Sorry all for my mistake.
giangle is offline Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Save or bookmark this site with: Del.icio.usStumble It!AddThis.com
All times are GMT +7. The time now is 07:32 AM.
Powered by vBulletin Version 3.7.2