[lecture notes in computer science] algorithms and computation volume 762 || separating...

9
Separating Exponentially Ambiguous NFA from Polynomially Ambiguous NFA * tling Leung Department of Computer Science, New Mexico State University, Las Cruces, NM 88003~ U.S.A. hleung(~nmsu.edu Abstract. We resolve an open problem raised by Ravikumar and Ibarra on the succinctness of representations relating to the types of ambiguity of fi- nite automata. We show that there exists a family of nondeterministic finite automata {A~} over a two-letters alphabet such that, for any positive integer n, A~ is exponentially ambiguous and has n states, whereas the smallest equiv- alent deterministic finite automaton has 2~ states and any smallest equivalent polynomially ambiguous finite automaton has 2~ - 1 states. 1 Introduction In [RI89]~ questions relating the type of ambiguity of finite automata to the succinctness in their number of states are studied. The following five classes of finite automata have been considered: DFA (deterministic finite automata)~ NFA (nondeterministic finite automata), UFA (unambiguous NFA), FNA (finitely am- biguous NFA) and PNA (polynomially ambiguous NFA). Let C1 and C2 be any two of the above five classes of finite automata. We say that (71 can be polynomially converted to C~2 (written (~,1 <p C2) if there exists a polynomial p such that for any finite automaton in C1 with n states~ we can find an equivalent finite automaton in C2 with the number of states being at most p(n). C1 is said to be polynomially related to C2 (written C1 =p C2) if (71 <p C2 and C2 _<p (71. C1 is said to be separated from (/2 if C1 #p C~. Furthermore, we write C1 <p C2 if C1 _<p (/2 and C1 ~p (/2. It is immediate that DFA <_p UFA, UFA ~p FNA, FNA <p PNA and PNA <p NFA. The following results have been obtained: DFA <p NFA ([MF71], [Mo71])~ DFA <p UFA ([Sc78], [SH85], [RI89]), UFA <p FNA ([Sc78], [RI89]), and UFA <p NFA ([SH85]). It is unknown whether FNA <p NFA. It is conjec- tured by [RI89] that FNA <p PNA and PNA <p NFA. In this paper, we prove that PNA <p NFA which immediately implies that FNA <p NFA. The other conjecture that FNA <p PNA still remains open. Specifically, we show that there exists a family of NFAs {A,, ] n >_ 1} over a two-letters alphabet such that, for any positive integer n, A~ is exponentially ambiguous and has n states, whereas the smallest equivalent DFA has 2'~ states and any smallest equivalent PNA has 2~ - 1 states. * This research is supported by an Alexander von t:]umboldt research fellowship. It was done while the author was visiting the Univerisity of Frankfurt, Germany.

Upload: f-y-l

Post on 09-Dec-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

Separating Exponentially Ambiguous NFA from Polynomially Ambiguous NFA *

tling Leung

Department of Computer Science, New Mexico State University, Las Cruces, NM 88003~ U.S.A.

hleung(~nmsu.edu

A b s t r a c t . We resolve an open problem raised by Ravikumar and Ibarra on the succinctness of representations relating to the types of ambiguity of fi- nite automata. We show that there exists a family of nondeterministic finite au tomata {A~} over a two-letters alphabet such that, for any positive integer n, A~ is exponentially ambiguous and has n states, whereas the smallest equiv- alent deterministic finite automaton has 2 ~ states and any smallest equivalent polynomially ambiguous finite automaton has 2 ~ - 1 states.

1 I n t r o d u c t i o n

In [RI89]~ questions relating the type of ambiguity of finite automata to the succinctness in their number of states are studied. The following five classes of finite au tomata have been considered: DFA (deterministic finite automata)~ NFA (nondeterministic finite automata) , UFA (unambiguous NFA), FNA (finitely am- biguous NFA) and PNA (polynomially ambiguous NFA).

Let C1 and C2 be any two of the above five classes of finite automata. We say that (71 can be polynomially converted to C~2 (written (~,1 <p C2) if there exists a polynomial p such that for any finite automaton in C1 with n states~ we can find an equivalent finite automaton in C2 with the number of states being at most p(n). C1 is said to be polynomially related to C2 (written C1 = p C2) if (71 <p C2 and C2 _<p (71. C1 is said to be separated from (/2 if C1 # p C~. Furthermore, we write C1 <p C2 if C1 _<p (/2 and C1 ~ p (/2.

It is immediate that DFA <_p UFA, UFA ~p FNA, FNA <p PNA and PNA < p NFA. The following results have been obtained: DFA <p NFA ([MF71], [Mo71])~ DFA <p UFA ([Sc78], [SH85], [RI89]), UFA <p FNA ([Sc78], [RI89]), and UFA <p NFA ([SH85]). It is unknown whether FNA <p NFA. It is conjec- tured by [RI89] that FNA <p PNA and PNA <p NFA.

In this paper, we prove that PNA <p NFA which immediately implies that FNA <p NFA. The other conjecture that FNA <p PNA still remains open.

Specifically, we show that there exists a family of NFAs {A,, ] n >_ 1} over a two-letters alphabet such that, for any positive integer n, A~ is exponentially ambiguous and has n states, whereas the smallest equivalent DFA has 2 '~ states and any smallest equivalent PNA has 2 ~ - 1 states.

* This research is supported by an Alexander von t:]umboldt research fellowship. It was done while the author was visiting the Univerisity of Frankfurt, Germany.

Page 2: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

222

Our results show that any PNA equivalent to A,~ cannot do better in the number of states than the smallest equivalent DFA obtained by the subset con- struction except for the saving of the dead state.

Another way to interpret our results is as follows: let us first define that an NFA is strongly ambiguous if there is a useful s tate q ( that is, q can be reached from some start ing state and can reach some final state) and there is a string w such that M can process w start ing from state q and ending also with state q in more than one ways. Then by a characterization in [IR86], our results show that A,~ is strongly ambiguous with n states, whereas the smallest equivalent DFA has 2 ~ states and any smallest equivalent NFA that is not strongly ambiguous has 2 n - 1 states.

Section 2 presents the definitions and some basic results. Section 3 presents the family of NFAs {An} and proves the main result of this paper by a series of lemmas.

2 P r e l i m i n a r i e s

We assume that the reader is familiar with the basic definitions, results and notations in finite au toma ta theory [ttU79] and graph theory [tta69].

Let w be a string. Then w R denotes the reverse of w. For a language L, L ft is the set of strings w R where w E L.

Throughout this paper, we assume a model of NFA that is slightly more general than the one defined in [HU79] in that we allow a set of start ing states instead of only one start ing state. Thus, an NFA M is a 5-tuple (Q, Z, 5, Qs, QF) where Q is the set of states, Z is the alphabet set, 5 : Q x ~ .- 2 Q is the transition function, QI is the set of start ing states and QF is the set of final states.

Given an NFA M, we define the ambiguity of a string w to be the number of different accepting paths for w in M. Note that a string w is in the language of M if and only if the ambiguity of w is not zero. The ambiguity function ambM : IN0 IN0 is defined such that ambM(n) is the max imum of the ambiguities of strings that are of length n or less. Remark: ambM is nondecreasing.

M is called unambiguous if the ambiguity of any string is either zero or one. M is called finitely (respectively: polynomially, exponentially) ambiguous if ambM can be bounded by a constant (respectively: polynomial, exponential) function f ; that is for all n E IN0, ambM(n) < f(n).

It is easy to see that ambM(n) <_ sis n where sl is the cardinality of QI and s is the cardinality of Q. Thus, every NFA must be exponentially ambiguous.

M is called strictly exponentially ambiguous ([IR86]) if M is exponentially ambiguous but not polynomially ambiguous. It is known ([IR86]) that M is strictly exponentially ambiguous if and only if there is a useful s tate q and there is a string w such that M can process w start ing from state q and ending also with state q in more than one ways.

Page 3: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

223

3 M a i n r e s u l t

For any posi t ive integer n, we define an NFA A , = (Q, Z , 5, {ql}, {ql}) where Q = { q l , q 2 , . . . , q ~ } , ql is the only s ta r t ing s ta te and the only final s ta te , Z = {0, 1} and 5 (see Figure 1) is defined as follows: 5(ql, 0) = {ql, q2}, 5(qi, O) = {qi+l} for 2 < i < n - 1, 5(q,~,O) = {ql}, 5(ql, 1) = 0 and 5(ql, 1) = {ql} for 2 < i < n .

o 1 1 1

0

Fig. 1. Transition diagram of A, .

We denote the language of A,~ by L,~, which is (0 + (01 ' ) '~-10) * in regular expression. It is easy to see tha t L~ = L ~ = L*.

First , we present some definitions. Given a language L and a str ing x,

prefix(L)d~--f{w 13w t, ww' C L}

and x-l(n)d--ef{w I XW E L}.

The two opera t ions prefix and X - 1 c o m m u t e since bo th x-'(prefix(L)) and p~efix(x-l(L)) equal to {w 13w', xww' �9 L}.

Let kiU_non_ql denotes 0(10) n-1. Then for any P C_ Q, 5(P, kiU_non_ql) = P - {q2 , . . . , qn}.

Let accept denotes 0 ~-1 and reset denotes accept kill_non_ql. For any n o n e m p t y subset P C_ Q, observe tha t ql �9 5(P, accept) and 5(P, reset) = {ql}. Equivalently, for any x �9 prefix(L~), x accept �9 L~ and (x reset)-~(L,~) = L~.

For any P _C Q, let wp �9 Z* be wlOw,~OW~_lO...OWl where wl = e i fqi �9 P , and wi = 1 otherwise; and let up �9 Z* be 0 ~-1 we .

L e m I n a 1. For any P C_ Q, we have (1) 5(P, w p ) = P (2) for any q �9 P, 5(q, we) D D_ {q} (3) 5(Q - P, wp) = 0

P r o o f . Given a s ta te qi �9 Q, we define shift(ql) to be qi+l if 1 < i < n - 1, and ql if i = n. Given P C Q, we extend the definition of shift such tha t shift(P) = {shift(q) I q �9 P} . Moreover, for any q �9 Q and P C Q, we define shift~ = q and shift~ = e . Note that ~hift~(q) = q and shifi~(P) = P.

Page 4: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

224

(1) Observe tha t 5(P, wl) = P. This is because if ql C P , then W 1 : ( and 5(P, wl) = 5(P,e) = P. Otherwise if ql ~ P , then wl = 1 and 5(P, wl) = 5(P, 1) = P since ql ~ P-

Therefore, 5( P, wp ) = 5( P, OwnOwn- i . . .Owl). We want to show by induct ion tha t 5(P, 0w~0wn_l . . . 0 w n - i + l ) = shifti(P)

for 0 < i < n. Then we are done since 5(P, OWnOWn-1...Ow~) = shift's(P) = P. Base. i = O. 5(P, ~) = P = sh i f r Induct ion hypothesis: Assume tha t the s t a t ement is true for 0 < k < n - 1.

Induc t ion step. By induction, we have 5(P, 0w~0wn_l . . .0w,~_k+10w~_k) = 5(5(P, 0wn0w,~_l . . . 0Wn-k+l) , 0wn-k) = 5(shiftk(P), 0wn-k) . The induct ion proof is completed if we can verify tha t 5(shift k (P), 0Wn-k) = shif~ +1 (P).

Case 1. (qn-k E P ) Then Wn-k = ~ and qn E shiftk(P). Thus, 5(shiflk(P), Ow,_k) = 5(shiftk(p), O) = shif~+l(P) since q~ E sh,fl~(P)~

Case 2. (q,~-k r P ) Then w,~-k = 1 and q,~ ~ shiftk(p). Thus, 6(shift~(P),Ow~_k) = 5(shiftk(P), 01) = shif~+l(P) since q,~ ~ shiftk(P).

(2) Observe tha t 5(q, wl) = {q}. This is because if ql E P, then wl = e and 5(q, wa) = 5(q, e) = {q}. Otherwise if ql ~ P, then w~ = 1 and 5(q, wl) = 5(q, 1) = {q} since q :~ ql by the facts tha t q, ~ P and q E e .

Therefore, 5(q, wp) = 5(q, 0W,~0Wn-1.. .0Wl). We want to show by induct ion tha t 5(q, 0wn0w~_~ . . . 0w,~_i+~) _D shiff({q})

for 0 < i < n. Then we are done since 5(q, Ow~Own_~...Ow~) D_ shiff~({q}) = {q}.

Base. i = 0 .5(q , e) = {q} = shifl~ Thus, 5(q, () D_ shift~ Induct ion hypothesis: Assume tha t the s t a t ement is true for 0 < k < n - 1.

Induct ion step. By induction, we have 5(q, 0w,~0W~_l. . . 0w~_k+10w~-k) = 5(5(q, 0Wn0W,~_a ...0Wn--k+~), 0Wn-k) __D 5(shiflk({q}), 0Wn-k). The induct ion proof is completed if we can verify tha t 5(shiflk({q}), 0wn-k) 2 shif~+l({q}) �9

Case 1. (qn = shiftk(q)) T h e n Wn-k = ~ since q n - k = q 6 P . T h u s , 5(shif?({q}), OWn-k) = 5(shif?({q}), O) = 5(kq,~, 0) = {ql} = shift({qn}) = shifl(shiflk({q})) = shif?+a({q}). Hence,

5(shif~ ({q}),Own-k) ~ s,~if~k+~({q}). Case 2. (qn 7 s shiflk(q))

Then no ma t t e r whether wn-k = e or wn-k = l, we always have 5(shiflk({q}), OWn--k) ~ shiftk+l({q}).

(3) We want to show tha t 5(Q - P, wlOWnOWn-IO...0W2) = 0. Hence, 5(Q -

P, wp) = ~(Q-P, w,0wn0wn_,0. . . 0w~0w~) = 6(5(Q-P, w~0w~0w~_10... 0w~), 0w~) = 5(0, 0w~) = 0.

First observe tha t 5(Q - P,w~) = Q - P - {q~}. This is because if qt E P then wl = c and q~ ~ Q - P . T h u s h ( Q - P , w ~ ) = 5 ( Q - P , e ) = Q - P = Q - P - {q~} since q~ ~ Q - P . Otherwise if qa ~ P then w~ = 1. Thus 5(Q - P, w~) = 5(Q - P, l) = Q - P - {ql}.

Next we want to show by induct ion tha t for 1 < i < n , 5 ( Q - P - { q l } , OWnOWn_l.. .Own--i. . t-2) = shif~-l(Q - P) -- { q l , q 2 , . . . , qi}. Then we are done

Page 5: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

225

since by taking i = n, we have 5 ( Q - P - { q t } , OWnOWn-1...0W2) ---- shiff~-l(Q - P ) - {q: , q ,d = O.

Base. i = 1 .6(Q - P - {ql}, e) = Q - P - {q:} = shifl~ - P) - {ql}. Induction hypothesis: Assume that the statement is true for 1 < k < n - 1. Induction step. By induction, we have 5 ( Q - P - { q : } , O w n O w ~ _ : . . .

0wn-k+20wn-k+:) = 6(shift~-l(Q - P) - {ql, q2 , . . . , qk}, 0wn-k+:). The induc- tion proof is completed if we can verify that 5(shiflk-l(Q - P) - {qa, q2 , . . . , qk}, OWn-kA-1) = shiflk(Q - P ) - {q:, q2 , . . . , qk, qk+l}.

Case 1. (q~-k+: E P) Then wn-~+l = ~ and qn ~ sh i f l k - l (Q-P) . Thus, sh i f l k - : (Q-P) = shiflk-:(Q - P ) - { q ~ } . Hence, 5( sh i f~ - : (Q-P)k - {q l , q2, . . . , qk}, Own-k+1) = 5(shiftk-:(Q - P ) - {qn ,q: ,q2 , . . . ,qk} ,0) = shift ( Q - P ) - {ql ,q2 , . . . ,qk , qk+:}.

Case 2. (qn-k+: ~ P) Then wn-k+l = 1. Thus, 5(sh i f l~ - i (Q- P ) - {ql ,q2, . . . ,qk} ,Ow~-k+:) = 5( shiftk- : ( Q - P) - {ql, q2, . . . , qk } , 01) = shiftk ( Q - P) - {ql, q2, . . - , qk, qk+l}. []

C o r o l l a r y 2. For any P C Q, 5(q:, up) = P.

P r o o f . (~(ql, up) =- 5(ql, 0 n-1 Wp) = 6(Q, wp) = 5(P, wp) U 5(Q - P, wp) = 5(P, wp) = P by parts (1) and (3) of lemma 1. []

C o r o l l a r y 3 . For any P, P' C_ Q, upwp, E prefix(Ln) if and only if P ~ P ' 7s O.

P r o o f . Suppose P A P ' # O. Let q E P A P ' . Then 6(q l , upWp, ) = 5(P, wp,) D__ 5(q, wp,) D_ {q} # 0 by corollary 2 and part (2) of lemma 1. Since all states in An are useful, upwp, E prefix(Ln).

Suppose P A P ' = O. Then P C_ Q - P ' and 5(ql, UpWp,) = 5(P, wp,) C_ 5(Q- P', wp,) = O by corollary 2 and part (3) of lemma 1. Thus, upwp, ~ prefix( L,~). []

L e m m a 4 . The smallest DFA recognizing L~ has 2 n states.

P r o o f . By corollary 2, all subsets of states can be realized in the subset con- struction. Next, we want to show that any two different subsets of states are not equivalent, then we are done by the Myhill-Nerode theorem. Let P 5s P~ C Q. Let ql be the state with the largest subscript such that qi belongs only to exactly one of P and P~. That is, for any qj where i + 1 < j _< n, either qj belongs to both P and P~ or qj does not belong to any one of P and P~. If i = 1, then P and P~ can be distinguished by the empty string. Assume that 1 < i _< n. Then P and pi can be distinguished by (10) n+l- i . []

Let Mu be a 2 n - 1 by 2 ~ - 1 matr ix over the field of characteristic 2 with rows and columns indexed by the nonempty subsets of Q such that Mn(P, P~) = 1 if up wp, accept E Ln, and Mn(P, P~) = 0 otherwise. By corollary 3 and the property of accept, Mn(P, P~) = 1 if P A P~ ~ O and Mn(P, P') = 0 otherwise.

L e m m a 5 . The rank of Mn is2 ~ - 1.

Page 6: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

226

P r o o f . The proof will be given in the full version of the paper. []

L e m m a 6. A smallest UFA recognizing L~ has 2 ~

P r o o f . First, by removing the dead state f rom the construct ion, we have a UFA with 2 '~ - 1 states. technique in t roduced in [Sc78] to show tha t any 2 '~ - 1 states.

- 1 states.

DFA obta ined by the subset Next we are going to use a UFA would require at least

Let U be a UFA recognizing Ln with the finite set of states denoted by K. Let R be a mat r ix over the field of characterist ic 2 with rows indexed by K and columns indexed by the n o n e m p t y subsets of Q such tha t R(k, P ) = 1 if U can reach a final s tate s tar t ing f rom state k E K on consuming wp accept, and R(k, P ) = 0 otherwise.

We claim tha t any row in M,~ is a linear combinat ion of the rows in R. Given a n o n e m p t y subset P of Q, let K ~ C K be the set of s tates reached by U f rom the set of s tar t ing states on consuming up. For any kl r k2 E K ' and for any n o n e m p t y subset P ' of Q, R(k~, Pi) and R(k2, P') cannot bo th have value one; tha t is, at mos t one of R(k, P'), for k E K ~, is 1. Otherwise, there are two different accepting paths for upwp, accept in U, which contradicts to the assumpt ion tha t U is unambiguous~ Thus , the row indexed by P in M~ is the sum of the rows indexed by K t in R.

Therefore, the rank of M~ is less than or equal to the rank of R. Hence, K mus t have at least 2 '~ - 1 states so tha t the rank of R is at least 2 n - 1. []

L e m m a 7. Any UFA recognizing L such that prefix(L) = prefix(L~,) requires at least 2 n - 1 states~

P r o o f . Since L is regular, there exists a finite set of strings { 7 1 , - . . , 7h} C Z* such tha t for any z E prefix(L), exactly one of zTi , for 1 < i < h, is in L.

Let X be a 24 - 1 by h(2 '~ - l) mat r ix over the field of characterist ic 2 with rows indexed by the n o n e m p t y subsets of Q and columns indexed by {(P, i) I 0 ~ P C Q, 1 < i < h} such tha t X ( P , ( P ' , i ) ) = 1 if upwp,Ti G L, and X(P , ( P ' , i)) = 0 otherwise.

We claim tha t the rank of X is 2 ~ - 1. We define X ~ to be a 2 ~ - 1 by 2 ~ - 1 mat r ix over the field of characterist ic 2 with rows and columns indexed by the n o n e m p t y subsets of Q such tha t the column indexed by P is the sum of the h columns in X indexed by {(P~ i) I 1 < i < h}.

We want to show tha t X ~ is the same mat r ix as M~. T h a t is, we want to show tha t X' (P , P') = 1 if P [~ P~ • 0 and X' (P , P') = 0 otherwise.

Suppose P N P ' 7s O. By corollary 3, t tpwp, E prefix(Ln) = prefix(L). By the definition of 7i~s, exactly one of upwp,"fi , for 1 < i < h, is in L. T h a t is, exactly one of X(P , (P', i)), for 1 < i < h, is 1. Hence, X' (P , P') = 1.

Suppose P N P ' = 0 - B y corollary 3, upwp, ~ prefix(Ln) = prefix(L). There- fore, upwp, Ti ~ L for 1 < i < h. Hence, X(P, ( P ' , i ) ) = 0 for 1 < i < h and x ' ( P , P') = o.

By l emma 5, the rank of X ~ is 2 '~ - 1. Since each column of X / is obta ined by a linear combinat ion of the columns of X, the rank of X mus t be bigger than or

Page 7: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

227

equal to the r ank of X ~. Thus , the rank of X is a t least 2 '~ - 1. Moreover since the n u m b e r of rows in X is 2 '~ - 1, the rank of X is a t mos t 2 ~ - 1. Therefore.,

the rank of X is 2 '~ - 1. Final ly , since the rank of X is 2 '~ - 1 and by using the same technique as in

the p roo f of l e m m a 6, a smal l e s t UFA for L mus t have at least 2 '~ - 1 s ta tes . [] T h e fol lowing l e m m a is a genera l i za t ion of l e m m a 7. Th i s is because we can

ob t a in ] e m m a 7 by l e t t ing x to be the e m p t y s t r ing in the fol lowing l emma .

L e m I n a S . Let U be a UFA with the number of states less than 2 ~ - 1 which accepts L such that prefix(L) C_ prefix(L,~). Then for all x C prefix(L~),

x-l(prefi (L)) C x-l(prefix(L ))

P r o o f . F r o m prefix(L) C_ prefix( L~ ), i t is i m m e d i a t e t ha t x- l (pre f i x (L) ) C_ x-l(prefix(L,~)) for any a r b i t r a r y x. We wan t to show tha t x- l (pre f ix (L) ) x- (prefix(L )) for any x prefi (L ).

Suppose ti le con t r a ry t ha t x- l (pre f ix (L) ) = x - l (pre f ix (Ln) ) for some x E

prefix(Ln). Thus , z-~(prefix(L)) = z-~(prefix(Ln)) where z = x reset. Since z -1 and prefix commute , pre f ix (z - l (L) ) = pre f ix (z - l (Ln)) . Let L ' be z -Z(L) . Then we ob t a in prefix(L') = prefix(L~) since z - l ( L ~ ) = n , by the p r o p e r t y of reset.

We are going to cons t ruc t a UFA U' wi th less t han 2 ~ - 1 s ta tes to recognize L~; hence by l e m m a 7, a con t rad ic t ion .

T h e t r ans i t i on d i a g r a m for U ~ is the same as t ha t of U. The set of s t a r t i n g s ta tes for U' is defined to be the set of s ta tes reached by U on consuming z f rom the set of s t a r t i ng s ta tes of U. The set of f inal s ta tes for U ~ is aga in the s ame as t ha t of U. I t is clear t h a t the l anguage accepted by U ~ is L ~ = z - l ( L ) . Also, U ~ cannot be a m b i g u o u s o therwise U is also ambiguous . Moreover , the n u m b e r of s ta tes in U' is the s ame as the n u m b e r of s ta tes in U; therefore, it is less t h a n 2'~ _ 1. [3

T h e o r e m 9 . A smallest PNA recognizing L~ has 2 ~ - 1 states.

P r o o f . By r emov ing the dead s t a t e f rom the DFA ob ta ined by the subse t con- s t ruc t ion , we have a UFA, which is p o l y n o m i a l l y ambiguous , wi th 2 *~ - 1 s ta tes .

Let M be a P N A for Ln wi th the smal les t n u m b e r of s ta tes . Then every s t a t e in M mus t be useful. Cons ider the t r ans i t i on d i a g r a m of M . Let us look at one s t rong ly connected componen t , deno ted T~ tha t cannot be reached f rom o ther s t rong ly connected componen t s .

We c la im tha t T m u s t have at least 2 ~ - 1 s ta tes . Suppose the con t r a ry t ha t it has less than 2 '~ - 1 s ta tes .

T mus t have some s t a r t i n g s ta tes in it. Otherwise i t is not useflfl which con t r ad i c t s to the defini t ion of M . Let the set of s t a r t i ng s ta tes of M tha t a p p e a r in T be { P l , . . . , P k } .

Let 1 < i < k. We define an NFA Tp, such t ha t Pi is now the only s t a r t i n g and final s ta te , and the t r ans i t i on d i a g r a m for Tp, is T. We wan t to check t ha t l e m m a 8 can be app l i ed to the l anguage of Tp. Fi r s t , Tp~ has less t han 2 n - 1 s ta tes . Next , Tp, is a UFA; o therwise by the cha rac t e r i za t ion given in sect ion 2, M is

Page 8: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

228

strictly exponentially ambiguous, a contradiction. Let w E pref ix(L(Tp,)) . Then Pi must reach a nonempty subset of states in T on consuming w. Since all states in M are useful, w is therefore in prefix( Ln ). Hence, prefix(L(Tpz)) C_ prefix( Ln ).

Consider the set of UFAs {Tp, ] 1 < i < k}. Let x0 = r E prefix( L~ ). For 1 < i < k, we define xi to be a string chosen arbitrarily from

(xox l . . . x i - 1 ) - l ( p r e f i x ( L ~ )) - (X0Xl... x i -1 )-l(prejqx(L(Tp, )) .

Thus, x o x l . . , xi E prefix(Ln) for 0 < i < k. The existence of xi, for 1 < i < k, is then guaranted by lemma 8. Let x be xl . . .xk . By the way xi ' s are defined, x ~ pre.fix(L(Tp~)) for 1 < i < k. Thus, each UFA Tp~, 1 < i < k, reaches the empty set from the starting state Pi on consuming x since all states in Tp, are useful.

Let z = x resei. Since x E prefix(L~), then z-l(L,~) = L,~ by the property of reset.

Let us consider M again. From the set of starting states, M reaches a subset of states, denoted P, on consuming z. Since z E prefix(L~) and L ( M ) = L,~, P is not empty. Moreover, by the previous discussions, P does not include any state in T.

We define another NFA M' by removing the set of states in T from the state set of M and let P be the new set of starting states, whereas the set of final states is the set of final states of M minus the set of states in T. By the facts that M accepts L,~ and z - l ( L n ) = Ln, M I must also accept L~. But this is a contradiction since M' is now a PNA accepting L,~ with a smaller number of states than M.

Therefore, T cannot have less than 2 n - 1 states. Hence, M has at least 2 n - 1 states. []

A c k n o w l e d g e m e n t s . I gratefully thank Andreas Weber, Jonathan Goldstine and Detlef Wotschke for their valuable discussions.

References

[Ha69] F. Harary, Graph theory, Addison-Wesley, Reading~ MA, 1969. [HU79] J. Hopcroft and J. Ullman, Introduction to automata theory, languages and

computation, Addison-Wesley~ Reading, MA, 19790 [IR86] O. Ibarra and B. Ravikumar, On sparseness, ambiguity and other decision prob-

lems for acceptors and transducers, Proc. 3rd Annum Symposium on Theoretical Aspects of Computer Science, 1986, pp. 171-179.

[MFT1] A. Meyer and M. Fischer, Economy of description by automata, grammars, and formal systems, Proc. 12th Symposium on Switching and Automata Theory, 1971, pp. 188-191.

[Mo71] F. Moore, On the bounds for state-set size in the proofs of equivalence between deterministic, nondeterministic, and two-way finite automata, IEEE Trans. Com- put., 20 (1971), pp. 1211-1214.

IRe77] C. Reutenauer, Propridtds arithmdtiques et topologiques de sdries rationnelles en variables non commutatives, Th~se troisi~me cycle, Universit$ Paris VI, 1977.

Page 9: [Lecture Notes in Computer Science] Algorithms and Computation Volume 762 || Separating exponentially ambiguous NFA from polynomially ambiguous NFA

229

[RI89] B. Ravikumar and O. Ibarra, Relating the type of ambiguity of finite automata to the succinctness of their representation, SIAM J. Comput., 18 (1989), pp. 1263- 1282.

[Sc78] E. Schmidt, Succinctness of descriptions of context-free, regular, and finite lan- guages, Ph.D~ Thesis, Cornel] University, 1978.

[SH85] R. Stearns and H. Hunt, On the equivalence and containment problems for unambiguous regular expressions, regular grammars and finite automata, SIAM J. Comput., 14 (1985), pp. 598-611.

[WS91] A. Weber and H. Seidl, On the degree of ambiguity of finite automata, Theoret. Comput. Sci., 88 (1991), pp. 325-349.