⎩ ⎪ ⎪ ⎨ ⎪ ⎪ ⎧ f = ⌊ 1 2 1 4 − m ⌋ x = d + y − f + ⌊ 1 2 3 1 ( m + 1 2 f − 2 ) ⌋ + ⌊ 4 y ⌋ − ⌊ 1 0 0 y ⌋ + ⌊ 4 0 0 y ⌋ W ( x ) = x − 7 ⌊ 7 x ⌋ + 1
The equations above are the formula used to find the week day of any date on a calendar, where d , m , y are date, month, and year respectively. For example, February 29, 2016, can be represented as 29/2/2016 for d , m , & y .
The function W ( x ) will then result in values of 1-7 for Sunday to Saturday respectively.
Which day of the week was July 4, 1776 (America's Independence Day)?
Bonus : Try plug in your birthday and see which day it was!
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
@Pakornrat Hello sir, how was the solution :-)
Log in to reply
Excellent! And great program as well! ;)
Log in to reply
Thank you. By the way, how did you come up with these amazing formulas? I was at first astonished to discover that a formula has been created to determine the day of the week straightforwardly!
Log in to reply
@Muhammad Arifur Rahman – I've seen it in my algebra textbook long time ago, so I just thought it would be fun to put in the party. ;)
And an Upvote will be so generous :-D
Problem Loading...
Note Loading...
Set Loading...
Simply plug the values accordingly. For this case, d = 4 m = 7 y = 1 7 7 6 And patiently put them in the first equation to get f . Consequently, find out x from the second one. Finally, implement f and x to the third one and determine W . For this case, f = 0 , x = 2 2 2 3 , W = 5 which indicates the day was Thursday . Anybody can simply Google it to find. But hopefully you didn't, for the sake of your brilliance!
By the way, you might had to struggle with this flooring thing. So let's handle it to your computer. Here's the program(With C Language) to determine the value of W :
Till now, the program prints the value of W only. You can modify it to print the exact name of the day.
Although there are many apps for this, still I can gift you the executable file of this program to find out your birthday yourself, if you wish so!
Happy Solving!