Help on the doomsday equation/birthday equation

  • Thread starter lilxchristina
  • Start date
In summary, the given equation calculates the day of the week using the date, month, and year as inputs. It includes factors such as leap years to accurately determine the day. Without the [y/4], [y/100], and [y/400] components, the formula does not work. These factors are necessary for the formula to accurately calculate the day.
  • #1
lilxchristina
4
0
here's the equation


d = date of the month
m = number of the month in the year
y = year


W = d + 2m + [3(m+1)/5] + y + [y/4] - [y/100] + [y/400] + 2

afterwards, divide w by 7, and the remainder is the day of the week, according to:

1 - sunday
2 - monday
3 - tuesday
4 - wednesday
5 - thursday
6 - friday
0 - saturday


now, i totally understand the equation, and it works. but i just don't understand what the significance of the [y/4] [y/100] and [y/400] is.
why is it needed in the equation? :frown:
 
Physics news on Phys.org
  • #2
Take them out. Does the formula work then?
 
  • #3
no, the formula is off. when i tried it with today's date without them, it turned out 1 day behind.
 
  • #4
Think about leap years.
 
  • #5
I tried this equation for Monday, January 29 and it did not work. It also did not work for Tuesday, January 30 or Monday, January 01. It always comes up one day behind. Does it stop working at some year?
 
  • #6
Think about leap years!
 

FAQ: Help on the doomsday equation/birthday equation

1. What is the doomsday equation/birthday equation?

The doomsday equation, also known as the birthday equation, is a mathematical formula used to calculate the probability that two people in a group share the same birthday. It is based on the assumption that birthdays are evenly distributed throughout the year.

2. How is the doomsday equation/birthday equation used?

The equation is typically used in probability and statistics to determine the likelihood of two or more people sharing the same birthday in a group. It can also be used to calculate the probability of shared birthdays in larger populations, such as a classroom or workplace.

3. What is the formula for the doomsday equation/birthday equation?

The formula for the doomsday equation is P(n) = 1 - (365!/(365^n * (365-n)!)), where n is the number of people in the group and P(n) is the probability of at least two people having the same birthday. This formula can be simplified to P(n) = 1 - (365^n/365^n), which can be used for quick calculations.

4. Is the doomsday equation/birthday equation accurate?

The doomsday equation is an approximation and assumes that all birthdays are equally likely. In reality, there may be variations in the distribution of birthdays, which can affect the accuracy of the equation. Additionally, the equation does not take into account factors such as leap years and multiple births (twins, triplets, etc.).

5. Can the doomsday equation/birthday equation be used for other events?

While the doomsday equation was originally developed for calculating the probability of shared birthdays, it can also be applied to other events that have a finite number of outcomes. For example, it can be used to calculate the probability of two people rolling the same number on a dice or drawing the same card from a deck.

Similar threads

Back
Top