Pollard's rho algorithm

Pollard's rho algorithm is an algorithm for integer factorization. It was invented by John Pollard in 1975.[1] It uses only a small amount of space, and its expected running time is proportional to the square root of the smallest prime factor of the composite number being factorized.

Core ideas

The algorithm is used to factorize a number , where is a non-trivial factor. A polynomial modulo , called (e.g., ), is used to generate a pseudorandom sequence. It is important to note that must be a polynomial. A starting value, say 2, is chosen, and the sequence continues as , , , etc. The sequence is related to another sequence . Since is not known beforehand, this sequence cannot be explicitly computed in the algorithm. Yet in it lies the core idea of the algorithm.

Because the number of possible values for these sequences is finite, both the sequence, which is mod , and sequence will eventually repeat, even though these values are unknown. If the sequences were to behave like random numbers, the birthday paradox implies that the number of before a repetition occurs would be expected to be , where is the number of possible values. So the sequence will likely repeat much earlier than the sequence . When one has found a such that but , the number is a multiple of , so a non-trivial divisor has been found.[2]

Once a sequence has a repeated value, the sequence will cycle, because each value depends only on the one before it. This structure of eventual cycling gives rise to the name "rho algorithm", owing to similarity to the shape of the Greek letter ρ when the values , , etc. are represented as nodes in a directed graph.

Cycle diagram resembling the Greek letter ρ

This is detected by Floyd's cycle-finding algorithm: two nodes and (i.e., and ) are kept. In each step, one moves to the next node in the sequence and the other moves forward by two nodes. After that, it is checked whether . If it is not 1, then this implies that there is a repetition in the sequence (i.e. . This works because if the is the same as , the difference between and is necessarily a multiple of . Although this always happens eventually, the resulting greatest common divisor (GCD) is a divisor of other than 1. This may be itself, since the two sequences might repeat at the same time. In this (uncommon) case the algorithm fails, and can be repeated with a different parameter.

Algorithm

The algorithm takes as its inputs n, the integer to be factored; and , a polynomial in x computed modulo n. In the original algorithm, , but nowadays it is more common to use . The output is either a non-trivial factor of n, or failure.

It performs the following steps:[2]

Pseudocode for Pollard's rho algorithm

    x ← 2 // starting value
    y ← x
    d ← 1

    while d = 1:
        x ← g(x)
        y ← g(g(y))
        d ← gcd(|x - y|, n)

    if d = n: 
        return failure
    else:
        return d

Here x and y corresponds to and in the previous section. Note that this algorithm may fail to find a nontrivial factor even when n is composite. In that case, the method can be tried again, using a starting value of x other than 2 () or a different , , with .

Example factorization

Let and .

Pollard's rho algorithm example factorization for and , with starting value 2. The example is using Floyd's cycle-finding algorithm.
i x y gcd(|xy|, 8051)
1 5 26 1
2 26 7474 1
3 677 871 97
4 7474 1481 1

Now 97 is a non-trivial factor of 8051. Starting values other than x = y = 2 may give the cofactor (83) instead of 97. One extra iteration is shown above to make it clear that y moves twice as fast as x. Note that even after a repetition, the GCD can return to 1.

Variants

In 1980, Richard Brent published a faster variant of the rho algorithm. He used the same core ideas as Pollard but a different method of cycle detection, replacing Floyd's cycle-finding algorithm with the related Brent's cycle finding method.[3] CLRS gives a heuristic analysis and failure conditions (the trivial divisor is found).[2]

A further improvement was made by Pollard and Brent. They observed that if , then also for any positive integer . In particular, instead of computing at every step, it suffices to define as the product of 100 consecutive terms modulo , and then compute a single . A major speed up results as 100 gcd steps are replaced with 99 multiplications modulo and a single gcd. Occasionally it may cause the algorithm to fail by introducing a repeated factor, for instance when is a square. But it then suffices to go back to the previous gcd term, where , and use the regular ρ algorithm from there.[note 1]

Application

The algorithm is very fast for numbers with small factors, but slower in cases where all factors are large. The ρ algorithm's most remarkable success was the 1980 factorization of the Fermat number F8 = 1238926361552897 × 93461639715357977769163558199606896584051237541638188580280321.[4] The ρ algorithm was a good choice for F8 because the prime factor p = 1238926361552897 is much smaller than the other factor. The factorization took 2 hours on a UNIVAC 1100/42.[4]

Example: factoring n = 10403 = 101 · 103

The following table shows numbers produced by the algorithm, starting with and using the polynomial . The third and fourth columns of the table contain additional information not known by the algorithm. They are included to show how the algorithm works.

step
2 2 2 2 0
5 2 5 2 1
26 2 26 2 2
677 26 71 26 3
598 26 93 26 4
3903 26 65 26 5
3418 26 85 26 6
156 3418 55 85 7
3531 3418 97 85 8
5168 3418 17 85 9
3724 3418 88 85 10
978 3418 69 85 11
9812 3418 15 85 12
5983 3418 24 85 13
9970 3418 72 85 14
236 9970 34 72 15
3682 9970 46 72 16
2016 9970 97 72 17
7087 9970 17 72 18
10289 9970 88 72 19
2594 9970 69 72 20
8499 9970 15 72 21
4973 9970 24 72 22
2799 9970 72 72 23

The first repetition modulo 101 is 97 which occurs in step 17. The repetition is not detected until step 23, when . This causes to be , and a factor is found.

Complexity

If the pseudorandom number occurring in the Pollard ρ algorithm were an actual random number, it would follow that success would be achieved half the time, by the birthday paradox in iterations. It is believed that the same analysis applies as well to the actual rho algorithm, but this is a heuristic claim, and rigorous analysis of the algorithm remains open.[5]

See also

Notes

  1. ^ Exercise 31.9-4 in CLRS

References

  1. ^ Pollard, J. M. (1975). "A Monte Carlo method for factorization" (PDF). BIT Numerical Mathematics. 15 (3): 331–334. doi:10.1007/bf01933667. S2CID 122775546.
  2. ^ a b c Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L. & Stein, Clifford (2009). "Section 31.9: Integer factorization". Introduction to Algorithms (third ed.). Cambridge, MA: MIT Press. pp. 975–980. ISBN 978-0-262-03384-8. (this section discusses only Pollard's rho algorithm).
  3. ^ Brent, Richard P. (1980). "An Improved Monte Carlo Factorization Algorithm". BIT. 20 (2): 176–184. doi:10.1007/BF01933190. S2CID 17181286.
  4. ^ a b Brent, R.P.; Pollard, J. M. (1981). "Factorization of the Eighth Fermat Number". Mathematics of Computation. 36 (154): 627–630. doi:10.2307/2007666. JSTOR 2007666.
  5. ^ Galbraith, Steven D. (2012). "14.2.5 Towards a rigorous analysis of Pollard rho". Mathematics of Public Key Cryptography. Cambridge University Press. pp. 272–273. ISBN 9781107013926..

Further reading

Read other articles:

American Airlines Flight 11Jalur penerbangan AA 11 dari Boston ke New York CityRingkasan pembajakanTanggal11 September 2001RingkasanPembajakan bunuh diriLokasiWorld Trade CenterPenumpang81 (termasuk 5 pembajak)Awak11TewasSeluruh 92 orang di pesawat, dan sekitar 1.600 orang (termasuk pelompat dan pekerja darurat) di Menara Utara World Trade Center.Selamat0Jenis pesawatBoeing 767-223EROperatorAmerican AirlinesRegistrasiN334AAAsalBandar Udara Internasional LoganTujuanBandar Udara Internasio...

 

 

مقاطعة أودوبون     الإحداثيات 41°41′05″N 94°54′29″W / 41.684722222222°N 94.908055555556°W / 41.684722222222; -94.908055555556  [1] تاريخ التأسيس 1851  سبب التسمية جون جيمس أودوبون  تقسيم إداري  البلد الولايات المتحدة[2]  التقسيم الأعلى آيوا  العاصمة أودوبون  التقسيمات �...

 

 

Anthony Šerić Informasi pribadiTanggal lahir 15 Januari 1979 (umur 45)Tempat lahir Sydney, AustraliaTinggi 1,81 m (5 ft 11+1⁄2 in)Posisi bermain BekInformasi klubKlub saat ini KarabüksporNomor 20Karier junior AIS CanberraKarier senior*Tahun Tim Tampil (Gol)1997–1999 Hajduk Split 33 (0)1999–2001 Parma 0 (0)1999–2001 → Verona (pinjam) 22 (1)2001–2005 Verona 25 (0)2002–2003 → Brescia (pinjam) 30 (1)2003–2004 → Parma (pinjam) 17 (0)2004–2005 → L...

United States Navy SEALsLambang Special Warfare atau SEAL Trident.Aktif1 Januari 1962 – sekarangNegara Amerika SerikatCabang Angkatan Laut Amerika SerikatTipe unitPasukan operasi khususSEa, Air, LandPeranTugas utama: Aksi langsung Pengintaian khusus Pertahanan internal asing Penanggulangan terorisme Perang tidak konvensional Peran lain: Operasi anti-narkoba Pemulihan personel Pengintaian hidrografi Bagian dari Komando Perang Khusus Angkatan Laut Amerika Serikat Komando Operasi Khusus A...

 

 

Louis-Marie de La Révellière-LépeauxPotret karya Gerard van Spaendonck pada sekitar tahun 1797 Informasi pribadiLahir(1753-08-24)24 Agustus 1753Montaigu, VendéeMeninggal24 Maret 1824(1824-03-24) (umur 70)MakamPemakaman Père LachaiseKebangsaanPrancisPekerjaanPengacaraDikenal karenaKonvensi Nasional; Direktori PrancisSunting kotak info • L • B Louis Marie de La Révellière-Lépeaux (24 Agustus 1753 – 24 Maret 1824) adalah seorang deputi untuk Konvensi Na...

 

 

National Olympic Committee Guatemalan Olympic CommitteeCountry/Region GuatemalaCodeGUACreated1947Recognized1947ContinentalAssociationPASOHeadquartersGuatemala City, GuatemalaPresidentGerardo Rene Aguirre OestmannSecretary GeneralJuan Carlos Sagastume BendañaWebsitewww.cog.org.gt The Guatemalan Olympic Committee (Spanish: Comité Olímpico Guatemalteco, abbreviated as COG) is a non-profit organization serving as the National Olympic Committee of Guatemala and a part of the International ...

Celestial diagram in ancient Egyptian tomb Top and bottom portions[1] Astronomical ceiling decoration in its earliest form can be traced to the Tomb of Senenmut (Theban tomb no. 353), located at the site of Deir el-Bahri, discovered in Thebes, Upper Egypt. The tomb and the ceiling decorations date back to the XVIII Dynasty of ancient Egypt (circa 1479–1458 BCE). It is closed to the public.[2] Discovery The tomb of Senemut was discovered during the 1925–1927 excavations dir...

 

 

Годы 1712 · 1713 · 1714 · 1715 — 1716 — 1717 · 1718 · 1719 · 1720 Десятилетия 1690-е · 1700-е — 1710-е — 1720-е · 1730-е Века XVII век — XVIII век — XIX век 2-е тысячелетие XVI век XVII век XVIII век XIX век XX век 1690-е 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700-е 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710-е 1710 1711 1712 1713 1714 1715 17...

 

 

2016年美國總統選舉 ← 2012 2016年11月8日 2020 → 538個選舉人團席位獲勝需270票民意調查投票率55.7%[1][2] ▲ 0.8 %   获提名人 唐納·川普 希拉莉·克林頓 政党 共和黨 民主党 家鄉州 紐約州 紐約州 竞选搭档 迈克·彭斯 蒂姆·凱恩 选举人票 304[3][4][註 1] 227[5] 胜出州/省 30 + 緬-2 20 + DC 民選得票 62,984,828[6] 65,853,514[6]...

This article contains Thai text. Without proper rendering support, you may see question marks, boxes, or other symbols instead of Thai script. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Traditional Thai musical instruments – news · newspapers · books · scholar · JSTOR (March 2021) (Learn how and wh...

 

 

منتخب لاتفيا لهوكي الجليد للناشئين البلد لاتفيا  رمز IIHF LAT مشاركة دولية  لاتفيا 47 – 1 اليونان  (ريغا، لاتفيا؛ 10 نوفمبر 1992) أكبر فوز  لاتفيا 47 – 1 اليونان  (ريغا، لاتفيا؛ 10 نوفمبر 1992) أكبر هزيمة  كندا 16 – 0 لاتفيا  (ساسكاتون، ساسكاتشوان، كندا؛ 26 ديسمبر 2009) بطولة...

 

 

الضحاك بن مزاحم معلومات شخصية الميلاد القرن 7  ولاية بلخ  الوفاة 102 هـ أو 105 هـ أو 106 هـخراسان الكبرى  الإقامة خراسان الكبرىسمرقندمرو الشاهجان  الكنية أبو القاسم أو أبو محمد اللقب الهلالي الخراساني أقرباء أخو محمد بن مزاحم، ومسلم بن مزاحم الحياة العملية الطبقة الط...

Method of evaluating certain integrals along paths in the complex plane This article is about the line integral in the complex plane. For the general line integral, see Line integral. Part of a series of articles aboutCalculus ∫ a b f ′ ( t ) d t = f ( b ) − f ( a ) {\displaystyle \int _{a}^{b}f'(t)\,dt=f(b)-f(a)} Fundamental theorem Limits Continuity Rolle's theorem Mean value theorem Inverse function theorem Differential Definitions Derivative (generalizations) Dif...

 

 

Computer program which translates code from one programming language to another This article is about software to translate computer languages. For the manga, see Compiler (manga). Compile and Compiling redirect here. For the software company, see Compile (company). For other uses, see Compilation. Program execution General concepts Code Translation Compiler Compile time Optimizing compiler Intermediate representation (IR) Execution Runtime system Runtime Executable Interpreter Virtual machin...

 

 

Colombian physicist (born c. 1976) Ana Maria ReyRey in 2014Born1976 or 1977 (age 46–47)Bogotá, ColombiaAlma materUniversidad de los Andes, University of MarylandChildren1[2]AwardsMacArthur Fellowship, Maria Goeppert-Mayer Award, Hispanic Engineer National Achievement Award, Blavatnik Award for Young ScientistsScientific careerInstitutionsUniversity of Colorado Boulder, National Institute of Standards and TechnologyThesisUltracold bosonic atoms loaded in optica...

Former free newspaper in Australia mXTypeFree daily newspaperFormatTabloidOwner(s)News Corp AustraliaPublisherTamara OppenEditorMelbourne: Craig HerbertSydney: Melissa MathesonBrisbane: Emma WardillFounded6 February 2001Ceased publication12 June 2015HeadquartersMelbourne, AustraliaWebsitewww.mx.net.au mX was an Australian free afternoon daily newspaper in the cities of Melbourne, Sydney and Brisbane, owned and produced by News Corp Australia. Targeted at commuters, its main channels of distri...

 

 

У этого термина существуют и другие значения, см. Братский район. район[1] / муниципальный район[2]Братский район Флаг 56° с. ш. 102° в. д.HGЯO Страна  Россия Входит в Иркутскую область Адм. центр г. Братск Мэр Братского района Дубровин Александр Сергеевич Пр�...

 

 

يُشير الأدب التيلوغوي إلى الأعمال المكتوبة باللغة التيلوغوية، ويشمل ذلك القصائد، والقصص القصيرة، والروايات، والمسرحيات، والقصائد الغنائية، وغيرها. رغم دلالة بعض المؤشرات على أن تاريخ الأدب التيلوغوي يعود إلى منتصف الألف الأولى للميلاد، فإن تاريخ أول الأعمال الموجودة �...

English social reformer and arts patron 1718–1776 For the English duchess, see Elizabeth Montagu, Duchess of Manchester. For the British novelist, nurse, and art collector, see Lady Elizabeth Montagu. For the actress, née Montagu, see Elizabeth Varley. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Elizabeth Montagu – news ...

 

 

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها. يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (مارس 2019) قرن: قرن ...