## Section3.5Clock Arithmetic

In the following we give applications of the combination of the operation $$\bmod$$ and the addition of integers called clock arithmetic.

Recall that the operation $$\fmod$$ yields the remainder of integer division. That is, for an integer $$a$$ and a natural number $$b$$ the number $$r=a\fmod b$$ is the number such that $$a=(q\cdot b)+r$$ for some integer $$q$$ and $$r$$ is a non-negative integer and $$r \lt b\text{.}$$

Applications of the operation $$\bmod$$ can be found in arithmetic with hours, days of the week, and months. We start with examples of adding hours and then relate this to using addition and the operation $$\fmod\text{.}$$ (a) We conduct the familiar addition of hours and replace 12 on the clock face by 0.

When using the 12 hour clock we have:

1. An hour after 11 o'clock it is 12 o'clock.

2. Two hours after 11 o'clock it is 1 o'clock.

3. 10 hours after 11 o'clock it is 9 o'clock.

4. 20 hours after 11 o'clock it is 7 o'clock.

5. 25 hours after 11 o'clock it is 12 o'clock.

These operations can be considered as adding hours to a time. To compute these additions we add the hours and then subtract $$12$$ as many times as necessary to obtain a number between $$1$$ and $$12\text{.}$$ With a similar method we had computed the remainder in Algorithm 3.2.2.

The main difference between the two approaches is that using the $$12$$ hour clock we obtain numbers between $$1$$ and $$12$$ and when computing remainders we obtain numbers between $$0$$ and $$11\text{.}$$ That is, we replace $$12$$ by $$0\text{,}$$ as shown in Figure 3.5.1.(a). We call this arithmetic modulo $$12\text{.}$$ Figure 3.5.1.(b) illustrates how the number line wraps around the clock face in arithmetic modulo $$12\text{.}$$ The remainder modulo $$12$$ of two numbers is the same if they differ by a multiple of $$12\text{.}$$

We formulate the computations from Example 3.5.2 using remainders. Recall that we denoted the remainder of the division of $$a$$ by $$12$$ by $$a\fmod 12\text{.}$$

1. $$\displaystyle (11+1)\fmod 12=12\fmod 12=0$$

2. $$\displaystyle (11+2)\fmod 12=13\fmod 12 =1$$

3. $$\displaystyle (11+10)\fmod 12=21\fmod 12 =9$$

4. $$\displaystyle (11+20)\fmod 12=31\fmod 12 =7$$

5. $$\displaystyle (11+25)\fmod 12=36\fmod 12 =0$$

When the numbers are larger than $$12$$ we can simplify our computations by applying Theorem 3.4.10.

By Theorem 3.4.10 that we can add first or take the remainder first, and we will get the same answer, so in Item 4 and Item 5 above, we could have done the following:

1. $$(11+ 20)\fmod 12$$ $$= ((11 \fmod 12) + (20 \fmod 12)) \fmod 12$$ $$= (11 + 8) \fmod 12 = 19 \fmod 12 = 7$$

2. $$(11 + 25)\fmod 12$$ $$= ((11 \fmod 12) + (25 \fmod 12)) \fmod 12$$ $$= (11+ 1) \fmod 12 = 12 \fmod 12 =0$$

The second computation appears to have more steps, but the arithmetic can be much simpler. In practice we combine both approaches.

In the remainder of the section we solve every day problems with clock arithmetic.

What time is it in 79 hours if it is 4 o'clock now ?

Solution.

We have $$(4+79)\fmod 12=83 \fmod 12=11\text{.}$$ Thus 79 hours from now, it is 11 o'clock.

The same result can also be obtained by first computing $$79\fmod 12=7$$ and then $$(4+7)\fmod 12=11\fmod 12=11\text{.}$$

Try for yourself in Checkpoint 3.5.6.

We use the 12 hour clock. Assume it is 8 o'clock. What time will it be 49 hours from now ?

• select

• 12 o'clock

• 1 o'clock

• 2 o'clock

• 3 o'clock

• 4 o'clock

• 5 o'clock

• 6 o'clock

• 7 o'clock

• 8 o'clock

• 9 o'clock

• 10 o'clock

• 11 o'clock

$${\text{9 o'clock}}$$

Everything we have done for hours above also works for other counts that wrap around. For example, when answering questions about weekdays we compute $$\fmod 7\text{.}$$

Which day of the week is it in 110 days from today if today is Friday ?

Solution.

The days of the week wrap around after seven days. When adding days and we want the result as a weekday, any multiples of 7 do not change the day of the week. Instead of adding 110 days we add $$110\fmod 7=5$$ days. So 110 days after Friday is the same day of the week as 5 days after Friday, namely Wednesday.

Try for yourself in Checkpoint 3.5.8.

If today is Thursday. What day will it be 58 days from now?

• select

• Monday

• Tuesday

• Wednesday

• Thursday

• Friday

• Saturday

• Sunday

$$\text{Saturday}$$

Similarly we can answer question about months. As there are $$12$$ months in a year we compute $$\fmod 12\text{.}$$

Which month is it $$721$$ months from now if this month is November?

Solution.

Months wrap around after $$12$$ months. We have $$721\fmod 12=1\text{.}$$ Since December is one month after November, $$721$$ months from now, it will be December.

Try for yourself in Checkpoint 3.5.10.

Assume it is December. What month will it be 73 months from now ?

• select

• January

• February

• March

• April

• May

• June

• July

• August

• September

• October

• November

• December

$$\text{January}$$

When we use the 24 hour clock we compute $$\fmod 24\text{.}$$ Use this in Checkpoint 3.5.11.

We use the 24 hour clock. Assume it is 18:00 hours. What time will it be 59 hours from now ?

• select

• 0:00 hours

• 1:00 hours

• 2:00 hours

• 3:00 hours

• 4:00 hours

• 5:00 hours

• 6:00 hours

• 7:00 hours

• 8:00 hours

• 9:00 hours

• 10:00 hours

• 11:00 hours

• 12:00 hours

• 13:00 hours

• 14:00 hours

• 15:00 hours

• 16:00 hours

• 17:00 hours

• 18:00 hours

• 19:00 hours

• 20:00 hours

• 21:00 hours

• 22:00 hours

• 23:00 hours

$$\text{5:00 hours}$$