Wednesday, March 22, 2017

Cryptography: Number Theory - Modular Arithmetic

Coursera AH Purple Design 2 Coursera General Design 2 Green Coursera Data Science
Modular Arithmetic 
Given any integer a and a positive integer n, and given a division of a by n that leaves the remainder between 0 and n − 1, both inclusive, we define

  a mod n    to be the remainder.



Note that the remainder must be between 0 and n − 1, both ends inclusive, even if that means that we must use a negative quotient when dividing a by n. 
Modular Arithmetic - Exponentation 

To find 117 mod 13, we can proceed as follows:
112 = 121 º 4 (mod13)
11
4 = (112)2 º 42 º 3 (mod13)
11
7 º 11*4*3 º132 º 2(mod13)
 


Step forward in 2017: Build in-demand career skills with Coursera Start your future with a Data Analysis Certificate.

Properties of Modular Arithmetic

Modulo n arithmetic maps all integers into the set {0, 1, 2, 3, ...., n − 1} 

1.[(a mod n) + (b mod n)] mod n = (a + b) mod n
2.[(a mod n) - (b mod n)] mod n = (a - b) mod n
3.[(a mod n) * (b mod n)] mod n = (a * b) mod n
Proof 1:
Define (a mod n) = ra and (b mod n) = rb.
Then we can write a = ra + jn for some integer j and b = rb + kn for some integer k. Then
(a+b) mod n = (ra + jn + rb + kn) mod n
(ra + rb + (k+j) n) mod n
(ra + rb)mod n
[(a mod n) + (b mod n)] mod
 
Robotics Specialization from University of Pennsylvania Big Data Specialization from UC San Diego Python Specialization from University of Michigan

No comments:

Post a Comment