The "improbable world" of The Simpsons is "not that different from the equally surprising world of higher mathematics," writes Amir Alexander in The New York Times (1/28/14). This unlikely premise is the subject of a book, “The Simpsons and Their Mathematical Secrets," by Simon Singh. It’s not just that the manager of the Kwik-E-Mart "has memorized pi to the 40,000th digit," or that Lisa Simpson "becomes nearly unbeatable as a baseball manager by mastering complex statistics." It’s that each show’s storyline is mathematical.
Like a math problem, each episode of The Simpsons presents a puzzle and "a known set of characters." The storyline follows them "through a complex series of moves until the problem is solved … The characters must remain true to their personalities and the stories must follow their own inner logic." When proving a geometric theorem, there are similar constraints. "All geometric objects must remain true to their unique characteristics, and each step in the proof must follow the strict rules of logical deduction."
In the case of The Simpsons, if these constraints are broken, there is no story; in terms of geometry, there can be no proof. This is not coincidence, as The Simpsons creative team has included two math scholars from Harvard, and computer scientists from Berkeley, Princeton and Yale. "Math is built into the show’s DNA." David X. Cohen via Berkeley says he also enjoys adding math references to the show (including one 1995 episode, Homer3, that explored "deep mathematical concepts.") "It cancels out those days when I’ve been writing those bodily function jokes," he says.