<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
in	O
particular	O
in	O
automata	B-Application
theory	I-Application
,	O
a	O
two-way	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
is	O
a	O
finite	B-Architecture
automaton	I-Architecture
that	O
is	O
allowed	O
to	O
re-read	O
its	O
input	O
.	O
</s>
<s>
A	O
two-way	B-General_Concept
deterministic	I-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
(	O
2DFA	O
)	O
is	O
an	O
abstract	B-Application
machine	I-Application
,	O
a	O
generalized	O
version	O
of	O
the	O
deterministic	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
(	O
DFA	B-General_Concept
)	O
which	O
can	O
revisit	O
characters	O
already	O
processed	O
.	O
</s>
<s>
As	O
in	O
a	O
DFA	B-General_Concept
,	O
there	O
are	O
a	O
finite	O
number	O
of	O
states	O
with	O
transitions	O
between	O
them	O
based	O
on	O
the	O
current	O
character	O
,	O
but	O
each	O
transition	O
is	O
also	O
labelled	O
with	O
a	O
value	O
indicating	O
whether	O
the	O
machine	O
will	O
move	O
its	O
position	O
in	O
the	O
input	O
to	O
the	O
left	O
,	O
right	O
,	O
or	O
stay	O
at	O
the	O
same	O
position	O
.	O
</s>
<s>
2DFAs	O
were	O
introduced	O
in	O
a	O
seminal	O
1959	O
paper	O
by	O
Rabin	O
and	O
Scott	O
,	O
who	O
proved	O
them	O
to	O
have	O
equivalent	O
power	O
to	O
one-way	O
DFAs	B-General_Concept
.	O
</s>
<s>
That	O
is	O
,	O
any	O
formal	O
language	O
which	O
can	O
be	O
recognized	O
by	O
a	O
2DFA	O
can	O
be	O
recognized	O
by	O
a	O
DFA	B-General_Concept
which	O
only	O
examines	O
and	O
consumes	O
each	O
character	O
in	O
order	O
.	O
</s>
<s>
Since	O
DFAs	B-General_Concept
are	O
obviously	O
a	O
special	O
case	O
of	O
2DFAs	O
,	O
this	O
implies	O
that	O
both	O
kinds	O
of	O
machines	O
recognize	O
precisely	O
the	O
class	O
of	O
regular	B-General_Concept
languages	I-General_Concept
.	O
</s>
<s>
However	O
,	O
the	O
equivalent	O
DFA	B-General_Concept
for	O
a	O
2DFA	O
may	O
require	O
exponentially	O
many	O
states	O
,	O
making	O
2DFAs	O
a	O
much	O
more	O
practical	O
representation	O
for	O
algorithms	O
for	O
some	O
common	O
problems	O
.	O
</s>
<s>
A	O
two-way	O
nondeterministic	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
(	O
2NFA	O
)	O
may	O
have	O
multiple	O
transitions	O
defined	O
in	O
the	O
same	O
configuration	O
.	O
</s>
<s>
Like	O
a	O
standard	O
one-way	O
NFA	B-General_Concept
,	O
a	O
2NFA	O
accepts	O
a	O
string	O
if	O
at	O
least	O
one	O
of	O
the	O
possible	O
computations	O
is	O
accepting	O
.	O
</s>
<s>
Like	O
the	O
2DFAs	O
,	O
the	O
2NFAs	O
also	O
accept	O
only	O
regular	B-General_Concept
languages	I-General_Concept
.	O
</s>
<s>
A	O
two-way	O
alternating	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
(	O
2AFA	O
)	O
is	O
a	O
two-way	O
extension	O
of	O
an	O
alternating	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
(	O
AFA	O
)	O
.	O
</s>
<s>
In	O
an	O
existential	O
state	O
a	O
2AFA	O
nondeterministically	O
chooses	O
the	O
next	O
state	O
like	O
an	O
NFA	B-General_Concept
,	O
and	O
accepts	O
if	O
at	O
least	O
one	O
of	O
the	O
resulting	O
computations	O
accepts	O
.	O
</s>
<s>
Two-way	O
and	O
one-way	O
finite	B-Architecture
automata	I-Architecture
,	O
deterministic	O
and	O
nondeterministic	O
and	O
alternating	O
,	O
accept	O
the	O
same	O
class	O
of	O
regular	B-General_Concept
languages	I-General_Concept
.	O
</s>
<s>
Christos	O
Kapoutsis	O
determined	O
that	O
transforming	O
an	O
-state	O
2DFA	O
to	O
an	O
equivalent	O
DFA	B-General_Concept
requires	O
states	O
in	O
the	O
worst	O
case	O
.	O
</s>
<s>
If	O
an	O
-state	O
2DFA	O
or	O
a	O
2NFA	O
is	O
transformed	O
to	O
an	O
NFA	B-General_Concept
,	O
the	O
worst-case	O
number	O
of	O
states	O
required	O
is	O
.	O
</s>
<s>
proved	O
that	O
an	O
-state	O
2AFA	O
can	O
be	O
converted	O
to	O
a	O
DFA	B-General_Concept
with	O
states	O
.	O
</s>
<s>
The	O
2AFA	O
to	O
NFA	B-General_Concept
conversion	O
requires	O
states	O
in	O
the	O
worst	O
case	O
,	O
see	O
Geffert	O
and	O
Okhotin	O
.	O
</s>
<s>
Sipser	O
constructed	O
a	O
sequence	O
of	O
languages	O
,	O
each	O
accepted	O
by	O
an	O
n-state	O
NFA	B-General_Concept
,	O
yet	O
which	O
is	O
not	O
accepted	O
by	O
any	O
sweeping	O
automata	O
with	O
fewer	O
than	O
states	O
.	O
</s>
<s>
The	O
concept	O
of	O
2DFAs	O
was	O
in	O
1997	O
generalized	O
to	O
quantum	B-Architecture
computing	I-Architecture
by	O
John	O
Watrous	O
's	O
"	O
On	O
the	O
Power	O
of	O
2-Way	O
Quantum	O
Finite	B-Architecture
State	I-Architecture
Automata	I-Architecture
"	O
,	O
in	O
which	O
he	O
demonstrates	O
that	O
these	O
machines	O
can	O
recognize	O
nonregular	O
languages	O
and	O
so	O
are	O
more	O
powerful	O
than	O
DFAs	B-General_Concept
.	O
</s>
<s>
A	O
pushdown	B-Application
automaton	I-Application
that	O
is	O
allowed	O
to	O
move	O
either	O
way	O
on	O
its	O
input	O
tape	O
is	O
called	O
two-way	O
pushdown	B-Application
automaton	I-Application
(	O
2PDA	O
)	O
;	O
</s>
<s>
and	O
Cook	O
(	O
1971	O
)	O
characterized	O
the	O
class	O
of	O
languages	O
recognizable	O
by	O
deterministic	O
(	O
2DPDA	O
)	O
and	O
non-deterministic	O
(	O
2NPDA	O
)	O
two-way	O
pushdown	B-Application
automata	I-Application
;	O
</s>
