Figuring out first day of a month

  • Context: High School 
  • Thread starter Thread starter MrGillig
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around calculating the first day of a month given a specific date and the corresponding day of the week. Participants explore the mathematical relationships involved in determining the weekday of the first day based on the provided information.

Discussion Character

  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant proposes a formula to find the weekday of the first day of the month based on the current day and its corresponding weekday number.
  • Another participant expresses confusion about the calculation, questioning whether the day of the week should be counted from 0 or 1.
  • A later reply indicates a realization that negative results from the calculation can be adjusted by adding 7 to find the correct weekday number.

Areas of Agreement / Disagreement

Participants express differing views on the correct method for calculating the first day of the month, particularly regarding the indexing of days of the week. The discussion remains unresolved as participants continue to clarify their understanding.

Contextual Notes

There are limitations regarding the assumptions made about the indexing of days of the week and the handling of negative results in modular arithmetic.

MrGillig
Messages
4
Reaction score
0
Hey guys!

Say I have a date. Let's just take todays date 05/04/2009.

And say I have numbers 0 - 6 corresponding to each day of the week ie. Sunday is 0, Monday is 1 etc.

From just knowing the day of the date, in this case 5, and that today is a Sunday, is it possible to calculate what the first day of the month was? By using the numbers that correspond to each day, of course.

So, I'll reiterate: from just knowing that its the 5th and that it's a Sunday (0), is it possible to figure out what the first day of the month was?
 
Mathematics news on Phys.org
Let today be the dth day of the month, and the day of the week be w. The weekday of the first day of the month is the least residue of [tex]w-(d-1)[/tex] mod 7 and in general, the weekday of the kth day is the least residue of [tex]w-(d-k)[/tex] mod 7.
 
I'm confused. If I were to plug the values in for today would they then be "0 - (5+1) % 7". When I calculate this I seem to get -6, which isn't Wednesday. Did I mess up the calculation somewhere?

EDIT: Just read your edit sorry. Gonna try again.
 
Sorry man but I'm still confused. If I plug in the values for today, for instance, I get -4. Should I be counting from 1 instead of 0 for the days of the week ie. Sunday is 1, Monday is 2 etc?
 
MrGillig said:
Sorry man but I'm still confused. If I plug in the values for today, for instance, I get -4. Should I be counting from 1 instead of 0 for the days of the week ie. Sunday is 1, Monday is 2 etc?

-4 = 3 (mod 7).
 
Ah I realize now how to equate it to correspond to the day of the week. If it happens to be below 0, I add 7 and get the result for the number corresponding to the first day of the month.

Thanks for the help!
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 16 ·
Replies
16
Views
12K
  • · Replies 43 ·
2
Replies
43
Views
6K