encyclopegia.org

Bach's algorithm

Bach's algorithm is a probabilistic polynomial time algorithm for generating random numbers along with their factorization. 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, primality tests. A simpler but less-efficient algorithm (performing, in expectation, primality tests), is due to Adam Kalai. Bach's algorithm may be used as part of certain methods for key generation in cryptography.

Bach's algorithm is a probabilistic polynomial time algorithm for generating random numbers along with their factorization. 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, primality tests. A simpler but less-efficient algorithm (performing, in expectation, primality tests), is due to Adam Kalai. Bach's algorithm may be used as part of certain methods for key generation in cryptography. Bach's algorithm produces a number x uniformly at random in the range N/2 (for a given input N ), along with its factorization. It does this by picking a prime number p and an exponent a such that p^a \le N , according to a certain distribution. The algorithm then recursively generates a number y in the range M/2 , where M = N/p^a , along with the factorization of y . It then sets x = p^{a}y , and appends p^a to the factorization of y to produce the factorization of x . This gives x with logarithmic distribution over the desired range; rejection sampling is then used to get a uniform distribution. ==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

No reference rows published for this article.

Cite this article

MLA

"Bach's algorithm." encyclopegia.org, 2026, https://encyclopegia.org/wiki/bach-s-algorithm. Accessed 24 November 2026.

Chicago

"Bach's algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/bach-s-algorithm.

APA

encyclopegia.org. (2026). Bach's algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/bach-s-algorithm

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
publication date1988Wikipedia

Related articles

Seanchaí

enwiki · references available

List of members of the Storting, 1977–1981

enwiki · references available

Mermaid (disambiguation)

enwiki · references available

Comedy Central (Russia)

enwiki · references available

Szymon Okolski

enwiki · references available

List of members of the Storting, 1973–1977

enwiki · references available

Giove, Umbria

enwiki · references available

Aisin AY transmission

enwiki · references available

William R. Tonso

enwiki · references available

Moskvitch G1

enwiki · references available

Moskvitch G2

enwiki · references available

Canace (play)

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1356473242 · 0.5 · snapshot enwiki-001356473242

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.