# Which day was it?

Algebra Level 3

$\begin{cases} f = \left \lfloor \frac{14 - m}{12} \right \rfloor \\ x = d + y - f + \left \lfloor \frac{31(m + 12f -2)}{12} \right \rfloor + \left \lfloor \frac{y}{4} \right \rfloor - \left \lfloor \frac{y}{100} \right \rfloor + \left \lfloor \frac{y}{400} \right \rfloor \\ W(x) = x - 7 \left \lfloor \frac{x}{7} \right \rfloor + 1 \end{cases}$

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!

×