Disclaimer:
Permission to use, copy,
and distribute this software and
It’s documentation for any non commercial purpose is hereby granted without fee,
provided:
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL Henrik Vestermark, BE LIABLE FOR ANY
SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Practice Mental Modulo for Math Trick

Praticing Mental Modulo Calculation

This “practice mental math test application” has a variety of different applications. It can be used to improve your mental math performance, or it can be used in real life to check the correctness of adding numbers together or multiplying numbers together. Let’s first look at some practical applications.
Adding numbers together:
Let’s say that you add the number
123+456
and you get
579 (123+456=579)
and want to check if this sounds reasonable. For this reason, we can with advantage use the module 9 to check the validity of the result. Taking modulus 9 on both side you get:
123 mod 9 + 456 mod 9= 579 mod 9
and you get:
(6+15) mod 9=21 mod 9
which result in
21 mod 9 = 21 mod 9.
Since we have the same on both side of the = sign we can say it is likely the result is correct (but not a guarantee).

Multiplying numbers together:

We can use the same technic for multiplications. E.g. let’s do 123*456 and check if the result 56078 is correct. Taking modulo 9 on both side you get:
(123 mod 9)*(456 mod 9)=(56078 mod 9) =>
(6) * (15)=(26) =>
90=26.
Repeat taking modulo 9 on both side you get:
(90 mod 9)=(26 mod 9) or 0=8
which obviously is not the same so the result 56078 is incorrect. The correct number is 56088 and if you repeat the above calculation you get using modulo 9 on both side that:
0=0
which indicate that this appear to be the correct answer. When I say it appears to be right is that it is possible to get a false positive. Let’s say that you get the result of 56079 and apply the same repeated use of mod 9 then you also get 0=0 which could indicate a correct calculation but the result 56079 is incorrect. Could you use other modulo check than modulo 9. Of course, you could e.g. use module 4 as an example. Repeating the calculation, you get
(123 mod 4)*(456 mod 4)=(56088 mod 4) =>
(3)*(0)=(0) =>
0=0
The problem with modulo 4 is that every time you are 4 off the correct result you get a false positive. For modulo 9 it is for every 9 you are off then you get a false positive. Let’s use modulo 23 as another example and use it on our test expression.
(123 mod 23)*(456 mod 23)=(56088 mod 23) =>
(8)*(19)=(14) =>
(152)=(14).
Repeat modulo 23 on both side you get
(14)=(14).
Indicating the result is likely to be right.
So why are you often using modulo 9 and not some other modulo? The reason is that there is a shortcut for calculating modulo 9 for a number and particular when there are more digits in a number it is significant faster than doing a regular modulo 9 calculation.
The shortcut technic is by adding the individual digits in a number together you get the same as taking modulo 9. E.g.
56088 mod 9
is the same as:
(5+6+0+8+8) mod 9 = (27) mod 9 = (2+7) mod 9 = 9 mod 9 = 0.
Since the remaining is 0 the number 56088 is divisible by 9. The ease of doing modulo 9 with this shortcut makes it a prime candidate for using this technic doing math trick.
Why the sum of the digit is the same as taking modulo 9?
The base 10 representation of a number, N can be given by: N=a_{n}10^{n}+a_{n-1}10^{n-1}+...+a_{1}10^{1}+a_{0}
Taking 10 mod 9 = 1 so we can write the 10^{n}≡1(mod 9) therefore a_{n}10^{n}+a_{n-1}10^{n-1}+...+a_{1}10^{1}+a_{0=an1+an-11+...+a11+a0
}

Therefore, we have
N≡a_{n}+a_{n-1}+...+a_{1}+a_{0.
This tells us that N is a multiple of 9 only if the sum of its digits is also a multiple of 9. That is the shortcut to use, that by just checking if the sum is a multiple of 9 then the number in questions is also a multiple of 9. The sum shortcut is a lot faster than doing the division by 9 on the number N itself.}

Classic Mental Math Trick

A classic math tricks. (see Arthur Benjamin which is the master of mental math at: (https://www.youtube.com/watch?v=1JW9BA57aR8 )
Take a random number let’s say 378 and ask one from the audience to multiply this number by any 3-digit number that comes into his/her mind and write the result down on a piece of paper without telling you the result. The result is a 6 or 7-digit number. Ask the person to circle one non-zero digit of the result and tell you the remaining digits to you. In a split of a second you can tell which digit the person circle.
Here is how it works. The so-called random number 378 is not as you would suspect a random number selected by you but a number that is divisible by 9. You can add the individual digit 3+7+8=18 which is divisible by 9. Since your number it divisible by 9 then any number you multiply it with, the result will still be divisible by 9. And by giving you all the number except one you can easily add the given digits together and then the missing digit must the digit that round up to the next sum divisible by 9. Let’s see by an example:
Let’s say that the audience choose the number 527 and multiply it with the given number 378 you get 199206. Let’s say that the audience choose 2 as the digit they circle and then call out the other numbers 1,9, 9, 0, 6. Adding them quickly together in your head you get 1+9+9+0+6=25. The next higher number from 25 that is divisible by 9 is 27 so the missing digit is 2, to the surprise of the audience when you announce it.
You can spice out the trick by choose a 4-digit number instead of 3-digit number or let the audience select the first 2 digit e.g. 5 and 6 and then you can select the third digit that makes the initial number divisible with 9 which in this case is 7 for the number 567. Lastly it is important that the number to be circled is not a zero. A zero will introduce an ambiguity if the sum of the other digits is a multiple of 9 since we can’t tell if the missing digit is a zero or a nine.

Shortcuts for modulo calculations

Now since this application is a practice of the modulo calculation it is good to know some mental short cuts for the calculation: For the digit 2 it is enough just to look at the last digit and apply the modulo calculation on this single digit regardless of how many digits there is in the number. E.g. 123457 mod 2 is the same as 7 mod 2=1. For the digit 3 you can use the same shortcuts as for 9 by just adding the individual digits together and then apply mod 3 of that number. E.g., 1234567 mod 3 = (1+2+3+4+5+6+7) mod 3 = 28 mod 3 = 1. For the digit 4 you need to look at the last 2 digits and apply the modulo to that number. E.g. 1234567 mod 4 is the same as 67 mod 4=3 For the digit 5 you only need to look at the last digit to determine modulo of that number. E.g. 1234567 mod 5 is the same as 7 mod 5 =2. For the digit 6 there is no good shortcut. However, you can do a running calculation as follows by looking at 1 or 2 digits at a time starting from the left side. Using our test number 1234567, the first 2 digits is 12 which is divisible by 6 so you simply ignore it. Next two is 34%6=4. 4 is know the first digit and the next digit is 5 so 45%6=3 the next pair is then 36%6=0 so ignore it and the last digit is 7%6=1 so the result is 1. After some practice you can usually do 3-digits at a time e.g.
1234567%6. 123%6=3, 345%6=3, 367%6=1 For the digit 7. Like for 6 there is no good shortcut. However, you can do a running calculation as follows using the same technic as for the digit 6.
1234567%7. Take the first 2 digit 12%7=5 the next to is 53%7=4, the next two digits is 44%7=2, the next 25%7=4, 46%7=4 and the last two digits is 47%7=5 For the digit 8 you need to look at the last 3 digits of the number and take modulo 8 of that number. E.g. 1234567 mod 8 is the same as 567 mod 8=7. Notice a pattern here: for 2 you look at the last digit. For 4 the last 2 digits and for 8 the last 3 digits. It can be shown that for modulo of a number on the form 2n it is enough to look at the last n digit to quickly calculate the modulo 2n operation. For the digit 9 As previously mention the shortcuts for 9 is just adding the individual digits together and then apply mod 9 of that number. E.g., 1234567 mod 9 = (1+2+3+4+5+6+7) mod 9 = 28 mod 9 = 1. For the digit 10 This is a simple as it gets. Just look at the last digit and that is the result of mod 10. E.g. 1234567 mod 10 = 7 And for the digit 11. Here it gets a little bit trickier but still doable. Starting with the digit to the right you alternate between adding and subtracting digits. An Example will clarify it e.g. 1234567 mod 11 = (7-6+5-4+3-2+1) = 4 which is the result of doing 1234567 mod 11. If you end up with a negative number simply add 11 to the result and you are done. E.g. 123456%7=(-6+5-4+3-2+1)=-3. Since it is negative then continue add +11 until it becomes positive -3=11=8 which is the result.

Have fun

Corrections:

21-Jun-2017

Vs 1.0

Initial release of practice mental cubic root calculator