Using a projector, navigate to the Clock Arithmetic applet. Before using, discuss the applet.
Explain that this is "modular arithmetic". It focuses on remainders. In the situation before, we add 5 hours to our start time to get 14 hours. But then we do "14 mod 12". Does anybody know what that means? Can anybody guess?
"14 mod 12" means you take the first number and divide it by the second number. We don't care about the quotient in this case. That's how many times it's gone around the clock, and it's not important for this problem. Does anybody know what we do care about?
Modular arithmetic focuses on remainders. All you're really looking for is the remainder. Let's try another problem: 29 mod 7. What's the answer? Let's work through it: 29 divided by 7... we know that 28 is a multiple of 7, and 29 is 1 greater than 28. So the answer is 1.
Let's think about a different problem. Suppose that my birthday is on a Friday last year. And I want to know what day my birthday will be on next year, how could I solve it? Can we use modular arithmetic? Solve the problem by setting the clock to 7, since there are 7 days in a week. Set the start time to 6, since Friday is the 6th day of the week. Now set the elapsed time to 365 since there are 365 days in a year (most of the time). Have the applet calculate for you. Meanwhile, complete the long division by hand to make sure it's done correctly. The remainder will be 1, which is why the applet will finish on 7. (To just calculate the remainder, set the start time to 0.)
All of that is really neat, but what does it have to do with coding messages? Can anybody guess? If students are having trouble, set the clock size to 26 as a hint. Help students realize that they could use each number to represent a letter, and encode messages that way.