Exercise 2203Number theory › PrimesM1Added 3 Nov 2026
The Miller–Rabin test
#Miller-Rabin#primality#probabilistic
Statement
Describe the Miller–Rabin test and apply it to with base .
Hint
Write with odd. Compute , then square up to times.
Show solutionHide solution
Solution
Setup. , , so , .
Compute. . Square: . Witness for primality: we hit before squaring times.
Conclusion. passes Miller–Rabin for base .
Application. The test is used in RSA key generation; with bases, error probability for composite inputs.