Professional Documents
Culture Documents
Wilson’s result applies to prime moduli. So like Fermat’s Little Theorem we confine
ourselves to prime modulus. For Wilson’s Theorem the result is valid both ways, that is the
result is true going forwards (necessary) and backwards (sufficient) . This is not the
case for Fermat’s Little Theorem.
Example 5
Find x in each of the following congruences:
(a) x 4! mod 5 (b) x 6! mod 7
Solution
(a) Remember 4! 1 2 3 4 24 and 24 is 1 modulo 5. Hence
x 1 mod 5
(b) Similarly we have 6 ! 1 2 3 4 5 6 720 and
x 720 6 1 mod 7
These evaluations were nice and easy but evaluating n ! for a large n will be a tedious task.
We want to find a simpler way of evaluating this n !
We can be smart about these evaluations and use the concept of multiplicative inverse as
described below.
The proof of Wilson’s Theorem relies on the multiplicative inverse in modular arithmetic.
B1 Multiplicative Inverse
Can you recall what a multiplicative inverse means?
This was Definition (4.15) on page 22 of the last chapter
If ax 1 mod n and gcd a, n 1 then the unique solution x is called the multiplicative
inverse of a modulo n.
1 1
Just like the inverse of 5 in real numbers is because 5 1 similarly the inverse of a
5 5
modulo n is the residue x such that ax 1 mod n .
Example 6
Determine x in following congruence:
x 12! mod 13
Solution
Remember
x 12! 1 2 3 4 5 6 7 8 9 10 1112 mod 13 (*)
Note that if we multiply the first and last elements on the RHS of (*) we have
1 12 12 1 mod 13
Can we carry out some simplification of the remaining numbers 2, 3, 4, 5 , 6, 7, 8 , 9, 10 and
11 on the RHS?
Chapter 5: Fermat’s Little Theorem 7
■
Chapter 5: Fermat’s Little Theorem 8
p 2 ! 1 mod p
Therefore we have required result:
p 1! p 1
p 2 ! mod p
1 mod p
p 1 1 mod p
■
Example 6
Determine x in each of the following congruences:
(a) x 16! mod 17 (b) x 11! mod 12 (c) x 9! mod 13
Solution
Chapter 5: Fermat’s Little Theorem 9
0 mod 12
(c) 13 is prime but we need to find 9! not 12! Need to use brute force to evaluate x:
x 9! mod 13
2
4 5
3 6 7 8
9 mod 13
24 2 mod 13 30 4 mod 13 72 7 mod 13
2 4 7
7 mod 13
49 3 mod 13
SUMMARY
Wilson’s Theorem
n 1! 1 mod n n is prime
Useful result for simplifying calculations involving prime modulus.