Hi all,
How would you calculate (3+15)mod7 or (6^4)mod7?
I don't know anything about modulo. I read an article about it on Wikipedia, but there doesn't seem to be an example which fits the question I have above.
Thanks for the help!
To perform an operation modulo n, simply perform the operation as you would normally do, then divide it by n. The result you want is the remainder of the division. For example, 3 plus 15 modulo 7 is equivalent to 4 (3 + 15 = 18, 18 when divided by 7 gives a remainder of 4).
Hope that helps!
If you are in "mod 6", then every integer corresponds to 0, 1, 2, 3, 4 or 5 (note that it cannot result in a negative integer). A table, such as stapel's, allows you to quickly convert any integer (positive or negative) into its "mod 6 version". Check the lower line for your number, in this case -3. It corresponds to what number? 3.
I see, so 3 is the answer...but when I type -3mod6 into a calculator it returns an answer of -3. Why is this?
Using http://www.math.uga.edu/~bjones/calc/ it returns an answer of 1...
This is why I am confused lol
3 different answers...
Just a little more formal treatment.
Two integers a and b are said to be congruent modulo n if and only if . That is n divides the difference between the two numbers. That means there is an integer k such that .
With this you can see the integers are partitioned into n equivalence classes. In particular, multiplication is well defined (a similar argument shows addition is also well defined).
(ab) mod n = (a mod n) (b mod n) That is it doesnt matter if you reduce modulo n first before you multiply.
but certainly .
In particular, this puts 's attack on firm foundation and in general greatly reduces computations.