Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Negative modulo question

  1. Jul 14, 2012 #1
    Can someone please explain why 80 mod (-11) is -8…? Why isn’t it 3?

    b = aq + r
    80 = (-11)q + r
    80 = (-11)(-7) + 3
    Thus 80 mod (-11) = 3..
     
  2. jcsd
  3. Jul 14, 2012 #2
    Your calculation is correct.

    -8 and 3 are equivalent mod -11. Both answers are right.
     
  4. Jul 15, 2012 #3

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Yes, they are the same, but typically a mathematical function with multiple 'valid' values is assigned a standard value by convention. Thus, the √ function is defined to be the non-negative root; arcsin etc. also have standard ranges.
    In number theory, the non-negative value is taken for the mod function regardless of the signs of the arguments. Programming languages are annoyingly inconsistent. See http://en.wikipedia.org/wiki/Modulo_operation#Remainder_calculation_for_the_modulo_operation.
     
  5. Jul 15, 2012 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    There are a number of different ways of thinking about "modulo". The most fundamental uses "equivalence" classes. -8 and 3 are in the same equivalence class "modulo 11" because -8= (-1)11+ 3 or, alternatively, 3+ 8= 11= 0 (mod 11) so that 3 is the additive inverse of 8: -8= 3 (mod 11).

    It is a common convention to use the smallest positive number in an equivalence class to "represent" the class but any number in the class can be used. Sometimes it is convenient to use "-8" rather than "3" just as sometimes it is convenient to use 2/4 rather than 1/2.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Negative modulo question
  1. Integers Modulo (Replies: 2)

  2. Congruent Modulo (Replies: 1)

  3. Modulo groups (Replies: 7)

Loading...