プリンキピア

第3章実数の体系と数論

3.7 Clock Arithmetic3.7 時計算術

Three hands are shown. Two are working on a single laptop while a third holds a credit card.
Figure 3.40図3.40
If a credit card number is entered incorrectly, error checking algorithms will often catch the mistake. (credit: modification of work “Senior couple at home checking finance on credit card from above” by Nenad Stojkovic/Flickr, CC BY 2.0)
英語のヒント
クレジットカードの番号をまちがって入力しても、誤りを確かめるアルゴリズムがその誤りに気づくことが多い。(出典:Nenad Stojkovic/Flickr の “Senior couple at home checking finance on credit card from above” を改変、CC BY 2.0)

Learning Objectives学習目標

After completing this section, you should be able to:
英語のヒント
この節を終えると、次のことができるようになる。
  1. Add, subtract, and multiply using clock arithmetic.
    英語のヒント
    時計算術を使って足し算、引き算、かけ算をする。
  2. 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.
英語のヒント
オンラインの買い物では、クレジットカードの番号を入力する必要があり、その番号は電子的に売り手に送られる。ATMを使うには、銀行のカードを読み取り機に差し込み、読み取り機がそのカードを読み取り、送り、確認する。実店舗での買い物でカードをスワイプしたりタッチしたりすると、カードは機械に情報を送り、その情報は店のコンピュータとクレジットカード会社に伝えられる。この情報は何度も読み取られ、記録され、転送される。そのたびに、記録の誤った数字、入れかわった数字、抜けた数字といった誤りが手順にまぎれこむ機会がまた一つ生まれる。幸い、こうしたカードの番号には、モジュラー算術にもとづく誤り検出のしくみが組み込まれている。モジュラー算術はよく時計算術と呼ばれる。この節では、時計算術、つまりモジュラー算術を調べる。

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 clock arithmetic.
英語のヒント
算術をすると、数はどんどん大きくなりうる。しかし、時間、とくに時計を扱うときは、数はもとに戻って一巡する。49時になることは決してない。12時になると、1に戻って数をくり返す。午前11時に、だれかが「4時間後に会おう」と言えば、午前11時に4時間を足すと、午前15時ではなく午後3時になることがわかる(ここでは24時間制は無視する)。数が12を過ぎると最初からやり直す時計の上で行う数学を、時計算術という。
Clock arithmetic hinges on the number 12. Each cycle of 12 hours returns to the original time (Figure 3.41). 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.
英語のヒント
時計算術は数12を軸にしている。12時間のひとめぐりごとに、もとの時刻に戻る(図3.41)。時計をちょうど1周するところを思い描こう。12時間がたつが、時刻は同じである。だから、3:00なら、14時間後も2時間後も時計の表示は同じ5:00である。14時間を足すことと2時間を足すことは同じである。26時間を足すことも同じである。38時間を足すことも。
An analog clock with the hour hand pointing to 3. A clockwise arrow around the clock is labeled 12 hours later.
Figure 3.41図3.41
Clock showing 3:00 with arrow going around the clock one full time, or 12 hours
英語のヒント
3:00を示す時計と、時計を1周、つまり12時間ぶん回る矢印
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.
英語のヒント
12との関係で、2、14、26、38に共通するものは何か。12で割ると、どれも余りが2になる。それが鍵である。時計のある時刻に何時間かを足すときは、まず足す時間数を12で割り、余りを求める。その余りを時計の時刻に足せば、何時になるかがわかる。
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 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.
英語のヒント
よい思い描き方は、0を出発の時刻に合わせて、数直線を時計に巻きつけることである。すると、数直線上の12が過ぎるたびに、数直線は時計の出発点を通る。これを12を法とする算術という。手順では足す数を12で割るとしているが、まず足し算をしてよい。先に数を足してから12で割って余りを求めても、結果は同じになる。
In general terms, let n be a positive integer. Then n modulo 12, written (n mod 12), is the remainder when n is divided by 12. If that remainder is x, we would write n=x (mod 12).
英語のヒント
一般的にいうと、nを正の整数とする。すると、12を法としたnは、(n mod 12)と書き、nを12で割ったときの余りである。その余りがxなら、n=x (mod 12)と書く。
Example 3.101例題 3.101

Determining the Value of a Number modulo 1212を法とした数の値を求める

Find the value of the following numbers modulo 12:
英語のヒント
次の数の、12を法とした値を求めよ:
  1. 34
  2. 539
  3. 156
Solution解答
To determine the value of a number modulo 12, divide the number by 12 and record the remainder.
英語のヒント
12を法とした数の値を求めるには、その数を12で割り、余りを書き留める。
  1. To find the value 34 modulo 12:
    英語のヒント
    12を法とした34の値を求めるには:
    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.
    英語のヒント
    手順1:筆算の割り算を使って、34を12で割ったときの余りを求める。34以下の12の倍数で最大のものは24で、これは12と2の積である。
    1234224_
    Step 2: Performing the subtraction yields 10.
    英語のヒント
    手順2:引き算をすると10になる。
    1234224_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).
    英語のヒント
    その引き算の結果は12より小さい数になったので、それが余りの10である。12を法とした34の値は10で、34 = 10 (mod 12)である。
  2. To find the value 539 modulo 12:
    英語のヒント
    12を法とした539の値を求めるには:
    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.
    英語のヒント
    手順1:筆算の割り算を使って、539を12で割ったときの余りを求める。まず539の上2けたの53を見る。53以下の12の倍数で最大のものは48で、これは12と4の積である。
    12539448_
    Step 2: Performing the subtraction results in 5.
    英語のヒント
    手順2:引き算をすると5になる。
    12539448_5
    Step 3: Now, the 9 is brought down.
    英語のヒント
    手順3:ここで、9を下ろす。
    12539448_59
    Step 4: The largest multiple of 12 that is less than or equal to 59 is once more 48 itself, which is 12×4.
    英語のヒント
    手順4:59以下の12の倍数で最大のものは、ふたたび48そのもので、これは12×4である。
    125394448_5948_
    Step 5: Finishing the process, the 48 is subtracted from the 59, yielding 11.
    英語のヒント
    手順5:手順の仕上げとして、59から48を引くと11になる。
    125394448_5948_11
    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).
    英語のヒント
    539の数字はすべて使い、最後の引き算の結果は12より小さい数になったので、その数11が余りである。12を法とした539の値は11で、539 = 11 (mod 12)である。
  3. To find the value 156 modulo 12:
    英語のヒント
    12を法とした156の値を求めるには:
    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.
    英語のヒント
    手順1:筆算の割り算を使って、156を12で割ったときの余りを求める。まず156の上2けたの15を見る。15以下の12の倍数で最大のものは12そのもので、これは12と1の積である。
    12156112_
    Step 2: Performing the subtraction results in 3.
    英語のヒント
    手順2:引き算をすると3になる。
    12156112_3
    Step 3: Now, the 6 is brought down.
    英語のヒント
    手順3:ここで、6を下ろす。
    12156112_36
    Step 4: The largest multiple of 12 that is less than or equal to 36 is 36 itself, which is 12×3.
    英語のヒント
    手順4:36以下の12の倍数で最大のものは36そのもので、これは12×3である。
    121561312_3636_
    Step 5: Finishing the process, the 36 is subtracted from the 36, yielding 0.
    英語のヒント
    手順5:手順の仕上げとして、36から36を引くと0になる。
    121561312_3636_0
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).
英語のヒント
156の数字はすべて使い、最後の引き算の結果は12より小さい数になったので、その数0が余りである。12を法とした156の値は0で、156 = 0 (mod 12)である。
We should note here that, had we been speaking of time, the 0 would be interpreted as 12:00.
英語のヒント
ここで、もし時刻について話していたなら、0は12:00と解釈されることに注意しておく。
Example 3.102例題 3.102

Adding with Clock Arithmetic時計算術で足す

If it's 3:00, what time will it be in 89 hours?
英語のヒント
3:00なら、89時間後は何時か。
Solution解答
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 mod(89,12) in Desmos results in 5. Adding 5 hours, which was 89 (mod12), to 3:00 results in 8:00.
英語のヒント
その先の時刻を求めるには、筆算の割り算か、Desmosなどの電卓を使って、89 (mod 12)の値を求めればよい。それから結果を3:00に足す。Desmosにmod(89,12)と入力すると5になる。89 (mod12)である5時間を3:00に足すと、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.
英語のヒント
時計で時間を引くのも、足し算とほとんど同じようにできる。引く時間数の、12を法とした値を求め、それからそれをもとの時刻から引く。
Example 3.103例題 3.103

Subtracting with Clock Arithmetic時計算術で引く

If it is 4:00 now, what time was it 67 hours ago?
英語のヒント
今4:00なら、67時間前は何時だったか。
Solution解答
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 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 3.43.
英語のヒント
その前の時刻を求めるには、筆算の割り算か、Desmosなどの電卓を使って、67 (mod 12)の値を求めればよい。それから結果を4:00から引く。Desmosにmod(67,12)と入力すると7になる。4:00から7時間を引くと‒3:00になる。しかし、時刻は負の時刻では表されないことがわかっている。この値‒3:00は、12:00の3時間前、つまり9:00を示す。よって、4:00の67時間前は9:00だった。これは図3.43で見てとれる。
An analog clock with the hour hand pointing to 4. A counterclockwise arrow around the clock is labeled negative 7 hours.
Figure 3.43図3.43
Clock showing 7 hours subtracted from 4:00
英語のヒント
4:00から7時間を引くようすを示す時計
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.
英語のヒント
時計算術は12を法とする算術と呼ばれたことを思い出そう。12を法とするかけ算も、12で割ったときの余りにもとづく。12を法としてかけるとは、2つの数をかけて、それから12で割ったときの余りを求めることにすぎない。
Example 3.104例題 3.104

Multiplying modulo 1212を法としてかける

What is the product of 11 and 45 modulo 12?
英語のヒント
12を法とした11と45の積は何か。
Solution解答
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 mod(495,12) in Desmos yields 3. Had long division been used, the remainder would be 3. So 11×45=3 modulo 12.
英語のヒント
まず11と45をかけると495である。次に、結果を12で割って余りを求めるか、電卓を使うかして、12を法とした495を求める。Desmosにmod(495,12)と入力すると3になる。筆算の割り算を使っていても、余りは3になる。よって、12を法として11×45=3。