Skip to content

Linear Congruences

  • A congruence of the form:

INFO

axb(modm)

is called a linear congruence

where m is a positive integer, a and b are integers, and x is a variable

Inverse of an a modulo m theorem

Theorem 1

If gcd(a,m)=1, m > 1, then there exists an integer a such that aa1(modm). Furthermore, this inverse is unique modulo m.

  • Proof:

    • If gcd(a,m)=1, then sa+tm=1 (BÉZOUT’S THEOREM)
    • It also means, sa+tm1(modm)
    • Because tm0(modm)
    • sa1(modm)
    • s is inverse of a modulo m
  • Find the inverse of a modulo m

TIP

To find the inverse of a modulo m, we can use one of the following methods:

  • Working backward through the divisions of the Euclidean Algorithm
  • The Extended Euclidean Algorithm
  • Example
    • 5, -2, 12, -9,... is the inverse of 3 modulo 7

Solve The Linear Congruences

  • To solve the linear congruences, we first find the inverse a of a modulo m.
  • Then, we multiply both sides of the congruence by a, we get the equation:
aaxab(modm)
  • Because aa1(modm), we get the equation:
aaxx(modm)
  • Finally, we get the solution:
xab(modm)
  • Example:
    • Solve: 3x4(mod7) (1)
    • Because gcd(3,7) = 1, then we have a=5 (we choose 5 here)
    • Multiply both sides of the equation (1) by a:
      • 15x20(mod7)
    • Finally,
      • x206(mod7)

The Chinese Remainder Theorem

Theorem 2

  • Let m1, m2, ..., mn be pairwise relatively prime positive integers greater than one
  • and a1, a2, ..., an arbitrary integers. Then the system
    • xa1(modm1)
    • xa2(modm2)
    • ...
    • xan(modmn)
  • has a unique solution modulo m=m1m2...mn. (That is, there is a solution x with 0 ≤ x < m, and all other solutions are congruent modulo m to this solution.)

TIP

We can also use a method known as Back substitution

Computer Arithmetic with Large Integers

  • Based on The Chinese remainder theorem, we can uniquely represent an integer a with 0a<m by

INFO

(amodm1,amodm2,...,amodmn)
  • Example:
    • What are the pairs used to represent the nonnegative integers less than m = 12
    • we choose m1=3, m2=4,
    • 0 = (0, 0) 4 = (1, 0) 8 = (2, 0)
    • 1 = (1, 1) 5 = (2, 1) 9 = (0, 1)
    • 2 = (2, 2) 6 = (0, 2) 10 = (1, 2)
    • 3 = (0, 3) 7 = (1, 3) 11 = (2, 3)

Fermat’s Little Theorem

Theorem 3

If p is a prime number and a is an integer such that pa then

ap11(modp)

Furthermore, for every integer a we have

apa(modp)
  • Remark: Fermat’s little theorem tells us that if aZp, then ap1=1 in Zp
  • Example:
    • Find 7222(mod11)
    • 7222=722.10+2=(710)227212249(mod11)5(mod11)
    • 7222(mod11)=5

Primitive Roots and Discrete Logarithms

Def

A primitive root modulo a prime p is an integer r in Zp such that every nonzero element of Zp is a power of r.

  • Example:
    • 2 is a primitive root modulo 11, because every nonzero element of Z11 is a power of 2
    • we obtain 21=2,22=4,23=8,24=5,25=10,26=9,27=7,28=3,29=6,210=1

Def

  • Suppose that p is a prime, r is a primitive root modulo p, and a is an integer between 1 and p − 1 inclusive
  • If remodp=a and 0ep1, we say that e is the discrete logarithm of a modulo p to the base r
  • and we write logra=e
  • Example:
    • Find the discrete logarithms of 3 and 5 modulo 11 to the base 2.
    • Because 28=3 and 24=5
    • The result is 8 and 4

Built with ❤️ and curiosity