Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

For: -10 mod 7

I know the answer is 4, but how do you actually get to the answer by hand?

share|improve this question
    
Add $2 \cdot 7 = 14$... and the 2 is $\lceil \frac{10}{7} \rceil$. –  vonbrand Feb 28 '13 at 19:01

4 Answers 4

up vote 6 down vote accepted

$-10\equiv -10 + 7\equiv -3\equiv -3 + 7\equiv 4\mod 7$, because adding $7$ when working $\mod 7$ does not change the congruence class of your original number. More generally, adding any integer multiple of your modulus to your original number preserves the congruence class: $$ m\equiv m + kn\mod n\quad\forall k\in\mathbb{Z} $$

share|improve this answer

$4 - (-10) = 14$, which is divisible by 7.

share|improve this answer

You can use a number line visualization.

mod 7 number line

These emphasized points are all $\equiv 0\text{ mod } 7$. You can see that -10 is 4 points to the right of $-2\times7$. It's also 3 points to the left of $-1\times7$.

Since -10 is negative, the remainder from -10/7 gets you the left-facing offset (-3 in this case). But you can then just add 7 to this to get the right-facing offset.


Mathematica source code for the number line graphic.

Graphics[
 {PointSize[.012], Point[{7*#, 0}] & /@ Range[-5, 5]},
 Axes -> {True, False}, PlotRange -> {{-15, 15}, {-1, 1}}]
share|improve this answer

Integer multiple of 7 less than or equal to -10 is -14, now how much you need to add to the -14 so that it becomes equal to -10 : -14 + 4 = -10; the term you added to make it equal to -10 is the -10 mod 7 so this way answer is 4.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.