Tuesday, September 2, 2008

Calender

GIVEN A DATE,MONTH AND A YEAR; HOW TO FIND OUT THAT DAY?

Year +1/4th of year+ date + code of that month
(Year means only the last two digits of the year)
(in 1/4th of the year take only the integral part and not the decimals)

Eg: year is 1987 then take year=87
1/4th = 21



Codes Month
0 June
1 Sept and Dec
2 July and Apr
3 Jan and Oct
4 May
5 Aug
6 Feb,Mar and Nov

if the year falls between 1900 to 1999 deduct two, if the year falls btwn 2000-2099 deduct three, if the year falls between 1800 and 1899 no adjustment is required.
divide the result obtained in 1(after adjusting point no 3) by seven
note the remainder
if it is a leap year and the date is before 1st of March subtract one irrespective of the deductions mentioned in point number 3


Remainder Day
1 Sun
2 Mon
3 Tue
4 Wed
5 Thur
6 Fri
0 Sat


an Eg of the entire process:

suppose the date is 3-9-2008

Solution:

08(Year)+(1/4thof 8)+1(code of September)+3(Date)-3(Stated in point no 3)
=8+2(integral part )+1+3-3
=8+2+1+3-3
=11

when 11 is divided by 7 the remainder is 4 thus by referring to table we can say that the day is WEDNESDAY

PS
Feel free to ask for any clarification. I will be more than happy to help.

14 comments:

Sonica said...

i didnt understand....anything

hariharan said...

why where do u have the problem?
isnt the example clear as well

Sonica said...

i am finding the example dam confusing yaar

ViK............ said...

i have understood bit of that and still trying to do it.....
if having any doubt will ask you...
However its a good mathematical post..
great...

hariharan said...

thx a lot vikas
write it in a book sonica
see wht r the things in it is date month and year.we add date year and to give the effect of leap years we also add the 1/4 of the year and instead of month we add the codes for the month. The codes r such tht if u see the calender if june starts on monday, september and december starts on tuesday and so on

Sonica said...

hey but you have given damn easy example yarrr yeh cheating hai take some year with odd number such as 2003 or 1993 how will u get answer?

hariharan said...

if the year is 1993 then we will add 93 and then 93/4 ie 23 as we will only consider the integer part ie ignore the decimals

Sonica said...

tell me about 2003 2002 and 2001 answer comes weong if u use integral part

hariharan said...

in 2003 u will add 3 and 0 as 03 is the last 2 digits of the year and 3/4 is 0.75 ie ignoring the decimals we have 0 which is the integral part when we divide 3/4.

Sonica said...

hmmm ok.... but my doubts are still not over.. I will keep asking till all my doubts get cleared..

Prerna said...

hey dis is really cool...sir!!

hariharan said...

thx a lot
U understood how it works right?

mamta said...

Hi hari,
Tried calculating for 23rd March 1986.
Year - 86
1/4 of Year - 21
Date - 23
code - 6
adjustment as per (stat3) - 2
total (86+21+23+6-2) = 134
Divided by 7 = 134/7 = 19
not a leap year...
How do i determine the day now.

mamta said...

Sorry for the stupid question...