<s>
In	O
cryptography	O
and	O
the	O
theory	O
of	O
computation	O
,	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
is	O
a	O
test	O
against	O
pseudo-random	B-Error_Name
number	I-Error_Name
generators	I-Error_Name
.	O
</s>
<s>
We	O
say	O
that	O
a	O
sequence	O
of	O
bits	O
passes	O
the	O
next	B-Algorithm
bit	I-Algorithm
test	I-Algorithm
for	O
at	O
any	O
position	O
in	O
the	O
sequence	O
,	O
if	O
any	O
attacker	O
who	O
knows	O
the	O
first	O
bits	O
(	O
but	O
not	O
the	O
seed	O
)	O
cannot	O
predict	O
the	O
st	O
with	O
reasonable	O
computational	O
power	O
.	O
</s>
<s>
We	O
now	O
define	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
in	O
two	O
different	O
ways	O
.	O
</s>
<s>
Now	O
,	O
we	O
say	O
that	O
passes	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
if	O
for	O
any	O
predicting	O
collection	O
,	O
any	O
polynomial	O
:	O
</s>
<s>
We	O
can	O
also	O
define	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
in	O
terms	O
of	O
probabilistic	O
Turing	O
machines	O
,	O
although	O
this	O
definition	O
is	O
somewhat	O
stronger	O
(	O
see	O
Adleman	O
's	O
theorem	O
)	O
.	O
</s>
<s>
We	O
say	O
that	O
collection	O
passes	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
if	O
for	O
all	O
polynomial	O
,	O
for	O
all	O
but	O
finitely	O
many	O
,	O
for	O
all	O
:	O
</s>
<s>
The	O
next-bit	B-Algorithm
test	I-Algorithm
is	O
a	O
particular	O
case	O
of	O
Yao	O
's	O
test	O
for	O
random	O
sequences	O
,	O
and	O
passing	O
it	O
is	O
therefore	O
a	O
necessary	O
condition	O
for	O
passing	O
Yao	O
's	O
test	O
.	O
</s>
<s>
This	O
gives	O
us	O
a	O
possible	O
construction	O
of	O
a	O
Turing	O
machine	O
solving	O
the	O
next-bit	B-Algorithm
test	I-Algorithm
:	O
upon	O
receiving	O
the	O
first	O
bits	O
of	O
a	O
sequence	O
,	O
pads	O
this	O
input	O
with	O
a	O
guess	O
of	O
bit	O
and	O
then	O
random	O
bits	O
,	O
chosen	O
with	O
uniform	O
probability	O
.	O
</s>
