Modulo calculation

# Modulo calculation

Modulo Calculation 1.

As I use modulo Calculation for almost every kind of calculation operation I asked Mathematics Professor Stevenhagen “how important is modulo calculation for a mathematician?”, self being an aritmetician. The answer, to my surprise: “Mathematics without modulo calculation is as impossible as chemistry without atoms”.

I’ll tell something about M(odulo) C(alculation), without giving the mathematic evidence, only the use.

MC is working with remainder classes. There may be several manners of writing, mostly I do 3(7) with which I mean that a given number divided by 7 has a remainder 3. So the number between brackets is the modulo. In Modulo Calculation the quotient of a division is not important, it is the remainder that counts.

In 1949 being 10 years old on the primary school I was taught the 9-test (my teacher possibly did not know the word mc) – as a way to test a multiplication. Calculation machines did not yet exist by far, but anyhow a multiplication should be checked on the accuracy of the answer.

One possibility is to do the multiplication again, with the risk that the same error is made again.

To do the 9-test the individual digits of a number are added and the sum of this is divided by 9. This is very simple as 10÷9 = 1(9) so every 10, 100, 1.000 etc = 1(9).

After having ascertained the remainders of the factors of a multiplication we multiply these remainders and ascertain the remainder of the result. This should be in accordance with the remainder of the whole multiplication.

Modulo Calculation
9 Test

67 6+7=13= 4(9)
89 × 8+9=17= 8(9)

5963 5+9+6+3=23=5(9)
Test 4×8=32=5(9)

As the remainders are in accordance you may suppose your result to be correct. The mathematician will say “There is a chance of 1 out of 9 that nevertheless the result is not correct. This means that the greater the modulo, the less is the chance of an error. But also the bigger the modulo, the more it is difficult to work with.

Should you be more confident with the 9-test you’ll see with 5963 that you can ignore the 9, and as 6+3=0(9) t00, you only have to consider the 5.

Now the same 9-test with bigger numbers.

6541 6+5+4+1=16= 7(9)
2879 × 2+8+7+9=26= 8(9)
18.83.15.39
1+8+8+3+1+5+3+9=20=2(9)
When you have more experience you’ll immediately see the 18, which can be ignored, and the 15+39=54=0(9), so you only have to consider the 83, which is 2(9).

Test 7×8=56=2(9)

Do some multiplications and check the results with the 9-test.
My teacher told us there were a risk with the 9-test: if in the result of the multiplication two digits would be interchanged, the 9-test would not reveal that. A surprising idea led me to the 11-test, which I bethought my self. It is simple to see: 24 and 42 are both 6(9), 24=2(11) and 42= 9(11). Later on I treat the 11- test.

Let’s never forget: modulo Calculation can be adapted with every kind of operation. In the German MCWC one of the tasks is 10 additions of 10 ten digit numbers. They are aligned vertically. There are people who have in this matter a speed second to none, far beyond my capacities.

Working out the 9 test with the individual numbers:
84563931: in this number you can ignore the group 45639, being 0(9). Add only 8+3+1= 3(9).
67929583: in this number you can ignore the group 7929, being 0(9). Add only 6+5+8+3= 4(9).
12983747: in this number you can ignore the 9 and the group 747, being 0(9). Add only 1+2+8+3=5(9).
79895631: in this number you can ignore 9, 9, 6 and 3. Add only 7+8+5+1=3(9)
28586837: in this number you can ignore the group 837. Add only 28586=2(9).
35352396: in this number you can ignore the group 396. Add only 3+5+3+5+2=0(9).
3+4+5+3+2+0=8(9).

Please do not forget that working with test numbers is my “second nature”. And I take it for granted that it inevitably takes some seconds, a correct answer gives points, a quick and incorrect one does not .

In the same way a subtraction:

84320915083157 – 34982381268689 =
84320915083157= 8+4+3+2+1+5+8+3+1+5+7= 2(9)

34982381268689=3+4+8+2+3+2+6+8+6+8=5(9).

The difference between the numbers has to be 2-5=6(9).

The 11 Test

I accustomed myself to split the numbers in groups of 2 digits, starting from right. In 4 digit numbers I add 2 groups of 2 digits, as 100=1(11).

67 67=1(11)
89 × 89=1(11)

5963 59+63=122=1+22=1(11)
Test 1×1=1(11)

65 41 65+41=106=7(11) or 10+8=7(11)
28 79 × 28+79=107=8(11) or 6+2=8(11)

18.83.15.39 18+83+15+39=155=1(11),
If you are accustomed with the 11-test you’ll quickly see that 18+15=0(11), so you can ignore them, you can see 83 and 39 both as 6(11) so that you can simplify the addition to 6+6=1(11).

Test: 7×8=56=1(11).

Integer Divisions

18373153 ÷ 2791 =

Before make a test, convince yourself that the chosen modulo is not the same in the dividend and in the divider. In this case checking is impossible: 0(9) ÷ 0(9) can be any number.

9-test. In this example the dividend is 4(9) and the divider is 1(9), so the answer has to be 4(9) .

11-test. The dividend is 7(11) and the divider is 8(11), so the answer has to be 5(11).

The quotient of this division = 6583, which indeed is 4(9) and 5(11).

Integer Square Roots.

Sqrt 97436641.

The radient is 4(9) so the answer is either 2 or 7(9).
The radient is 5(11), so the answer has to be either 4 or 7(11).
It depends on your knowledge of the squares how you proceed. Let’s suppose you know the squares till 100. You’ll quickly see the answer from left begins with 98, 8(9). So doing the 9-test the other 2 digits have to be also 8(9). Furthermore it is evident that the last number has to be either 1 or 9. there are 4 possibilities for a square under 100 which end on 41: 21, 29, 71, 79. Out of these for 71 is the only one who meets the requirement being 8(9). So final answer 9871.

Ok, the first two digits of the answer are 98, 10(11). So if the answer is 4(11) the last digits have to be 5(11) and if the answer is 7(11) the last digits are 8(11). Out of 21, 29, 71, 79 we know the moduli are resp. 10, 7, 5 and 2 (11). Out of 4 and 7 (11) we can only make a combination which meets the requirements with 71, and 9871 indeed is 4(11).

Integer Cubic Roots.

Cubic root of 33 23 80 51 99 83.

Modulo 9.

We start with havinbg a look at 332380. As 328509>323380<343000, the first digits of the answer are 69. This approach supposes the knowledge of the cubics 1-100. If this is not the case, no special problem.

The radient is 0(9) so the answer can be either 0, 3 or 6(9). Immediately is to be seen that the first digit of the answer is 6, as 216> 332< 343(7^3). The last one has to be a 7 as only 7^3 gives a 3 on the end.
We now could look for the 3rd digit. We have a number ….83 and know that 7³=343. We know too (a+b)³ = a³+3a²b+3ab²+b³ of which the part 3ab² gives us the ten of (a+b)³ . 43 + 3ab²= 83, so 3ab²=40. 3a7²=40, so a=20. We now have a partial answer 6?27.

The final answer can be 6027, 6327, 6627 or 6927.

Now we do the Newton method: 332-216(6^3) = 116, to divide by 6^2*3=108. This is however >1, and this cannot be, the final answer being <7. But is helps us to conclude that the final answer has to be 6927, as 9 is the most near to 1.

Modulo11.

Cubic root of 33 23 80 51 99 83.

For ascertaining the modulo 11 we can ignore the 33 and 99, both being 0(11) and work with 23, 1(11)+ 80, 3(11), 51, 7(11) and 83, 6(11). 1+3+7=0(11), so what remains is 83, 6(11).

The question is which number ^3 is 6(11). In odd powers there is only 1 possibility: 8. 8³=512=6(11). So the complete answer is 8(11).

Again the 1 st. digit of the answer is 6 and the last one is 7. Suppose we know also that the 3rd digit is 2, then we have 6X27. Take 60, 5(11) and add 27, 5(11) we have an answer 10(11). But we have to have 8(11). So which number do we have to add with 60 to get 8(11) . The answer is 9, for 10 + 9 = which is 8(11).
So the final answer is 6927.