ArticleslgStudy

computer science

Solovay–Strassen primality test

Solovay–Strassen primality test is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Solovay–Strassen primality test rather than just read about it. In short: The Solovay–Strassen primality test, developed by Robert M. Solovay and Volker Strassen in 1977, is a probabilistic primality test to determine if a number is composite or probably prime.

Key takeaways

  • Solovay–Strassen primality test belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Solovay–Strassen primality test to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Solovay–Strassen primality test from memory before moving on to harder problems.

Reference excerpt

The Solovay–Strassen primality test, developed by Robert M. Solovay and Volker Strassen in 1977, is a probabilistic primality test to determine if a number is composite or probably prime. The idea behind the test was discovered by M. M. Artjuhov in 1967 (see Theorem E in the paper). This test has been largely superseded by the Baillie–PSW primality test and the Miller–Rabin primality test, but has great historical importance in showing the practical feasibility of the RSA cryptosystem.

Concepts Euler proved that for any odd prime number p and any integer a,

a ( p − 1 ) / 2 ≡ ( a p ) ( mod p ) {\displaystyle a^{(p-1)/2}\equiv \left({\frac {a}{p}}\right){\pmod {p}}}

where ( a p ) {\displaystyle \left({\tfrac {a}{p}}\right)} is the Legendre symbol. The Jacobi symbol is a generalisation of the Legendre symbol to ( a n ) {\displaystyle \left({\tfrac {a}{n}}\right)} , where n can be any odd integer. The Jacobi symbol can be computed in time O((log n)²) using Jacobi's generalization of the law of quadratic reciprocity. Given an odd number n one can contemplate whether or not the congruence

a ( n − 1 ) / 2 ≡ ( a n ) ( mod n ) {\displaystyle a^{(n-1)/2}\equiv \left({\frac {a}{n}}\right){\pmod {n}}}

holds for various values of the "base" a, given that a is relatively prime to n. If n is prime then this congruence is true for all a. So if we pick values of a at random and test the congruence, then as soon as we find an a which doesn't fit the congruence we know that n is not prime (but this does not tell us a nontrivial factorization of n). This base a is called an Euler witness for n; it is a witness for the compositeness of n. The base a is called an Euler liar for n if the congruence is true while n is composite. For every composite odd n, at least half of all bases

a ∈ ( Z / n Z ) ∗ {\displaystyle a\in (\mathbb {Z} /n\mathbb {Z} )^{*}}

are (Euler) witnesses as the set of Euler liars is a proper subgroup of ( Z / n Z ) ∗ {\displaystyle (\mathbb {Z} /n\mathbb {Z} )^{*}} . For example, for n = 65 {\displaystyle n=65} , the set of Euler liars has order 8 and = { 1 , 8 , 14 , 18 , 47 , 51 , 57 , 64 } {\displaystyle =\{1,8,14,18,47,51,57,64\}} , and ( Z / n Z ) ∗ {\displaystyle (\mathbb {Z} /n\mathbb {Z} )^{*}} has order 48. This contrasts with the Fermat primality test, for which the proportion of witnesses may be much smaller. Therefore, there are no (odd) composite n without many witnesses, unlike the case of Carmichael numbers for Fermat's test.

Example Suppose we wish to determine if n = 221 is prime. We write (n−1)/2=110. We randomly select an a (greater than 1 and smaller than n): 47. Using an efficient method for raising a number to a power (mod n) such as binary exponentiation, we compute:

a(n−1)/2 mod n = 47110 mod 221 = −1 mod 221

( a n ) mod n = ( 47 221 ) mod 2 21 = − 1 mod 2 21 {\displaystyle \left({\tfrac {a}{n}}\right){\bmod {n}}=\left({\tfrac {47}{221}}\right){\bmod {2}}21=-1{\bmod {2}}21}

This gives that, either 221 is prime, or 47 is an Euler liar for 221. We try another random a, this time choosing a = 2:

a(n−1)/2 mod n = 2110 mod 221 = 30 mod 221

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Solovay–Strassen primality test

Start with the simplest possible case. Write down what Solovay–Strassen primality test claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Solovay–Strassen primality test before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Solovay–Strassen primality test ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Solovay–Strassen primality test

In research
Solovay–Strassen primality test appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Solovay–Strassen primality test in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Solovay–Strassen primality test is common in secondary-school and first-year university syllabi. It links to neighbouring topics Modular arithmetic, Primality tests, Randomized algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Solovay–Strassen primality test outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Solovay–Strassen primality test” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Solovay–Strassen primality test in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Solovay–Strassen primality test means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Solovay–Strassen primality test out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Solovay–Strassen primality test in simple terms?

The Solovay–Strassen primality test, developed by Robert M. Solovay and Volker Strassen in 1977, is a probabilistic primality test to determine if a number is composite or probably prime.

Why does Solovay–Strassen primality test matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Solovay–Strassen primality test?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Solovay–Strassen primality test.

Tags

  • Modular arithmetic
  • Primality tests
  • Randomized algorithms

Keep exploring