Loading...
Loading...
Discrete Math · Axiom Academy
REAL WORLD Calendar Calculations Discover how modular arithmetic helps determine the day of the week for any date in history using Zeller's congruence Imagine you're planning a historical documentary and need to know: What day of the week was July 4, 1776? Or perhaps you're curious about your great-grandparent's birthday in 1923. How can we calculate this without looking at a calendar? The answer lies in modular arithmetic and a brilliant formula called Zeller's congruence , discovered by Christian Zeller in the 19th century. This mathematical tool can tell you the day of week for any date—even accounting for leap years and calendar reforms! From scheduling algorithms in software to historical research, knowing how to calculate days of the week programmatically is essential. Banks, airlines, and countless apps rely on this math every day! Days of the week repeat in a cycle of 7. This makes it perfect for modular arithmetic (mod 7). Let's assign numbers to days: If today is Wednesday (4), what day is it in 10 days? We calculate: (4 + 10) mod 7 = 14 mod 7 = 0 , which is Saturday! Quick Question: If today is Monday (2), what day of the week is it in 100 days? Christian Zeller derived a formula that accounts for months, years, and leap years. Here it is: h = day of the week (0 = Saturday, 1 = Sunday, ...) m = month (3 = March, 4 = April, ..., 14 = February)* K = year of the century (year mod 100) J = zero-based century (⌊year/100⌋)
This is the written version of the interactive lesson above. See the full Discrete Math course.