All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General
Friday the 13th (Posted on 2004-08-13) Difficulty: 4 of 5
Which day of the week (Sunday, Monday, etc.) is the probability largest to fall on the 13th of a random month, in a random year?

Or is this probability the same for each day of the week?

See The Solution Submitted by SilverKnight    
Rating: 3.5000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Solution | Comment 8 of 13 |
(In reply to re: Solution by Charlie)

Charlie: "Perhaps what went wrong was in using INTEGER rather than LONG. INTEGER can go only up to about 32,000 and then cycles around to something like -32,000, etc, so you're not getting the real year numbers in your comparison for leap year,"

In Visual Basic .NET 2003, the Integer datatype goes up to +2,147,483,647. (The negative max is -2,147,483,648). The real problem was that I was correctly setting two flags to indicate leap years, but then I was not testing those flags to determine leap years later, but just testing for "multiple of 4".

 


  Posted by Penny on 2004-08-14 06:37:58
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information