Number theory

Theory Of Numbers

Shop Books Developers Feedback
Home

Modular Addition , Subtraction and Multiplication

Adding Modular Expressions

(A + B) mod C = (A mod C + B mod C) mod C

Example:
Let A=14, B=17, C=5
Let's verify: (A + B) mod C = (A mod C + B mod C) mod C
LHS = Left Hand Side of the Equation
RHS = Right Hand Side of the Equation
LHS = (A + B) mod C
LHS = (14 + 17) mod 5
LHS = 31 mod 5
LHS = 1
RHS = (A mod C + B mod C) mod C
RHS = (14 mod 5 + 17 mod 5) mod 5
RHS = (4 + 2) mod 5
RHS = 1
LHS = RHS = 1

Visualisation of Modular addition:

Mod Clock

Subtacting Modular Expressions

The same concept is used while subtracting the modular expressions.

(A - B) mod C = (A mod C - B mod C) mod C

Multiplying Modular Expressions

The same concept is used while multiplying the modular expressions.

(A * B) mod C = (A mod C * B mod C) mod C

Source : KhanAcademy.com

Mod Addition




Mod Subtraction




Mod Multiplication




References

mitocw

MIT OpenCourseWare By Prof.Andrew Sutherland