In cryptography and the theory of computation, the next-bit test[1] is a test against pseudo-random number generators.
We say that a sequence of bits passes the next bit test for at any position
in the sequence, if any attacker who knows the
first bits (but not the seed) cannot predict the
st with reasonable computational power.
-bit long sequences.
be the probability distribution of the strings in
We now define the next-bit test in two different ways.
be the probability that, on input the
, a string randomly selected in
, the circuit correctly predicts
passes the next-bit test if for any predicting collection
We can also define the next-bit test in terms of probabilistic Turing machines, although this definition is somewhat stronger (see Adleman's theorem).
be a probabilistic Turing machine, working in polynomial time.
st bit correctly, i.e.
passes the next-bit test if for all polynomial
The next-bit test is a particular case of Yao's test for random sequences, and passing it is therefore a necessary condition for passing Yao's test.
However, it has also been shown a sufficient condition by Yao.
[1] We prove it now in the case of the probabilistic Turing machine, since Adleman has already done the work of replacing randomization with non-uniformity in his theorem.
The case of Boolean circuits cannot be derived from this case (since it involves deciding potentially undecidable problems), but the proof of Adleman's theorem can be easily adapted to the case of non-uniform Boolean circuit families.
be a distinguisher for the probabilistic version of Yao's test, i.e. a probabilistic Turing machine, running in polynomial time, such that there is a polynomial
Next, we consider probability distributions
is the probability distribution of choosing the
remaining bits uniformly at random.
(a simple calculus trick shows this), thus distributions
Without loss of generality, we can assume that
This gives us a possible construction of a Turing machine solving the next-bit test: upon receiving the
first bits of a sequence,
pads this input with a guess of bit
random bits, chosen with uniform probability.