<s>
Bach	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
probabilistic	O
polynomial	O
time	O
algorithm	O
for	O
generating	O
random	O
numbers	O
along	O
with	O
their	O
factorizations	O
,	O
named	O
after	O
its	O
discoverer	O
,	O
Eric	O
Bach	O
.	O
</s>
<s>
The	O
algorithm	O
performs	O
,	O
in	O
expectation	O
,	O
O(log n )	O
primality	B-Algorithm
tests	I-Algorithm
.	O
</s>
<s>
A	O
simpler	O
,	O
but	O
less	O
efficient	O
algorithm	O
(	O
performing	O
,	O
in	O
expectation	O
,	O
primality	B-Algorithm
tests	I-Algorithm
)	O
,	O
is	O
due	O
to	O
Adam	O
Kalai	O
.	O
</s>
<s>
Bach	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
produces	O
a	O
number	O
uniformly	O
at	O
random	O
in	O
the	O
range	O
(	O
for	O
a	O
given	O
input	O
)	O
,	O
along	O
with	O
its	O
factorization	O
.	O
</s>
<s>
This	O
gives	O
with	O
logarithmic	O
distribution	O
over	O
the	O
desired	O
range	O
;	O
rejection	B-Algorithm
sampling	I-Algorithm
is	O
then	O
used	O
to	O
get	O
a	O
uniform	O
distribution	O
.	O
</s>
