Can i do modulus on a TI-83? How can i compute a negative modulus?

kirkulator
Messages
32
Reaction score
0
I am studying Integer Modulo in my Cryptography and Data Security class. We are dealing with mainly modulo 26 [the alphabet] right now. I understand if it is addition or multiplication you just take the remainder of the result divided by, let's say 26 in this circumstance. ie: (5+25)mod26 = 4
ie: (5*6)mod26 = 4

But I'm not quite understanding how to do mod26 when there results a negative number.
ie: the shift cipher is (x-k)mod26
which usually results in a negative because k is usually > x
so say, if i had -7mod26
how would i go about this?

Also is there any way to calculate this sort of problem on my calculator to check my work? I have a TI-83.

Thanks so much guys.
Amanda
 
Physics news on Phys.org
Not sure if this is what you mean, but hopefully this is helpful:

you can reduce any number by the modulus. If you had 123 mod 26, this is congruent to 97 which is congruent to 71 congruent to 45 congruent to 19 congruent to -7 and so on. If you want the smallest positive value, its 19 in this case.

Basically, if you have a negative value, simply add a multiple of the modulus to it until you get the smallest positive value that is less than the modulus itself.

Not sure about your calculator in particular though (so I am sorry if you already knew this and it is thus irrelevant)
 
Just to clarify, youre saying -7mod8 would be 1? [-7+8] = 1 < 8, the answer is one?
and -21mod8 would be 3 because [-21 + 24] = 3 < 8?

Thanks so much this really did help a LOT. I don't think there's a way to do mod on the calculator everywhere i look says you must program it yourself.
 
kirkulator said:
Just to clarify, youre saying -7mod8 would be 1? [-7+8] = 1 < 8, the answer is one?
and -21mod8 would be 3 because [-21 + 24] = 3 < 8?

That's correct!
 
Wow, that's extremely simple and a lot more clear than how my prof explained it. You wouldn't have an equivalently elegant way of explaining modular division [reciprocals] would you? The only way he told us how to do, say 5(-1)mod26 {where 5(-1) is representing the reciprocal of 5), is to use the euclidean algorithm, in which he didnt explain well either. If this is too exhaustive to explain, then don't worry about it! I've been trying to find some good explanations online.
 
For a Ti-83, the best you are going to get is
Code:
x fPart(y/x)
for y \!\mod x
 
great, ill take note of that function of my calculator.
 
Back
Top