It is quite natural to doubt whether the upper bound for making 2onfas deterministic, presented in Theorem 9, is optimal. We remind the reader that, so far, the best known gap between a 2nfa and an equivalent 2dfa is only n versus Ω(n2) states [16]. In this
section we shall show that the optimality of the upper bound in Theorem 9, or any other superpolynomial state lower bound for converting 2onfas to 2dfas, would imply the separation between deterministic and nondeterministic logarithmic space, hence solving a longstanding open problem in structural complexity.
This is a direct consequence of the following statement: if L= NL, then each n-state 2onfa can be simulated by a 2dfa with a number of states polynomial in n. After a slight modication, without using such additional assumptions, we shall also prove that each 2onfa can be made unambiguous with a polynomial increase in the number of the states. An extension of these results to alternating 2-way automata will be discussed in Section 3.7.
The key to these results is a reduction of a language accepted by any given 2onfa to the graph accessibility problem (GAP), i.e., to the problem of deciding whether a
given directed graph G = (V,E) contains a path connecting two designated vertices. This problem is well known to be complete for NL, the class of languages accepted by nondeterministic O(log n) space bounded machines [69].
Let us present our reduction. As for the results in Sections 3.4 and 3.5, it is ob- tained by combining a technique developed for the unary case [34] with the use of the subroutine Reach presented in Section 3.3.
Consider now an arbitrary 2onfaA with n states, in the normal form of Lemma 3. In this machine, let us x the state set to Q = {q1, . . . , qn}, with q− = q1 and q+ = qn.
Now, with each input string w∈ Σ∗, we can associate a directed graph G(w) = (Q,E(w)),
where
E(w) = {(qi, qj) ∈ Q×Q ∶ Reach(qi, qj) = true}.
That is, E(w) is the set of state pairs (qi, qj) such that A has a segment from qi to qj
on input w. These edges can be presented on an input tape of a Turing machine in the form of a binary adjacency matrix, written row by row, in which the bit at the position (i−1)⋅n + j is equal to 0 or 1 depending on whether (qi, qj) ∈ E(w). Clearly, the length
of this representation is n× n = n2 bits.
It should also be clear that w is accepted by A if and only if the graph G(w) contains a path from vertex q− = q1, the initial state, to vertex q+ = qn, the accepting state.
Hence, the mapping G∶ w → G(w) denes a reduction from the language accepted by A to GAP. As mentioned already, GAP is a complete language for NL under logarithmic space reductions [69]. Hence, GAP∈ L if and only if L = NL. This permits us to prove the following:6
Theorem 10. If L= NL, then each 2onfa A with n states can be replaced by an equiv- alent 2dfa A′ with a number of states polynomial in n.
Proof. Let DGAP be a deterministic Turing machine which solves GAP in logarithmic
space. Under the hypothesis that L= NL, such a machine must exist.
Now, by composing the above reduction G∶ w → G(w) with the machine DGAP, (see
Figure 3.1), we can build a 2dfaA′ deciding membership in ∣∣A∣∣ as follows.
For the given input w, the machine A′ simulates D
GAP, pretending that the input
is E(w), written on the tape as the corresponding adjacency matrix. Since the length of this representation is n2 bits, D
GAP uses O(log n) space on its worktape. Recall that
6For the restricted case of unary input alphabet, a result similar to Theorem 10 was shown in [34, Lem. 4.1]. The following stronger result (without the unary restriction) is presented in [46] in a dierent context: if L/poly ⊇ NL then each 2onfa A with n states can be replaced by an equivalent 2dfa A′with a number of states polynomial in n. L/poly denotes the class of languages accepted by deterministic Turing machines in logarithmic space, with the additional help of an advice of polynomial length.
G DGap w yes no E(w) (a) G UGap advice w yes no E(w) (b)
Figure 3.1: The machines A′ (a) of Theorem 10 and A′′ (b) of Theorem 11.
the automaton A is xed, and hence n does not depend on ∣w∣, the length of the real input. Therefore, a worktape of size O(log n) can be represented in a nite state control, with a number of states polynomial in n. The same holds for the nite state control of DGAP, as well as for the position of its virtual input head, with values ranging between
0and n2+1. Depending on whether D
GAP accepts or rejects E(w), the machine A′accepts
or rejects w, respectively.
The only problem is that the adjacency matrix for E(w) cannot be stored in the nite control of A′, because this would require at least 2n⋅n states. Hence, each time
DGAP needs to access one symbol from its input, such a symbol is computed on the y.
More precisely, if the bit at a position(i−1)⋅n+j is required, for some i,j ∈ {1, .. ., n}, the simulation of DGAP is temporarily interrupted andA′ calls the subroutine Reach(qi, qj),
presented in Section 3.3, to test whether the original machine A has a segment from qi
to qj on the original input w. This subroutine uses 4n−1 internal states. After obtaining
this bit of information, A′ can resume the simulation of DGAP. Each time the virtual
input head of DGAP reaches the position 0 or n2+1, A′ imitates the presence of the left
or right endmarker, respectively, without calling Reach.
While the deterministic simulation in Theorem 10 stays polynomial under the as- sumption that L= NL, the next simulation by unambiguous machines does not require any extra assumption:
Theorem 11. Each 2onfaA with n states can be replaced by an equivalent unambiguous 2onfa A′′ with a number of states polynomial in n.
Proof. The simulation ofA presented here7 is similar to that in Theorem 10 but, instead
of the (unproven) assumption L= NL, we shall utilize the following (consequence8 of a)
7In [34, Thm. 5.2], an unambiguous simulation was presented for the restricted case of unary input alphabet.
8Actually, the corresponding statement in [65] is much more general: with an additional help of an advice of polynomial length, any O(log n) space bounded nondeterministic Turing machine (not only a machine for GAP) can be made unambiguous and still working in logarithmic space.
result published in [65]: There exists UGAP, a nondeterministic Turing machine working
in logarithmic space and never using more than one accepting path on any input, and {αn}n≥0, a xed sequence of binary strings with lengths bounded by a polynomial in n,
such that, for any graph G= (V, E) with n vertices, G ∈ GAP if and only if UGAP accepts
the input E ♯ αn2. That is, using{αn}n≥0 as an assisting advice of polynomial length [47],
we can accept GAP by an unambiguous machine UGAP in logarithmic space.
Now, for the given a 2onfa A with n states, we apply the construction used in Theorem 10 but, instead of the machine DGAP on the virtual input E(w), we simulate
the unambiguous machine UGAP, pretending that the input tape contains E(w) ♯ αn2.
(See also Figure 3.1.) Clearly, w∈ ∣∣A∣∣ if and only if G(w) ∈ GAP, which in turn holds if and only if UGAP accepts E(w) ♯ αn2.
Note that the length of E(w) ♯ αn2 is polynomial in n, and does not depend on ∣w∣.
Thus, by the same reasoning as in Theorem 10, UGAPuses O(log n) space on its worktape,
and hence all data required during the simulation can be represented in a nite state control, with a number of states polynomial in n.
However, there are few dierences. First, the position of the virtual input head is now in the range 0, . . . , n2+1+∣α
n2∣+1. Second, the n2 bits of E(w) are computed on the y,
by calling the subroutine Reach(qi, qj), but we cannot access this way the second part
of the virtual input the advice string αn2. However, the advice depends only on the
size of the graph G(w) (but not on the graph G(w) itself), which in turn depends only on the number of states in A (but not on the real input w). So, for the given 2onfa A with n states, the advice αn2 is xed, and hence it can be encoded in the hardware, i.e.,
in the transition table for our new machine A′′.
Finally, observe that A′′ accesses its input tape only to compute the bits of the
adjacency matrix E(w), by calling the subroutine Reach. This deterministic subroutine starts and ends its computation with the head at the left endmarker. Thus, A′′ takes
all nondeterministic decisions with the head scanning the left endmarker, to simulate the unambiguous machine UGAP. Hence, A′′ is an unambiguous 2onfa.