Wilson’s Theorem
p is prime iff (p−1)! ≡ −1 mod p.
Key idea
p is prime iff (p−1)! ≡ −1 mod p.
In depth
For a prime p, (p − 1)! ≡ −1 (mod p), and the converse holds as well. It gives a primality test, though too slow to be practical.
Worked example
p = 5: 4! = 24 ≡ −1 (mod 5), since 24 + 1 = 25.
Real-world uses
- A theoretical test for primes used in number theory and olympiad problems
Common mistake
Thinking it is a practical primality test.
How to learn this
- Read the key idea and say it in your own words.
- Work through the worked example, then try a similar problem.
- Use the interactive lesson’s visual and mini-quiz to check the pattern.
Frequently asked questions
What is Wilson’s Theorem?
p is prime iff (p−1)! ≡ −1 mod p. It is a topic at the expert level in Discrete Math & Number Theory.
Where is Wilson’s Theorem used in real life?
Real-world examples: A theoretical test for primes used in number theory and olympiad problems.
What should I learn before Wilson’s Theorem?
Make sure you are comfortable with Euler’s Theorem, the previous topic in Discrete Math & Number Theory.
What is a common mistake with Wilson’s Theorem?
Thinking it is a practical primality test.
How can I practise Wilson’s Theorem?
Open the interactive lesson, play with the visual, then answer the three-question mini-quiz. Getting two right marks the topic complete.
What comes after Wilson’s Theorem?
Move on to Quadratic Residues next.
Related expert topics in Discrete Math & Number Theory
- Strong Induction – Assume all earlier cases to prove the next.
- Well-Ordering Principle – Every nonempty set of positive integers has a least element.
- Partial Orders – Reflexive, antisymmetric, transitive relations.
- Cardinality of Sets – Comparing sizes of infinite sets.
- Countable and Uncountable Sets – ℕ and ℚ are countable; ℝ is not.
- Cantor’s Diagonal Argument – Proof that real numbers are uncountable.