Английская Википедия:Bach's algorithm

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Шаблон:Short description Bach's algorithm is a probabilistic polynomial time algorithm for generating random numbers along with their factorizations. It was published by Eric Bach in 1988. No algorithm is known that efficiently factors random numbers, so the straightforward method, namely generating a random number and then factoring it, is impractical.[1]

The algorithm performs, in expectation, O(log n) primality tests. A simpler, but less efficient algorithm (performing, in expectation, <math>O(\log^2 n)</math> primality tests), is due to Adam Kalai.[2][3]

Bach's algorithm may be used as part of certain methods for key generation in cryptography.[4]

Overview

Bach's algorithm produces a number <math>x</math> uniformly at random in the range <math>N/2 < x \le N</math> (for a given input <math>N</math>), along with its factorization. It does this by picking a prime number <math>p</math> and an exponent <math>a</math> such that <math>p^a \le N</math>, according to a certain distribution. The algorithm then recursively generates a number <math>y</math> in the range <math>M/2 < y \le M</math>, where <math>M = N/p^a</math>, along with the factorization of <math>y</math>. It then sets <math>x = p^{a}y</math>, and appends <math>p^a</math> to the factorization of <math>y</math> to produce the factorization of <math>x</math>. This gives <math>x</math> with logarithmic distribution over the desired range; rejection sampling is then used to get a uniform distribution.[1][5]

References

Шаблон:Reflist

Further reading

  • Bach, Eric. Analytic methods in the Analysis and Design of Number-Theoretic Algorithms, MIT Press, 1984. Chapter 2, "Generation of Random Factorizations", part of which is available online here.

Шаблон:Algorithm-stub