#set document(title: "3.7 Clock Arithmetic", author: "OpenStax / XYZ Homework") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 3.7#h(0.6em)Clock Arithmetic #figure(figph[Three hands are shown. Two are working on a single laptop while a third holds a credit card.], alt: "Three hands are shown. Two are working on a single laptop while a third holds a credit card.", caption: [If a]) === Learning Objectives After completing this section, you should be able to: + Add, subtract, and multiply using clock arithmetic. + Apply clock arithmetic to calculate real-world applications. Online shopping requires you to enter your credit card number, which is then sent electronically to the vendor. Using an ATM involves sliding your bank card into a reader, which then reads, sends, and verifies your card. Swiping or tapping for a purchase in a brick–and-mortar store is how your card sends its information to the machine, which is then communicated to the store’s computer and your credit card company. This information is read, recorded, and transferred many times. Each instance provides one more opportunity for error to creep into the process, a misrecorded digit, transposed digits, or missing digits. Fortunately, these card numbers have a built-in error checking system that relies on modular arithmetic, which is often referred to as clock arithmetic. In this section, we explore clock, or modular, arithmetic. #notebox("Video", rgb("#DC2626"), rgb("#DC2626"), rgb("#f7f8fa"))[ #link("https://openstax.org/r/Determining_the_Day_of_the_Week_for_Any_Date_in_History")[Determining the Day of the Week for Any Date in History] ] === Adding, Subtracting, and Multiplying Using Clock Arithmetic When we do arithmetic, numbers can become larger and larger. But when we work with time, specifically with clocks, the numbers cycle back on themselves. It will never be 49 o’clock. Once 12 o’clock is reached, we go back to 1 and repeat the numbers. If it's 11 AM and someone says, “See you in four hours,” you know that 11 AM plus 4 hours is 3 PM, not 15 AM (ignoring military time for now). Math worked on the clock, where numbers restart after passing 12, is called #strong[clock arithmetic]. Clock arithmetic hinges on the number 12. Each cycle of 12 hours returns to the original time . Imagine going around the clock one full time. Twelve hours pass, but the time is the same. So, if it is 3:00, 14 hours later and two hours later both read the same on the clock, 5:00. Adding 14 hours and adding 2 hours are identical. As is adding 26 hours. And adding 38 hours. #figure(figph[An analog clock with the hour hand pointing to 3. A clockwise arrow around the clock is labeled 12 hours later.], alt: "An analog clock with the hour hand pointing to 3. A clockwise arrow around the clock is labeled 12 hours later.", caption: [Clock showing 3:00 with arrow going around the clock one full time, or 12 hours]) What do 2, 14, 26, and 38 have in common in relation to 12? When they are divided by 12, they each have a remainder of 2. That's the key. When you add a number of hours to a specific time on the clock, first divide the number of hours being added by 12 and determine the remainder. Add that remainder to the time on the clock to know what time it will be. A good visualization is to wrap a number line around the clock, with the 0 at the starting time. Then each time 12 on the number line passes, the number line passes the starting spot on the clock. This is referred to as #strong[modulo 12] arithmetic. Even though the process says to divide the number being added by 12, first perform the addition; the result will be the same if you add the numbers first, and then divide by 12 and determine the remainder. In general terms, let #math.equation(block: false, alt: "n")[$n$] be a positive integer. Then #math.equation(block: false, alt: "n")[$n$] modulo 12, written (#math.equation(block: false, alt: "n")[$n$] mod 12), is the remainder when #math.equation(block: false, alt: "n")[$n$] is divided by 12. If that remainder is #math.equation(block: false, alt: "x")[$x$], we would write #math.equation(block: false, alt: "n equals x")[$n = x$] (mod 12). #notebox("Checkpoint", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ #emph[Caution: 12 mod 12 is 0. So, if a mod 12 problem ends at 0, that would be 12 on the clock.] ] #examplebox("Example 1")[Determining the Value of a Number modulo 12][ Find the value of the following numbers modulo 12: + 34 + 539 + 156 #solutionbox[ To determine the value of a number modulo 12, divide the number by 12 and record the remainder. + To find the value 34 modulo 12: #linebreak() #strong[Step 1:] Determine the remainder when 34 is divided by 12 using long division. The largest multiple of 12 that is less than or equal to 34 is 24, which is the product of 12 and 2. #math.equation(block: true, alt: "12 34 2; 24 _")[$12 limits(") " overline(34))^(2) \ #h(1.38em) underline(24)$]#strong[Step 2:] Performing the subtraction yields 10. #math.equation(block: true, alt: "12 34 2; 24 _; 10")[$12 limits(") " overline(34))^(2) \ #h(1.38em) underline(24) \ #h(1.4em) 10$]Since that subtraction resulted in a number less than 12, that is the remainder, 10. The value of 34 modulo 12 is 10, or 34 = 10 (mod 12). + To find the value 539 modulo 12: #linebreak() #strong[Step 1:] Determine the remainder when 539 is divided by 12 using long division. We first look to the first two digits of 539, 53. The largest multiple of 12 that is less than or equal to 53 is 48, which is the product of 12 and 4. #math.equation(block: true, alt: "12 539 4; 48 _")[$12 limits(") " overline(539))^(4) \ #h(0.68em) underline(48)$]#strong[Step 2:] Performing the subtraction results in 5. #math.equation(block: true, alt: "12 539 4; 48 _ 5")[$12 limits(") " overline(539))^(4) \ limits(#h(0.68em) underline(48))_(#h(1.48em) 5)$]#strong[Step 3:] Now, the 9 is brought down. #math.equation(block: true, alt: "12 539 4; 48 _ 59")[$12 limits(") " overline(539))^(4) \ limits(#h(0.68em) underline(48))_(#h(2.38em) 59)$]#strong[Step 4:] The largest multiple of 12 that is less than or equal to 59 is once more 48 itself, which is #math.equation(block: false, alt: "12 times 4")[$12 × 4$]. #math.equation(block: true, alt: "12 539 44; 48 _ 59; 48 _")[$12 limits(") " overline(539))^(44) \ limits(#h(0.80em) underline(48))_(#h(2.38em) 59) \ underline(48 #h(0.34em))$]#strong[Step 5:] Finishing the process, the 48 is subtracted from the 59, yielding 11. #math.equation(block: true, alt: "12 539 44; 48 _ 59; 48 _ 11")[$12 limits(") " overline(539))^(44) \ limits(#h(0.80em) underline(48))_(#h(2.38em) 59) \ limits(underline(48 #h(0.34em)))_(11 #h(0.50em))$]We've used all the digits of 539, and the last subtraction resulted in a number less than 12, so that number, 11, is the remainder. The value of 539 modulo 12 is 11, or, 539 = 11 (mod 12). + To find the value 156 modulo 12: #linebreak() #strong[Step 1:] Determine the remainder when 156 is divided by 12 using long division. We first look to the first two digits of 156, 15. The largest multiple of 12 that is less than or equal to 15 is 12 itself, which is the product of 12 and 1. #math.equation(block: true, alt: "12 156 1; 12 _")[$12 limits(") " overline(156))^(1) \ #h(0.80em) underline(12)$]#strong[Step 2:] Performing the subtraction results in 3. #math.equation(block: true, alt: "12 156 1; 12 _ 3")[$12 limits(") " overline(156))^(1) \ #h(1.30em) limits(underline(12) #h(0.50em))_(3)$]#strong[Step 3:] Now, the 6 is brought down. #math.equation(block: true, alt: "12 156 1; 12 _ 36")[$12 limits(") " overline(156))^(1) \ #h(1.80em) limits(underline(12) #h(0.85em))_(36)$]#strong[Step 4:] The largest multiple of 12 that is less than or equal to 36 is 36 itself, which is #math.equation(block: false, alt: "12 times 3")[$12 × 3$]. #math.equation(block: true, alt: "12 156 13; 12 _ 36; 36 _")[$12 limits(") " overline(156))^(13) \ #h(1.35em) limits(underline(12) #h(0.65em))_(36) \ underline(36) #h(0.50em)$]#strong[Step 5:] Finishing the process, the 36 is subtracted from the 36, yielding 0. #math.equation(block: true, alt: "12 156 13; 12 _ 36; 36 _ 0")[$12 limits(") " overline(156))^(13) \ #h(0.80em) limits(underline(12))_(#h(1.20em) 36) \ limits(underline(36))_(0) #h(0.50em)$] We've used all the digits of 156, and the last subtraction resulted in a number less than 12, so that number, 0, is the remainder. The value of 156 modulo 12 is 0, or, 156 = 0 (mod 12). We should note here that, had we been speaking of time, the 0 would be interpreted as 12:00. ] ] #notebox("Tech Check", rgb("#183B6F"), rgb("#183B6F"), rgb("#EFF1F5"))[ #emph[Using Desmos to Determine the Value of a Number module 12] Desmos may be used to determine the value of a number modulo 12. It is flexible enough to find the value of a number modulo of any other integer you want. To determine the value of #math.equation(block: false, alt: "n")[$n$] modulo 12, type #strong[mod(#math.equation(block: false, alt: "n")[$bold(italic(n))$],12)] into Desmos. The result will be displayed immediately. This can be used to find 539 modulo 12, as shown in the . #figure(figph[Desmos screen is displayed. It reads, 539 mod 12 equals 11.], alt: "Desmos screen is displayed. It reads, 539 mod 12 equals 11.", caption: [Display of 539 modulo 12]) Clock arithmetic is modulo 12 arithmetic but applied to time. As time is divided into 12 hours that repeat a cycle, we use modulo 12 for clock arithmetic. ] #notebox("Video", rgb("#DC2626"), rgb("#DC2626"), rgb("#f7f8fa"))[ #link("https://openstax.org/r/Clock_Arithmetic")[Clock Arithmetic] ] #examplebox("Example 2")[Adding with Clock Arithmetic][ If it's 3:00, what time will it be in 89 hours? #solutionbox[ To find that future time, we may determine the value of 89 (mod 12), either by long division or by using a calculator, such as Desmos. Then add the result to 3:00. Entering #strong[mod(89,12)] in Desmos results in 5. Adding 5 hours, which was 89 (mod12), to 3:00 results in 8:00. ] ] Subtracting time on the clock works in much the same way as addition. Find the value of the number of hours being subtracted modulo 12, then subtract that from the original time. #examplebox("Example 3")[Subtracting with Clock Arithmetic][ If it is 4:00 now, what time was it 67 hours ago? #solutionbox[ To find that past time, we may determine the value of 67 (mod 12), either by long division or by using a calculator, such as Desmos. Then subtract the result to 4:00. Entering #strong[mod(67,12)] in Desmos results in 7. Subtracting 7 hours from 4:00 results in ‒3:00. We know, though, that time is not represented with negative times. This value, ‒3:00, indicates three hours before 12:00, which is 9:00. So, 67 hours before 4:00 was 9:00. We see this in the . #figure(figph[An analog clock with the hour hand pointing to 4. A counterclockwise arrow around the clock is labeled negative 7 hours.], alt: "An analog clock with the hour hand pointing to 4. A counterclockwise arrow around the clock is labeled negative 7 hours.", caption: [Clock showing 7 hours subtracted from 4:00]) ] ] Recall that clock arithmetic was referred to as modulo 12 arithmetic. Multiplying in modulo 12 also relies on the remainder when dividing by 12. To multiply modulo 12 is just to multiply the two numbers, and then determine the remainder when divided by 12. #examplebox("Example 4")[Multiplying modulo 12][ What is the product of 11 and 45 modulo 12? #solutionbox[ We begin by multiplying 11 and 45, which is 495. Next, we find 495 modulo 12, either by dividing the result by 12 to determine the remainder, or by using a calculator. Entering #strong[mod(495,12)] in Desmos yields 3. Had long division been used, the remainder would be 3. So #math.equation(block: false, alt: "11 times 45 equals 3")[$11 × 45 = 3$] modulo 12. ] ] === Calculating Real-World Applications with Clock Arithmetic #examplebox("Example 5")[Applying Clock Arithmetic][ Suppose it is 3:00, and you decide to check your email every 5 hours. What time will it be when you check your email the ninth time? #solutionbox[ If you check your email every 5 hours nine times, that ninth check will occur 45 hours after 3:00, which is an addition of 45 hours to 3:00. So, we find 45 modulo 12, which is 9. Nine hours after 3:00 is 12:00. It will be 12:00 when you check your email the ninth time. ] ] Clock arithmetic processes can be applied to days of the week. Every 7 days the day of the week repeats, much like every 12 hours the time on the clock repeats. The only difference will be that we work with remainders after dividing by 7. In technical terms, this is referred to as #strong[modulo 7]. More generally, let #math.equation(block: false, alt: "n")[$n$] be a positive integer. Then #math.equation(block: false, alt: "n")[$n$] modulo 7, written #math.equation(block: false, alt: "n")[$n$] mod 7, is the remainder when #math.equation(block: false, alt: "n")[$n$] is divided by 7. If that value is #math.equation(block: false, alt: "x")[$x$], we may write #math.equation(block: false, alt: "n equals x")[$n = x$] (mod 7). #examplebox("Example 6")[Applying Clock Arithmetic to Days of the Week][ Your family has a cat, and no one wants to empty the litter box. However, it has to be done daily. The six of you agree to take turns, so everyone has to empty the litter box every 6 days. You empty the box on a Thursday. What day will you empty the box for the 10th time? #solutionbox[ The first time you emptied the litter box was on a Thursday. So,the 10th time you empty the litter box will be 9 times later (you've already had your first turn, so 9 turns left!). This will happen 54 (9 times 6) days later. Finding the value of 54 modulo 7, using division to determine the remainder or using a calculator to find the value of 54 modulo 7 gives the answer 5. Five days after a Thursday is Tuesday. ] ] === Key Terms - clock arithmetic - modulo 7 - modulo 12 === Key Concepts - Clock arithmetic uses the idea that after 12 o’clock comes 1 o’clock. For clock arithmetic, this means that every time 12 is passed in an arithmetic process, the next number is 1, not 13. - To determine the clock result of an arithmetic operation, divide the final result by 12 and keep the remainder. If the remainder is 0, then the time is 12 o’clock. - Clock arithmetic is technically called modulo 12 arithmetic. To perform modulo 12 arithmetic, calculate the expression, then divide the result by 12. The modulo 12 result is the remainder. - Days, in our system, pass in groups of seven. To calculate in day arithmetic, modulo 7 is used. To perform modulo 7 arithmetic, calculate the expression, then divide the result by 7. The modulo 7 result is the remainder. === Videos - #link("https://openstax.org/r/Determining_the_Day_of_the_Week_for_Any_Date_in_History")[Determining the Day of the Week for Any Date in History] - #link("https://openstax.org/r/Clock_Arithmetic")[Clock Arithmetic]