Results 1 to 12 of 12

Math Help - Modulo

  1. #1
    Newbie
    Joined
    Apr 2009
    Posts
    7

    Modulo

    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!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Jan 2009
    Posts
    32
    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!
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2009
    Posts
    7
    So if I have understood this correctly, (6^4)mod7 would be (1296)mod7 which would be 1?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Mar 2007
    Posts
    1,240

    Talking

    You betcha!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Apr 2009
    Posts
    7
    Stapel I hope you realise that you are my hero lol

    Edit: Oo just one more thing: (5-8)mod6 = -9? Would that be correct? I'm just unsure because it is negative.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Mar 2007
    Posts
    1,240

    Talking

    Five less eight is minus three. When you're working "mod six", you repeat every six:

    Code:
    ... 0  1  2  3  4  5  0  1  2  3  4  5  0  1  2  3...
    ...-6 -5 -4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9...
    What corresponds to -3?
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Apr 2009
    Posts
    7
    I'm confused. The answer is either -3 or 6, but I'm unsure which one...
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Junior Member
    Joined
    Jan 2009
    Posts
    32
    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.
    Last edited by Referos; May 3rd 2009 at 01:35 PM. Reason: grammar
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Apr 2009
    Posts
    7
    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...
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Junior Member
    Joined
    Jan 2009
    Posts
    32
    Most likely, when you input -3mod6 the calculator performs -(3mod6) rather than (-3)mod6. And if you look at the help section of the calculator in the link your provided, it says: "This calculator is not smart enough to handle negative numbers."
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Behold, the power of SARDINES!
    TheEmptySet's Avatar
    Joined
    Feb 2008
    From
    Yuma, AZ, USA
    Posts
    3,764
    Thanks
    78
    Quote Originally Posted by mathsguy View Post
    So if I have understood this correctly, (6^4)mod7 would be (1296)mod7 which would be 1?

    Just FYI you can simpily cacluations breaking it up into factors

    Note that

    6^4=2^4\cdot 3^4 = 8\cdot 2 \cdot 9 \cdot 9

    We can reduce each of these factors mod 7 to get

     8\cdot 2 \cdot 9 \cdot 9 \mod (7) = 1\cdot 2 \cdot 2 \cdot 2 \mod(7) =8 \mod(7)=1\mod(7)
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Super Member Gamma's Avatar
    Joined
    Dec 2008
    From
    Iowa City, IA
    Posts
    517
    Just a little more formal treatment.

    Two integers a and b are said to be congruent modulo n if and only if n|(a-b). That is n divides the difference between the two numbers. That means there is an integer k such that nk=a-b.


    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.
    (a + nk)(b+ nl)=ab + nal + nbk + n^2kl = ab + n(al + bk + nkl)
    but certainly n|ab - ab + n(al + bk + nkl)= n(al + bk + nkl).

    (a + nk)+ (b +nl) = (a+b) + n(k+l)
    n|(a+ b) - (a+b) + n(k+l) = n(k+l)


    In particular, this puts \emptyset's attack on firm foundation and in general greatly reduces computations.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Modulo
    Posted in the Algebra Forum
    Replies: 2
    Last Post: May 7th 2010, 05:14 PM
  2. Modulo help
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: April 18th 2010, 09:13 AM
  3. modulo ?
    Posted in the Number Theory Forum
    Replies: 7
    Last Post: April 16th 2010, 03:07 AM
  4. Modulo of squares = modulo of roots
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: December 1st 2009, 09:04 AM
  5. Modulo 42
    Posted in the Algebra Forum
    Replies: 3
    Last Post: June 2nd 2009, 05:00 PM

Search Tags


/mathhelpforum @mathhelpforum