Modular Arithmetic Practice Sheet
(Click here for answer sheet)
Solve the following for x
- 10 = x mod 4
- 10 = x mod 3
- 10 = x mod 7
- 23 = x mod 11
- 7 = x mod 7
- 29 = x mod 7
- 3 = x mod 7
- 14 = x mod 10
- x + 3 = 4 mod 7
- x + 8 = 6 mod 11
- x + 9 = 2 mod 10
- x - 3 = 1 mod 7
- x - 6 = 1 mod 7
- x + 3 = 3 mod 5
- x - 3 = 1 mod 5
- x + 4 = 6 mod 8
You may wish to review the examples at the bottom of this page before attempting the remaining problems.
- 2x = 1 mod 5
- 2x + 1 = 4 mod 5
- 3x - 1 = 2 mod 5
- 4x + 3 = 2 mod 7
- 3x + 5 = 6 mod 7
- 2x - 3 = 6 mod 7
- 2x + 1 = 2 mod 3
- 3x + 4 = 1 mod 7
Solution of Linear Algebraic Equations in Modular Arithmetic
Solving linear algebraic equations in a modulo arithmetic system is nearly identical to solving algebraic equations using ordinary arithmetic.
- We first must gather our x terms together on one side of the equation by addition or subtraction of x terms.
- Next, we combine all constant terms together on the other side of the equation by adding and subtracting.
- Finally, if x is multiplied by a constant we must multiply both sides of the equation by the inverse of that constant.
A simple example:
2x + 3 = 4 mod 5
In this example, we have only one x term so step 1. is already completed.
Next, we add the additive inverse of 3 mod 5 (that is 2) to both sides of the equation yielding
2x + 3 + 2 = 4 + 2 (mod 5)
2x + 0 = 6 mod 5
2x = 1 mod 5
Finally, we multiply both sides of the equation by the mutiplicative inverse of 2 mod 5 (that is 3)
3*2x = 3 mod 5
6x = 3 mod 5
x = 3 mod 5 (since 6 = 1 mod 5)
We now check our answer by substituting 3 for x in the original equation, yielding
2*3 + 3 = 4 mod 5
6 + 3 = 4 mod 5
9 = 4 mod 5
Another example
2x - 6 = 2 - x mod 7
x + 2x - 6 = 2 - x + x mod 7 (add x to both sides of the equation)
3x - 6 = 2 mod 7
3x - 6 + 6 = 2 + 6 mod 7 (add 6 to both sides of the equation)
3x = 8 mod 7
5*3x = 5*8 mod 7
(multiply both sides by the multiplicative inverse of the coefficient of x)
15x = 40 mod 7
x = 5 mod 7
check our answer by substituting 5 for x in the original equation, yielding
2*5 - 6 = 2 - 5 mod 7
10 - 6 = -3 mod 7
4 = -3 mod 7
Thus x = 5 is the correct answer since -3 does, in fact, = 4 mod 7