Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Bach's algorithm
Algorithm for generating random numbers with their factorization

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.

The algorithm performs, in expectation, O(log n) primality tests. A simpler but less-efficient algorithm (performing, in expectation, O(log(n)2) primality tests), is due to Adam Kalai.

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

We don't have any images related to Bach's algorithm yet.
We don't have any YouTube videos related to Bach's algorithm yet.
We don't have any PDF documents related to Bach's algorithm yet.
We don't have any Books related to Bach's algorithm yet.
We don't have any archived web articles related to Bach's algorithm yet.

Overview

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

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.

References

  1. Bach, Eric (1988). "How to generate factored random numbers". SIAM Journal on Computing. 17 (2): 179–193. doi:10.1137/0217012. MR 0935336. /wiki/Eric_Bach

  2. Kalai, Adam (2003). "Generating random factored numbers, easily". Journal of Cryptology. 16 (4): 287–289. doi:10.1007/s00145-003-0051-5. MR 2002046. S2CID 17271671. https://doi.org/10.1007%2Fs00145-003-0051-5

  3. Shoup, Victor (2008). A Computational Introduction to Number Theory and Algebra (Version 2 ed.). Cambridge, UK: Cambridge University Press. p. 305.

  4. Delfs, Hans; Knebl, Helmut (2015). Introduction to Cryptography: Principles and Applications (3rd ed.). Berlin: Springer Verlag. p. 226.

  5. Bach, Eric (1988). "How to generate factored random numbers". SIAM Journal on Computing. 17 (2): 179–193. doi:10.1137/0217012. MR 0935336. /wiki/Eric_Bach

  6. Granville, Andrew; Granville, Jennifer (2019). "Constructing integers with the probabilistic model". Prime Suspects: The Anatomy of Integers and Permutations. Princeton University Press. pp. 207–208. ISBN 9780691188737. 9780691188737