Michael O. Rabin 2026-11-05
Michael O. Rabin analyzed a randomized algorithm for primality testing in his 1980 paper. The Miller-Rabin primality test checks whether a candidate integer satisfies conditions obeyed by primes under modular exponentiation. A failed check certifies compositeness; passing a check gives a probable prime, not a proof of primality.[ref]
For each fixed odd composite candidate, at most one quarter of the admissible bases are strong liars. Independent uniformly chosen bases therefore reduce the probability of accepting that composite to at most after rounds. This probability is over the test's choices for a fixed input; it is not a posterior probability that an arbitrary accepted integer is prime.
Miller-Rabin primality test Created 2026-10-14 Updated 2026-11-05
For an odd integer , write with odd. Choose a base uniformly from . It passes the Miller–Rabin test whenA nontrivial greatest common divisor of or failure certifies compositeness. Exponentiation by squaring computes ; at most further squarings test the other possibilities.
Every prime number passes: arithmetic modulo a prime number is a field, whose only square roots of one are and . The squaring chain ends at one by the Fermat little theorem; its first one is either the initial value or follows minus one.
For an odd composite number, at most one quarter of bases in the stated range pass. Thus independently sampled bases give false probable-prime probability at most , for each fixed composite input. A passing composite is a strong pseudoprime to that base.[ref]
Probable prime 2026-11-05
A probable prime is an integer that passes a specified necessary test for primality without thereby receiving a proof of primality. The qualification must identify the test and bases. For example, an odd passing a Fermat test to base satisfies , but a composite can satisfy that congruence.
The Miller-Rabin primality test imposes a stronger condition on a chain of modular squares. Yet passes even that test to base 2: writing , one has . A pass therefore means “not disproved by this test”, whereas a failing witness proves compositeness. With independent uniformly sampled bases, the standard worst-case error bound decreases exponentially with the number of rounds; it is a conditional test-error bound, not automatically the posterior probability that the particular input is prime.[ref]
Probabilistic Algorithm for Testing Primality by Michael O. Rabin. §§1–2, witness test and error bound
Strong liar 2026-11-05
A strong liar for an odd composite integer is a base for which the Miller-Rabin primality test reports a pass. Write with odd. A base is a strong liar whenThe base “lies” because these conditions hold for every allowed nonzero base when is prime, but can also hold for a composite.
For , base 2 is a strong liar because and divides . For every odd composite, strong liars occupy at most a quarter of the standard base sampling space; independently sampling bases bounds all-pass error by . A fixed handpicked list needs a separate guarantee for the intended input range.[ref]
Probabilistic Algorithm for Testing Primality by Michael O. Rabin. §§1–2, strong-pseudoprime condition and quarter bound