Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#1 2010-12-14 05:26:57

John E. Franklin
Star Member

Offline

Mod Eight trick

Here's a trick for modular 8 computation.

483 is what mod 8 ?

(4 x 4) + (8 x 2) + 3

16 + 16 + 3

The 16's cancel out, left with 3.


Here's another one:

61 mod 8 ?

(6 x 2) + 1 = 12 + 1 = 13 and 13 is (1 x 2) + 3  --> 2 + 3 --> 5, so answer is 5.

So you double the tens place and quadruple the hundreds place and probably 8 times the thousands place,
and add them together, then repeat to make smaller for the answer of mod 8.

Let's try 6532 ?

(6 x 8) + (5 x 4) + (3 x 2) + 2 =
48 + 20 + 6 + 2 =
76 =
(2 x 7) + 6 =
20 =
(2 x 2) + 0 =
4
So 6532 mod 8 should be 4.

I just discovered this by trial and error after I made an octagonal diagram, or
actually a British Flag shape, like an X and a Plus sign on top of one another, and
started counting around and around up to 100 plus and examined the numbers.


igloo myrtilles fourmis
 

#2 2010-12-14 05:42:42

bobbym
Administrator

Offline

Re: Mod Eight trick

Hi John;

You can simplify it a little.

(6 x 8) + (5 x 4) + (3 x 2) + 2 =

Instead of going 6 * 8 you can use 6 * 0 and anywhere else you see an 8 substitute a 0.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#3 2010-12-14 05:59:27

John E. Franklin
Star Member

Offline

Re: Mod Eight trick

Yes, yes, you are right, I was just thinking about that on the couch...
Like any long number for example #0##0##0##0###.   And the period at the end there is the decimal place.
Yes it's because 125 x 8 is 1000.  Actually it's even better than that because once you get above one-thousand,
all the places to the left of that forever are not need at all, so 00000000000### is all you need to figure the mod 8.
Truly awesome!!  Thanks a lot bobbym.


igloo myrtilles fourmis
 

#4 2010-12-14 06:12:29

bobbym
Administrator

Offline

Re: Mod Eight trick

Without getting into why this works because of that to get  mod 5 of any number. You just have to take the mod of the last digit.

19825638 mod 5 = 3


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#5 2010-12-14 06:47:11

JaneFairfax
Legendary Member

Offline

Re: Mod Eight trick

John E. Franklin wrote:

So you double the tens place and quadruple the hundreds place and probably 8 times the thousands place, and add them together, then repeat to make smaller for the answer of mod 8.

Not necessary, since 1000 is divisible by 8. For any number with four or more digits, you only need to concentrate on the first three digits on the right. Thus 6532 (mod 8) = 532 (mod 8) and 123456789 (mod 8) = 789 (mod 8).

This reason it works is this. Suppose 100a+10b+c is your three-digit number. Doing what you say produces 4a+2b+c. The difference between this and your three-digit number is 96a+8b = 8(12a+b), which is divisible by 8; hence the two numbers are equal mod 8.

Last edited by JaneFairfax (2010-12-14 06:51:20)


Q: Who wrote the novels Mrs Dalloway and To the Lighthouse?

A: Click here for answer.
 

#6 2010-12-14 07:25:29

bobbym
Administrator

Offline

Re: Mod Eight trick

Hi John;

Are you familiar with horners method? I remember being faced with the problem of programming a mod function that took a single or double precision number mod of numbers with millions of digits.

It was for a math package we were writing, still less than half done. It is not that important just that I cannot remember any bit of how I did it! I just remember I used horners method on the numbers and that the routine was fast.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#7 2010-12-15 01:36:15

John E. Franklin
Star Member

Offline

Re: Mod Eight trick

Wow, thanks Jane, that's incredible.  100a + 10b - 4a - 2b is then divisible by 8, hence cancels!!!
And bobbm, I'll look it up...


igloo myrtilles fourmis
 

#8 2010-12-15 03:07:07

bobbym
Administrator

Offline

Re: Mod Eight trick

Hi John;

Do not worry about it right now. See if you can apply what Jane showed you to some other mods like 5 for instance.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

Board footer

Powered by FluxBB