The Theory of Computation Part II
The Theory of Computation Part II
Part II
CONTENTS
Introduction
1. Sets, Relations, and Functions
2. Finite Automata
3. Context-free Languages
4. Turing Machines
5. Undecidablity
Finite Automata
Part II. Finite Automata
2.1 Deterministic Finite Automata
2.2 Nondeterministic Finite Automata
2.3 Finite Automata and Regular Expressions
2.4 Languages that are and are not regular
2.5 State Minimization
2.6 Algorithms for Finite Automata*
2.1 Deterministic Finite Automata(DFA)
Why Deterministic
Automata reads one symbol from the input tape and then enters a new state that
depends only on the current state and the symbol just read.
2.1 Deterministic Finite Automata(DFA)
The simplest computational model, with very limited memory, but highly useful
Example: a finite automaton modeling an on/off switch
push
Start
off on
push
2.1 Deterministic Finite Automata(DFA)
The simplest computational model, with very limited memory, but highly useful
Example: a finite automaton modeling an train schedule
207 208
189 190
Chengdu Chongqin
Kunmin Guiyang
2.1 Deterministic Finite Automata(DFA)
The simplest computational model, with very limited memory, but highly useful
Example: a finite automaton modeling for Linux kernel process control
2.1 Deterministic Finite Automata(DFA)
Beginning from an example 0 1 0
State diagram: a directed graph
q1 q2 q3
States : q1, q2, q3
1 0,1
Initial state: with an arrow not labeled
Final states: with double circles
Transition : the arrows labeled
Input
A string 1101
Output
A state: if the state is one of the final states, accepting , else no accepting.
on input “0110”, the machine goes:q1q1q2q2q3 = “reject”
Process
Start from the initial state
Read the input string from left to right
2.1 Deterministic Finite Automata (DFA)
Definition of a deterministic finite automata
A quintuple
M=(K, , , s, F)
K : a finite set of states;
: an alphabet;
s K : the initial state;
F K : the set of final states;
: the transition function from K to K,
a , q K, (q,a)K .
For example
M1=(K, , , q1, F)
K = {q1, q2, q3}; ={0,1} ; s= q1; F={q2} 0 1 0
: 0 1
q1 q1 q2 q1 q2 q3
q2 q3 q2 1 0,1
q3 q2 q2
2.1 Deterministic Finite Automata (DFA)
Configuration
The status of M at successive moments
Any element of K* : (q,w).
Computing
One step yield :
if and only if a, w=aw’ and (q,a)=q’
(q,w) (q’,w’ )
Yield * :
the reflexive transitive closure of .
(q,w) * (q’,w’ )
A string w* is said to be accepted by M if and only if qF such
that (s,w) * (q,e).
The language accepted by M, L(M), is the set of all strings accepted by
M.
Extension of to Strings
q0 a q0
q0 b q1
q1 a q1
q1 b q0
2.1 Deterministic Finite Automata (DFA)
Example 2.1.1
Input aabba a b a
Initial configuration (q0, aabba)
q0 q1
(q0, aabba) (q0, abba) b
(q0, bba)
(q1, ba)
(q0, a)
(q0, e)
So there is (q0, aabba) * (q0, e), the aabba is accepted by M.
2.1 Deterministic Finite Automata (DFA)
Example 2.1.2
Design a DFA M that accepts the language
L(M)={w{a,b}*: w does not contain the bbb substrings}
Let M=(K, , , s, F)
K = {q0, q1 , q2 , q3}
={a,b}
q (q,)
s= q0 q0 a q0
q0 b q1
F={q0 , q1 , q2} q1 a q0
: q1 b q2
q2 a q0
q2 b q3
q3 a q3
q3 b q3
2.1 Deterministic Finite Automata (DFA)
Example 2.1.2
a
a b
b b b
q0 q1 q2 q3
a a
2.1 Deterministic Finite Automata (DFA)
2.1 Deterministic Finite Automata (DFA)
用 C 语言描述 DFA 思想
Char *input ,*pCurr // 全局量
Bool FA_func( ) 0 1
{ start:
q1:if (*pCurr==0) PCurr++; goto q1;
else if (*pCurr==1) PCurr++; goto q2; 1 0
Else if ( (*pCurr==NULL) return False
q2: if (*pCurr==0) PCurr++; goto q3;
else if (*pCurr==1) PCurr++; goto q2
Else if ( (*pCurr==NULL) return true q1 q2 q3
q3: if (*pCurr==0 || *pCurr==1)
PCurr++; goto q2;
Else if ( (*pCurr==NULL) return False:
} 0,1
自动机对应于只有 if,goto ,无数组,无内部变量的程序,
程序不如图形直观,程序容易使用超标的资源(内存,栈,数组
Exercise
Σ ={0,1}, L = {w | w has even number of 0s and
even number of 1s}, design a FA to recognize L.
What to remember?
How many possibilities?
Exercise
q00 q01
1
0 0 0 0
1
q10 q11
1
Example 1.9
Σ ={0,1}, L = {w | w contains 001 as a substring},
design a FA to recognize L.
four possibilities:
1. haven’t just seen any symbols of 001 --- q
2. have just seen a 0 --- q0
3. have just seen a 00 --- q00
4. have seen the entire pattern 001 --- q001
Example 1.9
0
1 0, 1
0
0
1
q q0 q00 q001
1
2.2 Nondeterministic Finite Automata
(NFA)
Definition of a deterministic finite automata
A quintuple
M=(K, , , s, F)
K : a finite set of states;
: an alphabet;
s K : the initial state;
F K : the set of final states;
: the transition relation, a subset of K({e})K,
(q, u, p) .
Note:
need not be a function. If M is in state q and the next input symbol is a,
then M may next follow any transition of the form (q,a,p) or (q,e,p); if a
transition (q,e,p) is followed, then no input symbol is read.
2.2 Nondeterministic Finite Automata
(NFA)
Configuration
The status of M at successive moments
Any element of K* : (q,w).
Computing
One step yield :
if and only if u{e}, such that w=uw’ and ( q, u, q’ )
(q,w) (q’,w’ )
Yield * :
the reflexive transitive closure of .
(q,w) * (q’,w’ )
A string w* is said to be accepted by M if and only if qF such
that (s,w) * (q,e).
The language accepted by M, L(M), is the set of all strings accepted by
M.
2.2 Nondeterministic Finite Automata
(NFA)
Example a
For language: L=(ababa)*
a b a
DFA: q0 q1 q2 q3
NFA: a b
b b
q4
a b
b
q0 q1
a a q1
a b q0
e b
q2 a
q2
2.2 Nondeterministic Finite Automata
(NFA)
Example 2.2.1 L(M)=(bbbab)*
M=(K, , , s, F) a,b
K = {q0, q1 , q2 , q3 , q4}
b b
={a,b} q0 q1 q2
s= q0
F={q4}
a e
: {(q0, a, q0), (q0, b, q0), (q0, b, q1),
(q1, b, q2), (q1, a, q3), (q2, e, q4), q3 q4 a,b
(q3, b, q4), (q4, a, q4), (q4, b, q4)}
b
For bababab
(q0, bababab) (q0, ababab) (q0, bababab) (q1,ababab)
(q0, babab) (q3,
babab)
(q0, abab)
(q4,
…
abab)
(q0, e)
(q4,
bab)
2.2 Nondeterministic Finite Automata
(NFA)
Example 2.2.2
Let ={a1, …, an}, n2, the language is
L={w: there is a symbol ai not appearing in w}
Design a NFA M for n=3.
q1 a2, a3
K={q0, q1, …, qn}
e
F=K e
q0 q2 a1, a3
s= q0
e
q3 a1, a2
2.2 Nondeterministic Finite Automata (NFA)
2.2 Nondeterministic Finite Automata (NFA)
2.2 Nondeterministic Finite Automata
(NFA)
Equivalence between NFA M and DFA M’
L(M)= L(M’)
Theorem 2.2.1
For each NFA, there is an equivalent DFA.
Proof.
Key ideas:
1. the NFA’s states at any moment is a set of states but not a
single one.
2. Construct a DFA to simulate the NFA.
2.2 Nondeterministic Finite Automata
(NFA)
Theorem 2.2.1
Proof.
NFA: M=(K, , , s, F),
DFA: M’=(K’, , ’, s’, F’)
K’=2K
I. Construct M’ without the symbol e
1. K’=P(K): P(K) is the set of all subsets of K .
2. For RK’ and a, let
’(R,a)={qK : rR, such that q (r,a)}
R, a r , a
rR
2.2 Nondeterministic Finite Automata
(NFA)
Theorem 2.2.1
Proof.
I. Construct M’ without the symbol e
3. s’={s}
4. F’={RK’ : R contains an accepted state of M}
II. Construct M’ with the symbol e
For RK’ , Let
E(R)={pK : (q,e) *(p,e)} (contain R itself )
’(R,a) may be modified by
’(R,a)={qK : rR, such that q E( (r,a))}
s’ may be modified by
s’ =E({s})
2.2 Nondeterministic Finite Automata (NFA)
2.2 Nondeterministic Finite Automata (NFA)
2.2 Nondeterministic Finite Automata
(NFA)
Example
Design a DFA M2 from the NFA M1 q1
M1 = ({q1, q2, q3}, {a,b}, , q1, {q1})
b a
M2 =(K’, {a,b}, ’, s’, F’) e
a
K’={{e}, {q1}, {q2}, {q3}, {q1, q2}, q2 q3
a,b
{q1, q3}, {q2, q3}, {q1, q2, q3}}
s’=E({q1})= {q1, q3}
F’= {{q1}, {q1, q2}, {q1, q3}, {q1, q2, q3}}
2.2 Nondeterministic Finite Automata
(NFA)
(q1, a)={e}, E({e})={e}
q1
(q1, b)={q2}, E({q2})={q2}
(q2, a)={q2, q3}, E({q2, q3})={q2, q3} b a
e
(q2, b)={q3}, E({q3})={q3} a
(q3, a)={q1}, E({q1})={q1, q3} q2 a,b q3
(q3, b)={e}
a,b
a {q1}
b {q2}
{e} {q1,q2}
b a a,b
b b
a
{q3} {q1,q3} a {q2,q3} {q1,q2,q3} a
a
b
b
2.2 Nondeterministic Finite Automata
(NFA)
a b
a {q1,q3} {q3} {e}
a,b
b
b b
a
{q2} {q2,q3} {q1,q2,q3}
a b
a
Exercises
P.69 (P37): 2.1.2, 2.1.3
P.73 (P45) : 2.2.1
P.74 (P36) : 2.2.2, 2.2.3
P.75 (P36) : 2.2.9
2.3 Finite automata and regular expressions
Note: the class of regular languages is closure of certain
finite languages under the language operation of union,
concatenation, and Kleene star. Is the class of language
accepted by finite automata similar?
Theorem 2.3.1:
The class of languages accepted by finite automata is closed under
Union;
Concatenation;
Kleene star;
Complementation;
Intersection.
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Union
Let M1=(K1, , 1, s1, F1) and M2=(K2, , 2, s2, F2) be NFA.
Construct a NFA M such that L(M)= L(M1)L(M2).
Idea: using non-determinism to “guess” whether the input is in
L(M1) or in L(M2).
Definition of M accepted L(M1)L(M2):
• Assume K1 and K2 are disjoint sets;
• M = (K, , , s, F)
• K = K1K2{s};
• F = F1F2;
= 1 2 {(s,e,s1), (s,e,s2)}.
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Union
s1 s2 es e
s1 s2
F
F1 F2
M1 M2 M
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Concatenation
Let M1=(K1, , 1, s1, F1) and M2=(K2, , 2, s2, F2) be NFA.
Construct a NFA M such that L(M)= L(M1)L(M2).
Idea: using non-determinism to “guess” which final state in M1
“jumping” to M2 .
Definition of M accepted L(M1)L(M2):
• Assume K1 and K2 are disjoint sets;
• M = (K, , , s1, F2)
• K = K1K2; (q, a, p )1 if q K1 and q F1
• F = F2 ; (q, a, p ) if q F1 and a e
1
( q, a, p )
: (q, a, p )1 (q, a, s2 ) if q F1 and a e
(q, a, p ) 2 if q K 2
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
s1
Concatenation
F1
s1 s2
e e
F1 F2 s2
M1 M2
F=F2
M
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Kleene star
Let M1=(K1, , 1, s1, F1) be a NFA.
Construct a NFA M such that L(M)= L(M1)*.
Idea: using non-determinism to “guess” that each
concatenation (contain {e}) between all elements in L(M1) can
be accepted.
Definition of M accepted L(M1)*:
• M = (K, , , s, F)
• K = K1{s}; (q, a, p )1 if q K1 and q F1
if q F1 and a e
• F = F1{s}; (q, a, p )1
: (q, a, p ) (q, a, p )1 (q, a, s1 ) if q F1 and a e
(q, a, s ) if q s and a e
1
M1 F1
M
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Complementation
Let M1=(K, , , s, F1) be a DFA.
Construct a DFA M=(K, , , s, F) such that L(M)=*L(M1).
Definition of M accepted L(M) :
• M = (K, , , s, F)
• F = K F1.
2.3 Finite automata and regular expressions
Theorem 2.3.1 (Proof )
Intersection
By De Morgan Low, there is
L1L2 = *((* L1) (* L2))
So closedness under intersection follows from closedness
under union and complementation.
2.3 Finite automata and regular expressions
Theorem 2.3.2:
A language is regular if and only if it is accepted by a
finite automaton.
Proof
Only if :
Class of regular languages : the smallest class of language
(containing the empty set, and the singletons {a}) closed under
union, concatenation, and Kleene star.
By the theorem 2.3.1 : the finite automaton languages are
closed under union, concatenation, and Kleene star.
Hence, every regular language is accepted by some finite
automata.
2.3 Finite automata and regular expressions
Theorem 2.3.2 (Proof):
Only if : (each regular expression can be transferred to a
finite automaton.)
Let R be a regular expression, there are the cases following:
a
R=a, a, so L(R)={a}
R=e, so L(R)={e}
R=, so L(R)=
R=R1R2, R=R1R2, and R=R1* : show as the theorem 2.3.1.
2.3 Finite automata and regular expressions
Transition from any regular expression to some
a
finite automata
For example:(aba)* NFA b,e
a
a:
b
b:
a e b
ab :
e a e b
aba :
e a
e
(aba)* : e a e b
e
a
e
e
2.3 Finite automata and regular expressions
Theorem 2.3.2 (Proof ):
if : (each finite automaton can be transferred to a regular
expression.) Omitting the proof.
Generalized NFA (GNFA)
Mg=(K, , , qstart, qaccept)
: (K{qstart})(K{qaccept})R
R: the set of all regular expressions on ;
qstart : start state;
qaccept : accept state.
(1)The start state has the transitions to each of K{qstart}, but any one from the
K{qstart}; (2)There are only one accept state which has all transitions from
each of K{qaccept}, but one to any others, and qstart qaccept; (3)Except qstart and
qaccept , all states have the transitions to each other and to themselves.
2.3 Finite automata and regular expressions
GNFA: example
ab*
qstart aa
a*
(aa)* abba
b qaccept
b*
ab
2.3 Finite automata and regular expressions
DFAGNFA
e a
s q1
q1 a
b
b
a,b f q2
e
q2 ab
DFA
GNFA
2.3 Finite automata and regular expressions
GNFA Regular Expression
Let the GNFAk have k states, and so k2;
Construct a new GNFAk1 with k1 states;
Continue the construction until k=2: GNFA2;
The of GNFA2 : (qstart , qaccept)R.
R
2.3 Finite automata and regular expressions
GNFA Regular Expression
From GNFAk to GNFAk1 , a state qrip should be deleted.
The qrip is not the qstart and qaccept .
For each deleting (qrip) step, modify the of GNFAk
between any qi and qj, (also qi=qj)
Rule: R4
qi qj (R1)(R2)*(R3)(R4)
qi qj
R1 R3
qrip
R2
2.3 Finite automata and regular expressions
DFA Regular Expression example
a e a e a
q1 s q1 s q1
b b b(ab)*
a,b
q2 f e q2 f
ab
DFA GNFA4 GNFA3
R a*b(ab)*
s f
2.3 Finite automata and regular expressions
b b
a a
q1 q2 q1 q2
a a
b e b a e
a b f
b s e
q3 q3
aab
a(aab)*
a s f
q2
s ab a(aab)*abb
e (baa)(aab)*e
b baa f
e q3
q3
bb (baa)(aab)*abbb
(a(aab)*abb)((baa)
s f
(aab)*abbb)*((baa)
Exercises
P.83 (P51) : 2.3.4, 2.3.5
P.84 (P52) : 2.3.7
2.4 Languages that are and are not regular
“Is a language regular ?” how to answer it?
If a language is regular, show why?
By a variety of techniques:
Regular expressions;
DFA;
NFA;
If a language is not regular, show why?
By what?
2.4 Languages that are and are not regular
Example 2.4.1
Let ={0,1,…,9} and let L* be the set of decimal
representations for nonnegative integers(without redundant
leading 0’s) divisible by 2 or 3. For example, 0,3,6,244 L, but
1,03,00 L. Then L is regular.
Let L1 be the set of decimal representations of nonnegative
integers. Then
L1=0{1,2,…,9}*, evident, it’s a regular expression.
Let L2 be the set of decimal representations of nonnegative
integers divisible by 2. Then L2 is
L2= L1*{0,2,4,6,8}, L2 is a regular expression.
Let L3 be the set of decimal representations of nonnegative
integers divisible by 3. (a number is divisible by 3 if and only if
the sum of its digits is divisible by 3.)
2.4 Languages that are and are not regular
Example 2.4.1 (continued)
Construct a finite automaton M 0,3,6,9
L3=L’(M)
q2
So,
L= L2 L3. 1,4,7 1,4,7
L is a regular language. 2,5,8
q1 q3
q4 q5 q6 q7
b b a
a,b
2.5 State minimization
The number of states of a DFA
L(M)=(abba)*
6 states: a b
q1 q2 q3
a
b a a b a
q4 q5 q6
b b
a,b
2.5 State minimization
The number of states of a DFA
L(M)=(abba)*
6 states:
Attention: q4, q6.
a b
q1 q2 q3
a
b a a b a
q4 q5 q6
b b
a,b
2.5 State minimization
The number of states of a DFA
L(M)=(abba)*
6 states: a b
q1 q2 q3
Attention: q4, q6. a
b a a b a
q4 q5 q6
b b
a,b
2.5 State minimization
Equivalence class
Definition 2.5.1
Let L* be a language, and let x,y*. x and y are
equivalent with respect to L, denote x L y, if for all
z*, the following is true : xzL if and only if yzL.
Notice that L is an equivalence relation.
Equivalence class [x]
[x]: x is a string.
2.5 State minimization
Equivalence class of L
Example: for L=(abba)*
(1) [e]=L
(2) [a]=La
(3) [b]=Lb
(4) [aa]= L(aabb)*
2.5 State minimization
Definition 2.5.2
Let M=(K,,,s,F) be a DFA. Two strings x,y* are
equivalent with respect to M, denoted x M y , if they both
drive M from s to the same state.
Formally, x M y if there is a state q such that
(s,x) *M (q,e) and (s,y) *M (q,e).
M is an equivalence relation.
The equivalence class of M is identified by the states of
M:
denoted by Eq
2.5 State minimization
Equivalence class of M
Example for the DFA M
a b
L(M)=(abba)* q1 q2 q3
(1) Eq1= (ba)* a
(2) Eq2= abLaa b a a b a
(3) Eq3= (ba)*abL
q4 q
5 q6
(4) Eq4= b(ab)* b b
a,b
(5) Eq5= L(aabb)*
(6) Eq6= (ba)*abLb
The equivalence class forms a partition of *.
2.5 State minimization
Theorem 2.5.1
For any DFA M=(K,,,s,F) and any strings x,y*, if
x M y , then x L(M) y .
M is a refinement of L(M) ;
The each equivalence class of is contained in some
equivalence class of ; that is , each equivalence of is
the union of one or more equivalence classes of .
For example:
For the DFA M,
[aa]= L(aabb)* =Eq5
[e]= Eq1Eq3 = (ba)*(ba)*abL=L
2.5 State minimization
2.5 State minimization
Form the theorem 2.5.1:
The number of equivalence classes of L(M) is a
natural lower bound on the number of states of any
automaton equivalent.
2.5 State minimization
Theorem 2.5.2 (The Myhill-Nerode Theorem)
Let L* be a regular language, then there is a DFA
with precisely as many states as there are equivalence
classes in L that accepts L.
Standard automaton
Definition : M=(K,,,s,F)
K={[x] : x*}, the set of equivalence classes under L;
s=[e], the equivalence class of e under L;
F={[x] : xL};
For any [x]K and a, ([x],a)=[xa]
2.5 State minimization
Standard automaton
Example: L=(abba)* a
(1) [e]=L [e] [a]
(2) [a]=La b
(3) [b]=Lb b a a
(4) [aa]= L(aabb)*
[b] [aa]
b
a,b
2.5 State minimization
Corollary
A language L is regular if and only if L has finitely
many equivalence classes.
Another useful way for proving that a language is not
regular. For example,
L={anbn : n 1} is not regular.
Proof: No two strings ai and aj , with ij , are equivalent under
L , so L has infinitely many equivalence classes [e], [a], [aa],
[aaa], … ; by the corollary, L is not regular.
2.5 State minimization
The equivalence class of the states of DFA
Definition:
For a DFA M=(K,,,s,F) , the relation AMK* : (q,w)AM
if and only if some fF, (q,w) *M (f,e).
For all z*, (q,z)AM if and only if (p,z)AM , denote q p.
For all z* and a number n, |z|n, (q,z)AM if and only if
(p,z)AM , denote q n p.
Each equivalence relation in 0, 1, 2, … is a refinement
of the previous one.
q 0 p holds if q and p are either both accepting, or both
non-accepting.Two equivalence classes of 0: F and K–F
2.5 State minimization
Lemma 2.5.1
For any two states q,pK and any integer n1, qn p if and
only if (1) q n-1 p and (2) a, (q,a) n-1 (p,a).
Algorithm for compute :
initially the equivalence classes of 0 are F and K–F;
repeat for n:=1,2,…
compute the equivalence classes of n from those n-1;
until n is the same as n-1.
Each iteration can be carried out by applying Lemma 2.5.1: For each
pair of states of M, we test whether the conditions of the lemma
hold, and if so we put the two states in the same equivalence class of
n.
2.5 State minimization
11:04:59
2.5 State minimization
11:04:59
2.5 State minimization
11:05:00
2.5 State minimization
Example 2.5.3
Compute of the M.
a b
q1 q2 q3
a
b a a b a
q4 q5 q6
b b
a,b
2.5 State minimization
Example 2.5.3
0 : {q1, q3} and {q2, q4 , q5 , q6}
1 : {q1, q3}, {q2}, {q4, q6}, {q5}
a b a
q1 q2 q3
{q1, q3} {q2}
a b
b a a b a b a a
q4 q5 q6
b b {q4, q6} {q5}
b
a,b a,b
2.6 Algorithms for Finite Automata*
Many of the results in this chapter were concerned with
different ways of representing a regular language: as a
language accepted by a finite automaton, deterministic or
nondeterministic, and as a language generated by a
regular expression.
All these results are constructive, in that their proofs
immediately suggest algorithms which, given a
representation of one kind, produce a representation of
any one of the others. In this subsection we shall make
such algorithms more explicit, and we shall analyze
roughly their complexity.
2.6 Algorithms for Finite Automata*
2.6 Algorithms for Finite Automata*
2.6 Algorithms for Finite Automata*
2.6 Algorithms for Finite Automata*
There are, however, three important questions that r
emain unresolved in Theorem 2.6.1:
A) Is there a polynomial algorithm for determining whether two given
nondeterministic finite automata are equivalent, or is the exponential
complexity in (f) inherent?
B) Can we find in polynomial time the nondeterministic automaton wi
th the fewest states that is equivalent to a given nondeterministic auto
maton? We can certainly do so in exponential time: Try all possible no
ndeterministic automata with fewer states than the given one, testing e
quivalence in each case using the exponential algorithm in (f).
2.6 Algorithms for Finite Automata*
C ) More intriguingly, suppose that we are given a nondeterministic
finite automaton and we wish to find the equivalent deterministic finit
e automaton with the fewest states. This can be accomplished by com
bining the algorithms for (a) and (d) above. However, the number of st
eps may be expoexponential in the size of the given nondeterministic
automaton, even though the end result may be small —simply becaus
e the intermediate result, the unoptimized deterministic automaton pro
duced by the subset construction, may have exponentially more states
than necessary. Is there an algorithm that produces directly the minim
um-state equivalent deterministic automa- automaton in time which is
bounded by a polynomial in the input and the final output?
2.6 Algorithms for Finite Automata*
Finite Automata as Algorithms
A deterministic finite automaton M is an efficient algorithm for decidi
ng whether a given string is in L ( M ) .
2.6 Algorithms for Finite Automata*
2.6.1 FA as algorithms
2.6 Algorithms for Finite Automata*
suppose that M = (K, E, A, s, F) is a nondeterministi
c finite automaton, and consider the following algori
thm:
2.6 Algorithms for Finite Automata*
Exercises
P.100 (P63) : 2.5.1 (a): (i)(ii)(iii)(iv)(v)
P.101 (P63) : 2.5.3 (2.1.2 (a)(b)(c))