ArticleslgStudy

computer science

Pollard's rho algorithm for logarithms

Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms rather than just read about it. In short: Pollard's rho algorithm for logarithms is an algorithm introduced by John Pollard in 1978 to solve the discrete logarithm problem, analogous to Pollard's rho algorithm to solve the integer factorization problem. The goal is to compute γ such that αγ=β, where β belongs to a cyclic group G generated by α.

Key takeaways

  • Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Pollard's rho algorithm for logarithms from memory before moving on to harder problems.

Reference excerpt

Pollard's rho algorithm for logarithms is an algorithm introduced by John Pollard in 1978 to solve the discrete logarithm problem, analogous to Pollard's rho algorithm to solve the integer factorization problem. The goal is to compute γ such that αγ=β, where β belongs to a cyclic group G generated by α. The algorithm computes integers a, b, A, and B such that αaβb=αAβB. If the underlying group is cyclic of order n, by substituting β as αγ and noting that two powers are equal if and only if the exponents are equivalent modulo the order of the base, in this case modulo n, we get that γ is one of the solutions of the equation (B−b)γ=(a−A)(modn). Solutions to this equation are easily obtained using the extended Euclidean algorithm. To find the needed a, b, A, and B the algorithm uses Floyd's cycle-finding algorithm to find a cycle in the sequence xi=αaiβbi, where the function f:xi↦xi+1 is assumed to be random-looking and thus is likely to enter into a loop of approximate length πn8 after πn8 steps. One way to define such a function is to use the following rules: Partition G into three disjoint subsets S0, S1, and S2 of approximately equal size using a hash function. If xi is in S0 then double both a and b; if xi∈S1 then increment a, if xi∈S2 then increment b.

Algorithm Let G be a cyclic group of order n, and given α,β∈G, and a partition G=S0∪S1∪S2, let f:G→G be the map

f(x)={βxx∈S0x2x∈S1αxx∈S2. If this map is applied to x=αaβb∈G, then we can define maps g:G×ℤ→ℤ and h:G×ℤ→ℤ to track the indices of α and β of the result. These maps would be given by

g(x,k)={kx∈S02k(modn)x∈S1k+1(modn)x∈S2,andh(x,k)={k+1(modn)x∈S02k(modn)x∈S1kx∈S2. input: a: a generator of G b: an element of G output: An integer x such that ax = b, or failure

Initialise i ← 0, a0 ← 0, b0 ← 0, x0 ← 1 ∈ G

loop i ← i + 1

xi ← f(xi−1), ai ← g(xi−1, ai−1), bi ← h(xi−1, bi−1)

x2i−1 ← f(x2i−2), a2i−1 ← g(x2i−2, a2i−2), b2i−1 ← h(x2i−2, b2i−2) x2i ← f(x2i−1), a2i ← g(x2i−1, a2i−1), b2i ← h(x2i−1, b2i−1) while xi ≠ x2i

r ← bi − b2i if r = 0 return failure return r−1(a2i − ai) mod n

Example Consider, for example, the group generated by 2 modulo N=1019 (the order of the group is n=1018, 2 generates the group of units modulo 1019). The algorithm is implemented by the following C++ program:

The results are as follows (edited):

i x a b x' a' b' ------------------------------ 1 2 1 0 10 1 1 2 10 1 1 100 2 2 3 20 2 1 1000 3 3 4 100 2 2 425 8 6 5 200 3 2 436 16 14 6 1000 3 3 284 17 15 7 981 4 3 986 17 17 8 425 8 6 194 17 19 .............................. 48 224 680 376 86 299 412 49 101 680 377 860 300 413 50 505 680 378 101 300 415 51 1010 681 378 1010 301 416

That is 26815378=1010=23015416(mod1019) and so (416−378)γ=681−301(mod1018), for which γ1=10 is a solution as expected. As n=1018 is not prime, there is another solution γ2=519, for which 2519=1014=−5(mod1019) holds.

Complexity The running time is approximately 𝒪(n). If used together with the Pohlig–Hellman algorithm, the running time of the combined algorithm is 𝒪(p), where p is the largest prime factor of n.

References

Pollard, J. M. (1978). "Monte Carlo methods for index computation (mod p)". Mathematics of Computation. 32 (143): 918–924. doi:10.2307/2006496. JSTOR 2006496. Menezes, Alfred J.; van Oorschot, Paul C.; Vanstone, Scott A. (2001). "Chapter 3" (PDF). Handbook of Applied Cryptography.

Worked examples

Example 1 — a first encounter with Pollard's rho algorithm for logarithms

Start with the simplest possible case. Write down what Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms

In research
Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms 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
Pollard's rho algorithm for logarithms is common in secondary-school and first-year university syllabi. It links to neighbouring topics Logarithms, Number theoretic algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Pollard's rho algorithm for logarithms 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 “Pollard's rho algorithm for logarithms” →

How to study Pollard's rho algorithm for logarithms in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Pollard's rho algorithm for logarithms in simple terms?

Pollard's rho algorithm for logarithms is an algorithm introduced by John Pollard in 1978 to solve the discrete logarithm problem, analogous to Pollard's rho algorithm to solve the integer factorization problem. The goal is to compute γ such that αγ=β, where β belongs to a cyclic group G generated…

Why does Pollard's rho algorithm for logarithms 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 Pollard's rho algorithm for logarithms?

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 Pollard's rho algorithm for logarithms.

Tags

  • Logarithms
  • Number theoretic algorithms

Keep exploring