PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: No information on entry rating
[parent] Pollard's $\rho$ algorithm (Algorithm)

Pollard's $\rho$ algorithm is an integer factorization algorithm devised by John Pollard in 1975 to take advantage of Floyd's cycle-finding algorithm and pseudorandom number generation. Theoretically, trial division always returns a result (though of course in practice the computing engine's resources could be exhausted or the user might not to be around to care for the result). Pollard's $\rho$ algorithm, on the other hand, was designed from the outset to cope with the possibility of failure to return a result.

It can be left up to the implementer to choose a function $f(x)$ with a finite set of values that can be guaranteed to become cyclic quickly enough after few iterations. Crandall and Pomerance recommend $f(x) = x^2 + a \mod n$ , where $n$ is the number to be factored and $a$ is a pseudorandom number chosen based on $n$ .

Choose a function $f(x)$ per the given requirements and call Pollard's $\rho$ algorithm with $n$ a positive integer.

  1. Choose random $a$ and $b$ from the ranges $1 < a < (n - 3)$ and $0 < b < (n - 1)$ and set $c = a$ and $d = b$ .
  2. Set $g = 1$ .
  3. While $g == 1$ and allowed number of iterations not exceeded, iterate $c = f(c)$ once and $d = f(d)$ twice and compute $g = GCD(c - d, n)$ . The implementer may choose to take the absolute value of $c - d$ , though some implementations of GCD don't mind being given negative arguments.
  4. If $g > 1$ , it is a factor of $n$ . Otherwise, the algorithm has failed.

Take for example, $n = 42$ . Suppose our dice give us $a = 12$ and $b = 37$ . I promise I didn't choose these values consciously, but it happens that 37 does not change when input to $f(x) = x^2 + 12 \mod 42$ ! 12 will change however, giving a sequence that continues 0, 20, 13. At 13, we find that $37 - 13 = 24$ , and computing $GCD(24, 42)$ gives up 6, which is not a prime, but is easily enough taken care of by trial division. The factorization is therefore $42 = 2 \cdot 3 \cdot 7$ .

To date, the most well-known success of this algorithm was when Pollard and Richard Brent factored 115792089237316195423570985008687907853269984665640564039457584007913129639937 (the eighth Fermat number) in less than two hours, which was an impressive feat in 1975 for a UNIVAC 1100/42. Today, Mathematica running on a Dell with Windows XP factors that number in about 12 seconds (Mathematica's FactorInteger function has always used Pollard's $\rho$ algorithm as one of the algorithms it uses).




"Pollard's $\rho$ algorithm" is owned by PrimeFan.
(view preamble | get metadata)

View style:

Other names:  Pollard $\rho$ algorithm, Pollard's rho algorithm, Pollard rho algorithm

This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: running, Mathematica, Fermat number, prime, sequence, factor, arguments, negative, gcd, absolute value, ranges, integer, positive, number, iterations, cyclic, finite set, function, trial division, pseudorandom number, John Pollard, integer factorization, algorithm

This is version 2 of Pollard's $\rho$ algorithm, born on 2007-02-23, modified 2007-02-25.
Object id is 8962, canonical name is PollardsRhoAlgorithm.
Accessed 2834 times total.

Classification:
AMS MSC11A41 (Number theory :: Elementary number theory :: Primes)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy
Pollard's rho in Mathematica by DanielKO on 2007-08-01 04:55:22
Mathematica may be able to quickly factor F8, but it doesn't do it by Pollard's Rho algorithm. It uses ECM (ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.html).
[ reply | up ]

Interact
post | correct | update request | add example | add (any)