Why is -101 mod 13 = 3 and not 10

  • Thread starter Superdemongob
  • Start date
In summary, the remainder of -101 divided by 13 is 3. This is because when doing long division, -101 divided by 13 results in a quotient of -8 and a remainder of 3, following the convention of rounding down towards -∞. This is also demonstrated by considering a 13 hour clock, where -101 hours is equivalent to 3 hours.
  • #1
Superdemongob
8
0
This is a very basic question that I am having some difficulty grasping.

When I do the long division for -101 / 13, my first step is -7 which comes out to -91 and so I have left -10.

Shouldn't this be where the calculation stops?

One of the thoughts I had was that as -13 is smaller than -10, I should go one step further and subtract -13 from -10 to get +3. and that's why the mod is 3.

If that is correct, could someone please explain why?
If that is incorrect, could someone please explain how we get 3 instead of 10?

Thanks for any help.
 
Mathematics news on Phys.org
  • #2
So you have that [itex] -101\equiv -10 ~\mbox{mod} ~13 [/itex]

So [itex] -10 = 13 (-1) + 3 [/itex], right ?
 
  • #3
EDIT: I totally just got it. Thank you so much for your prompt response.

Sorry, i know that I'm being really thick on this and once i see it i'll kick myself but 1 follow up question if you don't mind.

is the reason you know that [itex] -101\equiv -10 ~\mbox{mod} ~13 [/itex] because you know that the remainder will be the same?
 
Last edited:
  • #4
Superdemongob said:
is the reason you know that [itex] -101\equiv -10 ~\mbox{mod} ~13 [/itex] because you know that the remainder will be the same?
Not sure what you mean by the question, but -101 + 13*7 = -10, so they must be the same mod 13 (and mod 7).
Btw, there are programming languages that get modulo of negative numbers 'wrong' (from a mathematician's perspective). Very annoying.
 
  • #5
Superdemongob said:
When I do the long division for -101 / 13, my first step is -7 which comes out to -91 and so I have left -10.
The normal convention for modulo is that the sign of the result is the same as the sign of the divisor. This means that the range of modulo 13 is limited to the set of 13 numbers {0, 1, 2, ... , 10, 11, 12}, none of them negative.

To continue with this line of thinking, then -101 / 13: results in a quotient of -8 with a remainder of +3.

Similary, the range of modulo -13 is (-12, -11, -10, ... -2, -1, 0}, so 101 / (-13) results in a quotient of -8 and remainder -3.

So using this model, quotients are always rounded down towards -∞, instead of towards zero. Older computers with signed non-restoring divide algorithm performed division in this manner, but I'm not aware of any current computers that do this. The computer language APL, implements modulo as described above.

One advantage of using this convention is that it's is origin independent, let a, b c, n, and q be integers:

if a mod b = c, then (a ± n b) b mod = c

if a / b = q, then (a ± n b) / b = q ± n

This wouldn't hold true if quotients didnt round down towards -∞, and c was not restricted to have the same sign as b (or be equal to zero).
 
Last edited:
  • #6
dextercioby said:
So you have that [itex] -101\equiv -10 ~\mbox{mod} ~13 [/itex]

So [itex] -10 = 13 (-1) + 3 [/itex], right ?

Suppose you had a 13 hour clock, labeled 0 to 12. Start at 0 and go counterclockwise 104
hours (since you went counterclockise, that's -104 hours. Youl'll find
yourself ack at 0 (since 104/13=8). But wait, we
went too far, so go clockwise 3 hours and we'll see that the clock
reads 3 for -101 hours.
 

Why is -101 mod 13 = 3 and not 10?

This question is asking about the remainder when the number -101 is divided by 13. The answer is that -101 can be written as -8*13 + 3, meaning that the remainder is 3. This is because -8 is the quotient when -101 is divided by 13, and the remainder is the difference between -101 and -8*13.

How is modular arithmetic used to solve this equation?

Modular arithmetic is used to find the remainder when a number is divided by another number. In this case, the equation -101 mod 13 = 3 means that the number -101 is congruent (equivalent) to 3 modulo 13. This means that -101 can be written as 3 plus some multiple of 13.

Why is the remainder never negative?

The remainder in modular arithmetic is always a non-negative number. This is because the remainder is the difference between the number being divided and the closest multiple of the divisor. In this case, -101 is closer to 3 than it is to 16 (which is a multiple of 13), so the remainder is 3 and not -10.

Can any number be used as the modulus?

Yes, any positive integer can be used as the modulus in modular arithmetic. However, certain numbers may have more interesting properties and patterns when used as the modulus, such as prime numbers.

How is modular arithmetic used in real-world applications?

Modular arithmetic has many real-world applications, such as in computer science, cryptography, and music theory. It is also used in calculating time and dates, as well as in geometry and number theory.

Similar threads

Replies
4
Views
215
Replies
2
Views
984
Replies
5
Views
2K
Replies
2
Views
1K
Replies
4
Views
660
Replies
6
Views
1K
Replies
1
Views
2K
Replies
10
Views
3K
  • Introductory Physics Homework Help
Replies
2
Views
796
Replies
4
Views
2K
Back
Top