Yesterday there was an interview on NPR Science Friday with a writer from The Simpsons and Futurama who sneaks in lots of references to advanced mathematics and physics into the cartoons. The references would not be recognized by 99% of the audience. Of course, those who get the references feel really good about being in on a secret. The references are often connected to the plots of the episodes.
For example, an episode in which the theme is "everything becomes easy" has a board filled with mathematical equations including "NP = P". In another episode there is an equation written down which, if true, would be a counterexample to Fermat's Last Theorem. The left and right hand sides of the equation evaluate as equal on a 10-digit calculator, but of course they are not exactly equal.
The interviewer asked the screenwriter if he could guess why there seemed to be some connection between comedy and mathematics and he made a suggestion that I don't remember exactly. I gave my own answer to this question in this blog a couple of years ago.
Back then I mentioned that the "ha-ha" moment in a joke is somewhat like the "aha!" moment in discovering, or appreciating, a mathematical proof, in that both often depend on recognizing the likeness between seemingly dissimilar things. In humor, if one doesn't understand a reference and therefore doesn't understand why something is funny, detailed explanations will almost never make the joke funny. Similarly in mathematics, a proof is very satisfying when it ties together ideas that are well known but seemingly unrelated. Imagine presenting the standard proof that √2 is irrational to a group of intelligent but mathematically ignorant college freshmen. A candid student might respond, "I follow what you did, but what is √2 and what is an irrational number, and why does it matter?" (Unfortunately, this kind of classroom experience is all too common.) By the time that the professor answers all these questions, the aha! moment that the professor was trying to elicit has disappeared forever.