General Algorithms for Testing the Ambiguity of Finite Automata

Size: px
Start display at page:

Download "General Algorithms for Testing the Ambiguity of Finite Automata"

Transcription

1 TR Generl Algorithms for Testing the Amiguity of Finite Automt Cyril Alluzen 1,, Mehryr Mohri 1,2, nd Ashish Rstogi 1 1 Cournt Institute of Mthemtil Sienes, 251 Merer Street, New York, NY Google Reserh, 76 Ninth Avenue, New York, NY Astrt. This pper presents effiient lgorithms for testing the finite, polynomil, nd eponentil miguity of finite utomt with ǫ-trnsitions. It gives n lgorithm for testing the eponentil miguity of n utomton A in time O( A 2 E), nd finite or polynomil miguity in time O( A 3 E). These ompleities signifintly improve over the previous est ompleities given for the sme prolem. Furthermore, the lgorithms presented re simple nd re sed on generl lgorithm for the omposition or intersetion of utomt. We lso give n lgorithm to determine the degree of polynomil miguity of finite utomton A tht is polynomilly miguous in time O( A 3 E). Finlly, we present n pplition of our lgorithms to n pproimte omputtion of the entropy of proilisti utomton. 1 Introdution The question of the miguity of finite utomt rises in vriety of ontets. In some ses, the pplition of n lgorithm requires n input utomton to e finitely miguous, in others the onvergene of ound or gurntee relies on tht finite miguity or the symptoti rte of the inrese of miguity s funtion of the string length. Thus, in ll these ses, one needs n lgorithm to test the miguity, either to determine if it is finite, or to estimte its symptoti rte of inrese. The prolem of testing miguity hs een etensively nlyzed in the pst. The prolem of determining the degree of miguity of n utomton with finite miguity ws shown to e PSPACE-omplete. However, testing finite miguity n e done in polynomil time using hrteriztion of polynomil nd eponentil miguity given y [6, 5, 9, 4, 11]. The most effiient lgorithms for testing polynomil nd eponentil miguity, nd therey testing finite miguity were presented y [10, 12]. The lgorithms presented in [12] ssume the input utomton to e ǫ-free, ut they re etended to the se where the utomton hs ǫ-trnsitions in [10]. In the presene of ǫ-trnsitions, the ompleity of the lgorithms given y [10] is O(( A E + A 2 Q )2 ) for testing the eponentil miguity of n utomton A nd O(( A E + A 2 Q )3 ) for testing This uthor s new ddress is: Google Reserh, 76 Ninth Avenue, New York, NY

2 polynomil miguity, where A E stnds for the numer of trnsitions nd A Q the numer of sttes of A. This pper presents signifintly more effiient lgorithms for testing finite, polynomil, nd eponentil miguity for the generl se of utomt with ǫ-trnsitions. It gives n lgorithm for testing the eponentil miguity of n utomton A in time O( A 2 E ), nd finite or polynomil miguity in time O( A 3 E ). The min ide ehind our lgorithms is to mke use of the omposition or intersetion of finite utomt with ǫ-trnsitions [8, 7]. The ǫ-filter used in these lgorithms ruilly helps in the nlysis nd test of the miguity. We lso give n lgorithm to determine the degree of polynomil miguity of finite utomton A tht is polynomilly miguous in time O( A 3 E ). Finlly, we present n pplition of our lgorithms to n pproimte omputtion of the entropy of proilisti utomton. The reminder of the pper is orgnized s follows. Setion 2 presents generl utomt nd miguity definitions. In Setion 3 we give rief desription of eisting hrteriztions for the miguity of utomt nd etend them to the se of utomt with ǫ-trnsitions. In Setion 4 we present our lgorithms for testing the finite, polynomil, nd eponentil miguity, nd the proof of their orretness. Setion 5 detils the relevne of these lgorithms to the pproimtion of the entropy of proilisti utomt. 2 Preliminries Definition 1. A finite utomton A is 5-tuple (Σ, Q, E, I, F) where: Σ is finite lphet; Q is finite set of sttes; I Q the set of initil sttes; F Q the set of finl sttes; nd E Q (Σ {ǫ}) Q finite set of trnsitions, where ǫ denotes the empty string. We denote y A Q the numer of sttes, y A E the numer of trnsitions nd y A = A E + A Q the size of n utomton A. Given stte q Q, E[q] denotes the set of trnsitions leving q. For two susets R Q nd R Q, we denote y P(R,, R ) the set of ll pths from stte q R to stte q R leled with Σ. We lso denote y p[π] the origin stte, y n[π] the destintion stte, nd y i[π] Σ the lel of pth π. A string Σ is epted y A if it lels suessful pth, i.e. pth from n initil stte to finl stte. A finite utomton A is trim if every stte of A elongs to suessful pth. A is unmiguous if for ny string Σ there is t most one suessful pth leled y in A, otherwise, A is sid miguous. The degree of miguity of string in A, denoted y d(a, ), is the numer of suessful pths in A leled y. Note tht if A ontins n ǫ-yle, there eist Σ suh tht d(a, ) =. Using depth-first serh restrited to ǫ-trnsitions, it n e deided in liner time whether A hs ǫ-yles. Thus, in the following, we will ssume without loss of generlity tht A is ǫ-yle free. The degree of miguity of A is defined s d(a) = sup Σ d(a, ). A is sid finitely miguous if d(a) < nd infinitely miguous if d(a) =. A is sid polynomilly miguous if there eists polynomil h in N[X] suh tht d(a, )

3 v p v () v p v () v q v 1 p 1 v 1 v 2 v 2 v d v 1 q u 2 1 p v 2 2 q u d 2 p v d d q d v d () Fig. 1. Illustrtion of the () (EDA), () (IDA) nd () (IDA d ) properties. h( ) for ll Σ. The miniml degree of suh polynomil is lled the degree of polynomil miguity of A, denoted y dp(a). By definition, dp(a) = 0 iff A is finitely miguous. When A is infinitely miguous ut not polynomilly miguous, we sy tht A is eponentilly miguous nd tht dp(a) =. 3 Chrteriztion of infinite miguity The hrteriztion nd test of finite, polynomil, nd eponentil miguity of finite utomt without e-trnsitions re sed on the following fundmentl properties. [6, 5, 9, 4, 11, 10, 12]. Definition 2. The following re three key properties for the hrteriztion of the miguity of n utomt A. () (EDA): There eists stte q with t lest two distint yles leled y some v Σ (Figure 1()). () (IDA): There eist two distint sttes p nd q with pths leled with v from p to p, p to q, nd q to q, for some v Σ (Figure 1()). () (IDA d ): There eist 2d sttes p 1,... p d, q 1,..., q d in A nd 2d 1 strings v 1,..., v d nd u 2,...u d in Σ suh tht for ll 1 i d, p i q i nd P(p i, v i, p i ), P(p i, v i, q i ) nd P(q i, v i, q i ) re non-empty nd for ll 2 i d, P(q i 1, u i, p i ) is non-empty (Figure 1()). Oserve tht (EDA) implies (IDA). Assuming (EDA), let e nd e e the first trnsitions tht differ in the two yles t stte q, then we must hve n[e] n[e ] sine the definition 1 disllows multiple trnsitions etween the sme two sttes with the sme lel. Thus, (IDA) holds for the pir (n[e], n[e ]). In the ǫ-free se, it ws shown tht trim utomton A stisfies (IDA) iff A is infinitely miguous [11, 12], tht A stisfies (EDA) iff A is eponentilly miguous [4], nd tht A stisfies (IDA d ) iff dp(a) d [10, 12]. These hrteriztions n e strightforwrdly etended to the se of utomt with ǫ-trnsitions in the following proposition.

4 Proposition 1. Let A e trim ǫ-yle free finite utomton. (i) A is infinitely miguous iff A stisfies (IDA). (ii) A is eponentilly miguous iff A stisfies (EDA). (iii) dp(a) d iff A stisfies (IDA d ). Proof. The proof is y indution on the numer of ǫ-trnsitions in A. If A does not hve ny ǫ-trnsitions, then the proposition holds s shown in [11, 12] for (i), [4] for (ii) nd [12] for (iii). Assume now tht A hs n + 1 ǫ-trnsitions, n 0, nd tht the sttement of the proposition holds for ll utomt with n ǫ-trnsitions. Selet n ǫ-trnsition e 0 in A, nd let A e the finite utomton otined fter pplition of ǫ-removl to A limited to trnsition e 0. A is otined y deleting e 0 from A nd y dding trnsition (p[e 0 ], l[e], n[e]) for every trnsition e E[n[e 0 ]]. It is ler tht A nd A re equivlent nd tht there is lel-preserving ijetion etween the pths in A nd A. Thus, () A stisfies (IDA) (resp. (EDA), (IDA d )) iff A stisfies (IDA) (resp. (EDA), (IDA d )) nd () for ll Σ, d(a, ) = d(a, ). By indution, proposition 1 holds for A nd thus, it follows from () nd () tht proposition 1 lso holds for A. These hrteriztions hve een used in [10, 12] to design lgorithms for testing infinite, polynomil, nd eponentil miguity, nd for omputing the degree of polynomil miguity in the ǫ-free se. Theorem 1 ([10, 12]). Let A e trim ǫ-free finite utomton. 1. It is deidle in time O( A 3 E ) whether A is infinitely miguous. 2. It is deidle in time O( A 2 E ) whether A is eponentilly miguous. 3. The degree of polynomil miguity of A, dp(a), n e omputed in O( A 3 E ). The first result of theorem 1 hs lso een generlized y [10] to the se of utomt with ǫ-trnsitions ut with signifintly worse ompleity. Theorem 2 ([10]). Let A e trim ǫ-yle free finite utomton. It is deidle in time O(( A E + A 2 Q )3 ) whether A is infinitely miguous. The min ide used in [10] is to defined from A n ǫ-free utomton A suh tht A is infinitely miguous iff A is infinitely miguous. However, the numer of trnsitions of A is A E + A 2 Q. This eplins why the ompleity in the ǫ-trnsition se is signifintly worse thn in the ǫ-free se. A similr pproh n e used strightforwrdly to test the eponentil miguity of A with ompleity O(( A E + A 2 Q )2 ) nd to ompute dp(a) when A is polynomilly miguous with ompleity O(( A E + A 2 Q )3 ). Note tht we give here tighter estimtes of the ompleity of the lgorithms of [10, 12] where the uthors gve ompleities using the loose inequlity: A E Σ A 2 Q. 4 Algorithms Our lgorithms for testing miguity re sed on generl lgorithm for the omposition or intersetion of utomt, whih we desrie in the following setion oth to e self-ontined, nd to give proof of the orretness of the ǫ-filter whih we hve not presented in erlier pulitions.

5 ,0 1,1 0,1 2,1 3,2 3,1 3,3 () () () Fig. 2. Emple of finite utomton intersetion. () Finite utomt A 1 nd () A 2. () Result of the intersetion of A 1 nd A Intersetion of finite utomt The intersetion of finite utomt is speil se of the generl omposition lgorithm for weighted trnsduers [8, 7]. Sttes in the intersetion A 1 A 2 of two finite utomt A 1 nd A 2 re identified with pirs of stte of A 1 nd stte of A 2. Leving side ǫ-trnsitions, the following rule speifies how to ompute trnsition of A 1 A 2 from pproprite trnsitions of A 1 nd A 2 : (q 1,, q 1 ) nd (q 2,, q 2 ) = ((q 1, q 1 ),, (q 2, q 2 )). (1) Figure 2 illustrtes the lgorithm. A stte (q 1, q 2 ) is initil (resp. finl) when q 1 nd q 2 re initil (resp. finl). In the worst se, ll trnsitions of A 1 leving stte q 1 mth ll those of A 2 leving stte q 2, thus the spe nd time ompleity of omposition is qudrti: O( A 1 A 2 ), or O( A 1 E A 2 E ) when A 1 nd A 2 re trim. Epsilon filtering A strightforwrd generliztion of the ǫ-free se would generte redundnt ǫ-pths. This is ruil issue in the more generl se of the intersetion of weighted utomt over non-idempotent semiring, sine it would led to n inorret result. The weight of two mthing ǫ-pths of the originl utomt would then e ounted s mny times s the numer of redundnt ǫ-pths generted in the result, insted of one. It is lso ruil prolem in the unweighted se tht we re onsidering sine redundnt ǫ-pths n ffet the test of infinite miguity, s we shll see in the net setion. A ritil omponent of the omposition lgorithm of [8, 7] onsists however of preisely oping with this prolem using method lled epsilon filtering. Figure 3() illustrtes the prolem just mentioned. To mth ǫ-pths leving q 1 nd those leving q 2, generliztion of the ǫ-free intersetion n mke the following moves: (1) first move forwrd on n ǫ-trnsition of q 1, or even ǫ-pth, nd sty t the sme stte q 2 in A 2, with the hope of lter finding trnsition whose lel is some lel ǫ mthing trnsition of q 2 with the sme lel; (2) proeed similrly y following n ǫ-trnsition or ǫ-pth leving q 2 while stying t the sme stte q 1 in A 1 ; or, (3) mth n ǫ-trnsition of q 1 with n ǫ-trnsition of q 2. Let us renme eisting ǫ-lels of A 1 s ǫ 2, nd eisting ǫ-lels of A 2 ǫ 1, nd let us ugment A 1 with self-loop leled with ǫ 1 t ll sttes nd similrly, ugment A 2 with self-loop leled with ǫ 2 t ll sttes, s illustrted y Figures 3() nd (). These

6 (0,0) ǫ 1:ǫ 1 (1,0) ǫ 1:ǫ 1 (2,0) ǫ 2:ǫ 2 ǫ 2:ǫ 1 ǫ ǫ 2:ǫ 1 2:ǫ 2 ǫ 2:ǫ 2 ε1:ε1 ε 1 ε 2 ε 2 ε 1 (0,1) ǫ 2:ǫ 2 ǫ 1:ǫ 1 ǫ 2:ǫ 1 (1,1) ǫ 1:ǫ 1 (2,1) ε2:ε1 : ǫ ǫ 2:ǫ 1 2:ǫ 2 ǫ 0 2:ǫ 2 ε1:ε1 : ε2:ε2 1 ε2:ε2 ǫ 1:ǫ 1 ǫ 1:ǫ 1 : (0,2) (1,2) (2,2) () () () (d) 2 Fig. 3. Mrking of utomt, redundnt pths nd filter. () Ã1: self-loop leled with ǫ1 dded t ll sttes of A 1, regulr ǫs renmed to ǫ 2. () Ã2: self-loop leled with ǫ2 dded t ll sttes of A 2, regulr ǫs renmed to ǫ 1. () Redundnt ǫ-pths: strightforwrd generliztion of the ǫ-free se ould generte ll the pths from (0,0) to (2,2) for emple, even when omposing just two simple trnsduers. (d) Filter trnsduer M llowing unique ǫ-pth. self-loops orrespond to stying t the sme stte in tht mhine while onsuming n ǫ-lel of the other trnsition. The three moves just desried now orrespond to the mthes (1) (ǫ 2 :ǫ 2 ), (2) (ǫ 1 :ǫ 1 ), nd (3) (ǫ 2 :ǫ 1 ). The grid of Figure 3() shows ll the possile ǫ-pths etween intersetion sttes. We will denote y Ã1 nd Ã2 the utomt otined fter pplition of these hnges. For the result of intersetion not to e redundnt, etween ny two of these sttes, ll ut one pth must e disllowed. There re mny possile wys of seleting tht pth. One nturl wy is to selet the shortest pth with the digonl trnsitions (ǫ-mthing trnsitions) tken first. Figure 3() illustrtes in oldfe the pth just desried from stte (0, 0) to stte (1, 2). Remrkly, this filtering mehnism itself n e enoded s finite-stte trnsduer suh s the trnsduer M of Figure 3(d). We denote y (p, q) (r, s) to indite tht (r, s) n e rehed from (p, q) in the grid. Proposition 2. Let M e the trnsduer of Figure 3(d). M llows unique pth etween ny two sttes (p, q) nd (r, s), with (p, q) (r, s). Proof. Let denote (ǫ 1 :ǫ 1 ), denote (ǫ 2 :ǫ 2 ), denote (ǫ 2 :ǫ 1 ), nd let stnd for ny (:), with Σ. The following sequenes must e disllowed y shortest-pth filter with mthing trnsitions first:,,,. This is euse, from ny stte, insted of the moves or, the mthing or digonl trnsition n e tken. Similrly, insted of or, nd n e tken for n erlier mth. Conversely, it is ler from the grid or n immedite reursion tht filter disllowing these sequenes epts unique pth etween two onneted sttes of the grid. Let L e the set of sequenes over σ = {,,, } tht ontin one of the disllowed sequene just mentioned s sustring tht is L = σ ( )σ. Then L represents etly the set of pths llowed y tht filter nd is thus regulr lnguge. Let A e n utomton representing L (Figure 4()). An utomton representing L n

7 {0} {0,1} {0,2} {0,3} () () () Fig. 4. () Finite utomton A representing the set of disllowed sequenes. () Automton B, result of the determiniztion of A. Susets re indited t eh stte. () Automton C otined from B y omplementtion, stte 3 is not oessile. e onstruted from A y determiniztion nd omplementtion (Figures 4()-()). The resulting utomton C is equivlent to the trnsduer M fter removl of the stte 3, whih does not dmit pth to finl stte. Thus, to interset two finite utomt A 1 nd A 2 with ǫ-trnsitions, it suffies to ompute Ã1 M Ã2, using the the ǫ-free rules of intersetion or omposition. Theorem 3. Let A 1 nd A 2 e two finite utomt with ǫ-trnsitions. To eh pir (π 1, π 2 ) of suessful pths in A 1 nd A 2 shring the sme input lel Σ orresponds unique suessful pth π in A 1 A 2 leled y. Proof. This follows strightforwrdly from proposition Testing for infinite miguity We strt with test of the eponentil miguity of A. The key is tht the (EDA) property trnsltes into very simple property for A 2 = A A. Lemm 1. Let A e trim ǫ-yle free finite utomton. A stisfies (EDA) iff there eists strongly onneted omponent of A 2 = A A tht ontins two sttes of the form (p, p) nd (q, q ), where p, q nd q re sttes of A with q q. Proof. Assume tht A stisfies (EDA). There eist stte p nd string v suh tht there re two distint yles 1 nd 2 leled y v t p. Let e 1 nd e 2 e the first edges tht differ in 1 nd 2. We n then write 1 = πe 1 π 1 nd 2 = πe 2 π 2. If e 1 nd e 2 shre the sme lel, let π 1 = πe 1, π 2 = πe 2, π 1 = π 1 nd π 2 = π 2. If e 1 nd e 2 do not shre the sme lel, etly one of them must e n ǫ-trnsition. By symmetry, we n ssume without loss of generlity tht e 1 is the ǫ-trnsition. Let π 1 = πe 1, π 2 = π, π 1 = π 1 nd π 2 = ǫ 2 π 2. In oth ses, let q = n[π 1] = p[π 1] nd q = n[π 2 ] = p[π 2 ]. Oserve tht q q. Sine i[π 1 ] = i[π 2 ], π 1 nd π 2 re mthed y intersetion resulting in pth in A 2 from (p, p) to (q, q ). Similrly, sine i[π 1] = i[π 2], π 1 nd π 2 re mthed y intersetion resulting in pth from (q, q ) to (p, p). Thus, (p, p) nd (q, q ) re in the sme strongly onneted omponent of A 2.

8 Conversely, ssume tht there eist sttes p, q nd q in A suh tht q q nd tht (p, p) nd (q, q ) re in the sme strongly onneted omponent of A 2. Let e yle in (p, p) going through (q, q ), it hs een otined y mthing two yles 1 nd 2. If 1 were equl to 2, intersetion would mth these two pths reting pth long whih ll the sttes would e of the form (r, r), nd sine A is trim this would ontrdit Theorem 3. Thus, 1 nd 2 re distint nd (EDA) holds. Lemm 1 leds to strightforwrd lgorithm for testing eponentil miguity. Theorem 4. Let A e trim ǫ-yle free finite utomton. It is deidle in time O( A 2 E ) whether A is eponentilly miguous. Proof. The lgorithm proeeds s follows. We ompute A 2 nd, using depth-first serh of A 2, trim it nd ompute its strongly onneted omponents. It follows from Lemm 1 tht A is eponentilly miguous iff there is strongly onneted omponent tht ontins two sttes of the form (p, p) nd (q, q ) with q q. Finding suh strongly onneted omponent n e done in time liner in the size of A 2, i.e. in O( A 2 E ) sine A nd A2 re trim. Thus, the ompleity of the lgorithm is in O( A E 2 ). Testing the (IDA) property requires finding three pths shring the sme lel in A. This n e done in nturl wy using the utomton A 3 = A A A, s shown elow. Lemm 2. Let A e trim ǫ-yle free finite utomton. A stisfies (IDA) iff there eist two distint sttes p nd q in A with non-ǫ pth in A 3 = A A A from stte (p, p, q) to stte (p, q, q). Proof. Assume tht A stisfies (IDA). Then, there eists string v Σ with three pths π 1 P(p, v, p), π 2 P(p, v, q) nd π 3 P(q, v, p). Sine these three pths shre the sme lel v, they re mthed y intersetion resulting in pth π in A 3 leled with v from (p[π 1 ], p[π 2 ], p[π 3 ]) = (p, p, q) to (n[π 1 ], n[π 2 ], n[π 3 ]) = (p, q, q). Conversely, if there is non-ǫ pth π form (p, p, q) to (p, q, q) in A 3, it hs een otined y mthing three pths π 1, π 2 nd π 3 in A with the sme input v = i[π] ǫ. Thus, (IDA) holds. Finlly, Theorem 4 nd Lemm 2 n e omined to yield the following result. Theorem 5. Let A e trim ǫ-yle free finite utomton. It is deidle in time O( A 3 E ) whether A is finitely, polynomilly, or eponentilly miguous. Proof. First, Theorem 4 n e used to test whether A is eponentilly miguous y omputing A 2. The ompleity of this step is O( A 2 E ). If A is not eponentilly miguous, we proeed y omputing nd trimming A 3 nd then testing whether A 3 verifies the property desried in lemm 2. This is done y onsidering the utomton B on the lphet Σ = Σ {#} otined from A 3 y dding trnsition leled y # from stte (p, q, q) to stte (p, p, q) for every pir (p, q) of sttes in A suh tht p q. It follows tht A 3 verifies the ondition in lemm 2 iff there is yle in B ontining oth trnsition leled y # nd trnsition leled

9 y symol in Σ. This property n e heked strightforwrdly using depth-first serh of B to ompute its strongly onneted omponents. If strongly onneted omponent of B is found tht ontins oth trnsition leled with # nd trnsition leled y symol in Σ, A verifies (IDA) ut not (EDA) nd thus A is polynomilly miguous. Otherwise, A is finitely miguous. The ompleity of this step is liner in the size of B: O( B E ) = O( A E 3 + A Q 2 ) = O( A E 3 ) sine A nd B re trim. The totl ompleity of the lgorithm is O( A 2 E + A 3 E ) = O( A 3 E ). When A is polynomilly miguous, we n derive from the lgorithm just desried one tht omputes dp(a). Theorem 6. Let A e trim ǫ-yle free finite utomton. If A is polynomilly miguous, dp(a) n e omputed in time O( A 3 E ). Proof. We first ompute A 3 nd use the lgorithm of theorem 5 to test whether A is polynomilly miguous nd to ompute ll the pirs (p, q) tht verify the ondition of Lemm 2. This step hs ompleity O( A 3 E ). We then ompute the omponent grph G of A, nd for eh pir (p, q) found in the previous step, we dd trnsition leled with # from the strongly onneted omponent of p to the one of q. If there is pth in tht grph ontining d edges leled y #, then A verifies (IDA d ). Thus, dp(a) is the mimum numer of edges mrked y # tht n e found long pth in G. Sine G is yli, this numer n e omputed in liner time in the size of G, i.e. in O( A 2 Q ). Thus, the overll ompleity of the lgorithm is O( A 3 E ). 5 Applition to the Approimtion of Entropy In this setion, we desrie n pplition in whih determining the degree of miguity of proilisti utomton helps estimte the qulity of n pproimtion of its entropy. Weighted utomt re utomt in whih eh trnsition rries some weight in ddition to the usul lphet symol. The weights re elements of semiring, tht is ring tht my lk negtion. The following is more forml definition. Definition 3. A weighted utomton A over semiring (K,,, 0, 1) is 7-tuple (Σ, Q, I, F, E, λ, ρ) where: Σ is the finite lphet of the utomton, Q is finite set of sttes, I Q the set of initil sttes, F Q the set of finl sttes, E Q Σ {ǫ} K Q finite set of trnsitions, λ : I K the initil weight funtion mpping I to K, nd ρ : F K the finl weight funtion mpping F to K. Given trnsition e E, we denote y w[e] its weight. We etend the weight funtion w to pths y defining the weight of pth s the -produt of the weights of its onstituent trnsitions: w[π] = w[e 1 ] w[e k ]. The weight ssoited y weighted utomton A to n input string Σ is defined y: [A]() = λ[p[π]] w[π] ρ[n[π]]. (2) π P(I,,F)

10 The entropy H(A) of proilisti utomton A is defined s: H(A) = Σ [A]()log([A]()). (3) Let K denote (R {+, }) (R {+, }). The system (K,,, (0, 0), (1, 0)) where nd re defined s follows defines ommuttive semiring lled the entropy semiring [2]. For ny two pirs ( 1, y 1 ) nd ( 2, y 2 ) in K, ( 1, y 1 ) ( 2, y 2 ) = ( 1 + 2, y 1 + y 2 ) (4) ( 1, y 1 ) ( 2, y 2 ) = ( 1 2, 1 y y 1 ). (5) In [2], the uthors show tht generlized shortest-distne lgorithm over this semiring orretly omputes the entropy of n unmiguous proilisti utomton A. The lgorithm strts y mpping the weight of eh trnsition to pir where the first element is the proility nd the seond the entropy: w[e] (w[e], w[e] log w[e]). The lgorithm then proeeds y omputing the generlized shortest-distne under the entropy semiring, whih omputes the -sum of the weights of ll epting pths in A. In this setion, we show tht the sme shortest-distne lgorithm yields n pproimtion of the entropy of n miguous proilisti utomton A, where the pproimtion qulity is funtion of the degree of polynomil miguity, dp(a). Our proofs mke use of the stndrd log-sum inequlity [3], speil se of Jensen s inequlity, whih holds for ny positive rels 1,..., k, nd 1,..., k : k i log i i ( k ) k i log i k. (6) i Lemm 3. Let A e proilisti utomton nd let Σ + e string epted y A on k pths π 1,...,π k. Let w(π i ) e the proility of pth π i. Clerly, [A]() = k w(π i). Then, k w(π i )log w(π i ) [A]()(log[A]() log k). (7) Proof. The result follows strightforwrdly from the log-sum inequlity, with i = w(π i ) nd i = 1: kx w(π i) log w(π i)! P kx k w(π i) log w(πi) = [A]()(log[A]() log k). (8) k For proilisti utomton A, let S(A) e the quntity omputed y the generlized shortest-distne lgorithm with the entropy semiring. For n unmiguous utomton A, S(A) = H(A) [2].

11 Theorem 7. Let A e proilisti utomton nd let L denote the epeted length of strings epted y A (i.e. L = Σ [A]()). Then, 1. If A is finitely miguous with degree of miguity k (i.e. d(a) = k for some k N), then H(A) S(A) H(A) + log k. 2. If A is polynomilly miguous with degree of polynomil miguity k (i.e. dp(a) = k for some k N), then H(A) S(A) H(A) + k log L. Proof. The lower ound, S(A) H(A) follows from the oservtion tht for string tht is epted in A y k pths π 1,..., π k, k k k w(π i )log(w(π i )) ( w(π i ))log( w(π i )). (9) Sine the quntity k w(π i)log(w(π i )) is string s ontriution to S(A) nd the quntity ( k w(π i))log( k w(π i)) its ontriution to H(A), summing over ll epted strings, we otin H(A) S(A). Assume tht A is finitely miguous with degree of miguity k. Let Σ e string tht is epted on l k pths π 1,...,π l. By Lemm 3, l X Thus, w(π i) log w(π i) [A]()(log[A]() log l ) [A]()(log[A]() log k). (10) S(A) = X l X Σ w(π i) log w(π i) H(A) + X Σ (log k)[a]() = H(A) + log k. (11) This proves the first sttement of the theorem. Net, ssume tht A is polynomilly miguous with degree of polynomil miguity k. By Lemm 3, l X Thus, w(π i) log w(π i) [A]()(log[A]() log l ) [A]()(log[A]() log( k )). (12) S(A) H(A) + k[a]()log = H(A) + ke A [log ] (13) Σ H(A) + k log E A [ ] = H(A) + k log L, (y Jensen s inequlity) whih proves the seond sttement of the theorem. The qulity of the pproimtion of the entropy of proilisti utomton A depends on the epeted length L of n epted string. L n e omputed effiiently for n ritrry proilisti utomton using the epettion semiring nd the generlized shortest-distne lgorithms, using tehniques similr to the ones desried in [2]. The definition of the epettion semiring is identil to the entropy semiring. The only differene is in the initil step, where the weight of eh trnsition in A is mpped to pir of elements. Under the epettion semiring, the mpping is w[e] (w[e], w[e]).

12 6 Conlusion We presented simple nd effiient lgorithms for testing the finite, polynomil, or eponentil miguity of finite utomt with ǫ-trnsitions. We onjeture tht the runningtime ompleity of our lgorithms is optiml. These lgorithms hve vriety of pplitions, in prtiulr to test pre-ondition for the ppliility of other utomt lgorithms. Our pplition to the pproimtion of the entropy gives nother illustrtion of the pplitions of these lgorithms. Our lgorithms lso illustrte the prominent role plyed y the generl lgorithm for the intersetion or omposition of utomt nd trnsduers with ǫ-trnsitions in the design of testing lgorithms. Composition n e used to devise simple nd effiient testing lgorithms. We hve shown elsewhere how it n e used to test the funtionlity of finite-stte trnsduer or to test the twins property for weighted utomt nd trnsduers [1]. Aknowledgments. The reserh of Cyril Alluzen nd Mehryr Mohri ws prtilly supported y the New York Stte Offie of Siene Tehnology nd Ademi Reserh (NYS- TAR). This projet ws lso sponsored in prt y the Deprtment of the Army Awrd Numer W81XWH The U.S. Army Medil Reserh Aquisition Ativity, 820 Chndler Street, Fort Detrik MD is the wrding nd dministering quisition offie. The ontent of this mteril does not neessrily reflet the position or the poliy of the Government nd no offiil endorsement should e inferred. Referenes 1. Cyril Alluzen nd Mehryr Mohri. Effiient Algorithms for Testing the Twins Property. Journl of Automt, Lnguges nd Comintoris, 8(2): , Corinn Cortes, Mehryr Mohri, Ashish Rstogi, nd Mihel Riley. Effiient omputtion of the reltive entropy of proilisti utomt. In LATIN 2006, volume 3887 of Leture Notes in Computer Siene, pges Springer, Thoms M. Cover nd Joy A. Thoms. Elements of Informtion Theory. John Wiley & Sons, In., New York, Osr H. Irr nd Bl Rvikumr. On sprseness, miguity nd other deision prolems for eptors nd trnsduers. In STACS 1986, volume 210 of Leture Notes in Computer Siene, pges Springer, Gérrd Jo. Un lgorithme lulnt le rdinl, fini ou infini, des demi-groupes de mtries. Theoretil Computer Siene, 5(2): , Arnldo Mndel nd Imre Simon. On finite semigroups of mtries. Theoretil Computer Siene, 5(2): , Mehryr Mohri, Fernndo C. N. Pereir, nd Mihel Riley. Weighted Automt in Tet nd Speeh Proessing. In Proeedings of the 12th iennil Europen Conferene on Artifiil Intelligene (ECAI-96). John Wiley nd Sons, Fernndo Pereir nd Mihel Riley. Finite Stte Lnguge Proessing, hpter Speeh Reognition y Composition of Weighted Finite Automt. The MIT Press, Christophe Reutenuer. Propriétés rithmétiques et topologiques des séries rtionnelles en vrile non ommuttive. Thèse de troisième yle, Université Pris VI, 1977.

13 10. Andres Weer. Üer die Mehrdeutigkeit und Wertigkeit von endlihen, Automten und Trnsduern. Disserttion, Goethe-Universität Frnkfurt m Min, Andres Weer nd Helmut Seidl. On the degree of miguity of finite utomt. In MFCS 1986, volume 233 of Leture Notes in Computer Siene, pges Springer, Andres Weer nd Helmut Seidl. On the degree of miguity of finite utomt. Theoretil Computer Siene, 88(2): , 1991.

General Algorithms for Testing the Ambiguity of Finite Automata

General Algorithms for Testing the Ambiguity of Finite Automata Generl Algorithms for Testing the Amiguity of Finite Automt Cyril Alluzen 1,, Mehryr Mohri 2,1, nd Ashish Rstogi 1, 1 Google Reserch, 76 Ninth Avenue, New York, NY 10011. 2 Cournt Institute of Mthemticl

More information

General Algorithms for Testing the Ambiguity of Finite Automata and the Double-Tape Ambiguity of Finite-State Transducers

General Algorithms for Testing the Ambiguity of Finite Automata and the Double-Tape Ambiguity of Finite-State Transducers Interntionl Journl of Foundtions of Computer Science c World Scientific Pulishing Compny Generl Algorithms for Testing the Amiguity of Finite Automt nd the Doule-Tpe Amiguity of Finite-Stte Trnsducers

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS The University of ottinghm SCHOOL OF COMPUTR SCIC A LVL 2 MODUL, SPRIG SMSTR 2015 2016 MACHIS AD THIR LAGUAGS ASWRS Time llowed TWO hours Cndidtes my omplete the front over of their nswer ook nd sign their

More information

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version A Lower Bound for the Length of Prtil Trnsversl in Ltin Squre, Revised Version Pooy Htmi nd Peter W. Shor Deprtment of Mthemtil Sienes, Shrif University of Tehnology, P.O.Bo 11365-9415, Tehrn, Irn Deprtment

More information

A Disambiguation Algorithm for Finite Automata and Functional Transducers

A Disambiguation Algorithm for Finite Automata and Functional Transducers A Dismigution Algorithm for Finite Automt n Funtionl Trnsuers Mehryr Mohri Cournt Institute of Mthemtil Sienes n Google Reserh 51 Merer Street, New York, NY 1001, USA Astrt. We present new ismigution lgorithm

More information

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution Tehnishe Universität Münhen Winter term 29/ I7 Prof. J. Esprz / J. Křetínský / M. Luttenerger. Ferur 2 Solution Automt nd Forml Lnguges Homework 2 Due 5..29. Exerise 2. Let A e the following finite utomton:

More information

NON-DETERMINISTIC FSA

NON-DETERMINISTIC FSA Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is

More information

CS 573 Automata Theory and Formal Languages

CS 573 Automata Theory and Formal Languages Non-determinism Automt Theory nd Forml Lnguges Professor Leslie Lnder Leture # 3 Septemer 6, 2 To hieve our gol, we need the onept of Non-deterministi Finite Automton with -moves (NFA) An NFA is tuple

More information

General Suffix Automaton Construction Algorithm and Space Bounds

General Suffix Automaton Construction Algorithm and Space Bounds Generl Suffix Automton Constrution Algorithm nd Spe Bounds Mehryr Mohri,, Pedro Moreno, Eugene Weinstein, Cournt Institute of Mthemtil Sienes 251 Merer Street, New York, NY 10012. Google Reserh 76 Ninth

More information

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6 CS311 Computtionl Strutures Regulr Lnguges nd Regulr Grmmrs Leture 6 1 Wht we know so fr: RLs re losed under produt, union nd * Every RL n e written s RE, nd every RE represents RL Every RL n e reognized

More information

Nondeterministic Automata vs Deterministic Automata

Nondeterministic Automata vs Deterministic Automata Nondeterministi Automt vs Deterministi Automt We lerned tht NFA is onvenient model for showing the reltionships mong regulr grmmrs, FA, nd regulr expressions, nd designing them. However, we know tht n

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over

More information

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh Computtionl Biology Leture 8: Genome rerrngements, finding miml mthes Sd Mneimneh We hve seen how to rerrnge genome to otin nother one sed on reversls nd the knowledge of the preserved loks or genes. Now

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

More information

Petri Nets. Rebecca Albrecht. Seminar: Automata Theory Chair of Software Engeneering

Petri Nets. Rebecca Albrecht. Seminar: Automata Theory Chair of Software Engeneering Petri Nets Ree Alreht Seminr: Automt Theory Chir of Softwre Engeneering Overview 1. Motivtion: Why not just using finite utomt for everything? Wht re Petri Nets nd when do we use them? 2. Introdution:

More information

= state, a = reading and q j

= state, a = reading and q j 4 Finite Automt CHAPTER 2 Finite Automt (FA) (i) Derterministi Finite Automt (DFA) A DFA, M Q, q,, F, Where, Q = set of sttes (finite) q Q = the strt/initil stte = input lphet (finite) (use only those

More information

Finite State Automata and Determinisation

Finite State Automata and Determinisation Finite Stte Automt nd Deterministion Tim Dworn Jnury, 2016 Lnguges fs nf re df Deterministion 2 Outline 1 Lnguges 2 Finite Stte Automt (fs) 3 Non-deterministi Finite Stte Automt (nf) 4 Regulr Expressions

More information

Prefix-Free Regular-Expression Matching

Prefix-Free Regular-Expression Matching Prefix-Free Regulr-Expression Mthing Yo-Su Hn, Yjun Wng nd Derik Wood Deprtment of Computer Siene HKUST Prefix-Free Regulr-Expression Mthing p.1/15 Pttern Mthing Given pttern P nd text T, find ll sustrings

More information

CS 491G Combinatorial Optimization Lecture Notes

CS 491G Combinatorial Optimization Lecture Notes CS 491G Comintoril Optimiztion Leture Notes Dvi Owen July 30, August 1 1 Mthings Figure 1: two possile mthings in simple grph. Definition 1 Given grph G = V, E, mthing is olletion of eges M suh tht e i,

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix tries Definition of tri mtri is regulr rry of numers enlosed inside rkets SCHOOL OF ENGINEERING & UIL ENVIRONEN Emple he following re ll mtries: ), ) 9, themtis ), d) tries Definition of tri Size of tri

More information

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides. 1 PYTHAGORAS THEOREM 1 1 Pythgors Theorem In this setion we will present geometri proof of the fmous theorem of Pythgors. Given right ngled tringle, the squre of the hypotenuse is equl to the sum of the

More information

Introduction to Olympiad Inequalities

Introduction to Olympiad Inequalities Introdution to Olympid Inequlities Edutionl Studies Progrm HSSP Msshusetts Institute of Tehnology Snj Simonovikj Spring 207 Contents Wrm up nd Am-Gm inequlity 2. Elementry inequlities......................

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

2.4 Theoretical Foundations

2.4 Theoretical Foundations 2 Progrmming Lnguge Syntx 2.4 Theoretil Fountions As note in the min text, snners n prsers re se on the finite utomt n pushown utomt tht form the ottom two levels of the Chomsky lnguge hierrhy. At eh level

More information

Lecture Notes No. 10

Lecture Notes No. 10 2.6 System Identifition, Estimtion, nd Lerning Leture otes o. Mrh 3, 26 6 Model Struture of Liner ime Invrint Systems 6. Model Struture In representing dynmil system, the first step is to find n pproprite

More information

Descriptional Complexity of Non-Unary Self-Verifying Symmetric Difference Automata

Descriptional Complexity of Non-Unary Self-Verifying Symmetric Difference Automata Desriptionl Complexity of Non-Unry Self-Verifying Symmetri Differene Automt Lurette Mris 1,2 nd Lynette vn Zijl 1 1 Deprtment of Computer Siene, Stellenosh University, South Afri 2 Merk Institute, CSIR,

More information

Compression of Palindromes and Regularity.

Compression of Palindromes and Regularity. Compression of Plinromes n Regulrity. Kyoko Shikishim-Tsuji Center for Lierl Arts Eution n Reserh Tenri University 1 Introution In [1], property of likstrem t t view of tse is isusse n it is shown tht

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18 Computt onl Biology Leture 18 Genome Rerrngements Finding preserved genes We hve seen before how to rerrnge genome to obtin nother one bsed on: Reversls Knowledge of preserved bloks (or genes) Now we re

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

CONTROLLABILITY and observability are the central

CONTROLLABILITY and observability are the central 1 Complexity of Infiml Oservle Superlnguges Tomáš Msopust Astrt The infiml prefix-losed, ontrollle nd oservle superlnguge plys n essentil role in the reltionship etween ontrollility, oservility nd o-oservility

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

6.5 Improper integrals

6.5 Improper integrals Eerpt from "Clulus" 3 AoPS In. www.rtofprolemsolving.om 6.5. IMPROPER INTEGRALS 6.5 Improper integrls As we ve seen, we use the definite integrl R f to ompute the re of the region under the grph of y =

More information

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs Isomorphism of Grphs Definition The simple grphs G 1 = (V 1, E 1 ) n G = (V, E ) re isomorphi if there is ijetion (n oneto-one n onto funtion) f from V 1 to V with the property tht n re jent in G 1 if

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 6: Minigoals Towards Simplifying and Rewriting Expressions MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

More information

Learning Partially Observable Markov Models from First Passage Times

Learning Partially Observable Markov Models from First Passage Times Lerning Prtilly Oservle Mrkov s from First Pssge s Jérôme Cllut nd Pierre Dupont Europen Conferene on Mhine Lerning (ECML) 8 Septemer 7 Outline. FPT in models nd sequenes. Prtilly Oservle Mrkov s (POMMs).

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

Lecture 6: Coding theory

Lecture 6: Coding theory Leture 6: Coing theory Biology 429 Crl Bergstrom Ferury 4, 2008 Soures: This leture loosely follows Cover n Thoms Chpter 5 n Yeung Chpter 3. As usul, some of the text n equtions re tken iretly from those

More information

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite! Solutions for HW9 Exerise 28. () Drw C 6, W 6 K 6, n K 5,3. C 6 : W 6 : K 6 : K 5,3 : () Whih of the following re iprtite? Justify your nswer. Biprtite: put the re verties in V 1 n the lk in V 2. Biprtite:

More information

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Siene Deprtment Compiler Design Spring 7 Lexil Anlysis Smple Exerises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sienes Institute 47 Admirlty Wy, Suite

More information

QUADRATIC EQUATION. Contents

QUADRATIC EQUATION. Contents QUADRATIC EQUATION Contents Topi Pge No. Theory 0-04 Exerise - 05-09 Exerise - 09-3 Exerise - 3 4-5 Exerise - 4 6 Answer Key 7-8 Syllus Qudrti equtions with rel oeffiients, reltions etween roots nd oeffiients,

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

Linear Algebra Introduction

Linear Algebra Introduction Introdution Wht is Liner Alger out? Liner Alger is rnh of mthemtis whih emerged yers k nd ws one of the pioneer rnhes of mthemtis Though, initilly it strted with solving of the simple liner eqution x +

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

Regular languages refresher

Regular languages refresher Regulr lnguges refresher 1 Regulr lnguges refresher Forml lnguges Alphet = finite set of letters Word = sequene of letter Lnguge = set of words Regulr lnguges defined equivlently y Regulr expressions Finite-stte

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

Figure 1. The left-handed and right-handed trefoils

Figure 1. The left-handed and right-handed trefoils The Knot Group A knot is n emedding of the irle into R 3 (or S 3 ), k : S 1 R 3. We shll ssume our knots re tme, mening the emedding n e extended to solid torus, K : S 1 D 2 R 3. The imge is lled tuulr

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then. pril 8, 2017 Mth 9 Geometry Solving vetor prolems Prolem Prove tht if vetors nd stisfy, then Solution 1 onsider the vetor ddition prllelogrm shown in the Figure Sine its digonls hve equl length,, the prllelogrm

More information

Hybrid Systems Modeling, Analysis and Control

Hybrid Systems Modeling, Analysis and Control Hyrid Systems Modeling, Anlysis nd Control Rdu Grosu Vienn University of Tehnology Leture 5 Finite Automt s Liner Systems Oservility, Rehility nd More Miniml DFA re Not Miniml NFA (Arnold, Diky nd Nivt

More information

Test Generation from Timed Input Output Automata

Test Generation from Timed Input Output Automata Chpter 8 Test Genertion from Timed Input Output Automt The purpose of this hpter is to introdue tehniques for the genertion of test dt from models of softwre sed on vrints of timed utomt. The tests generted

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Bisimulation, Games & Hennessy Milner logic

Bisimulation, Games & Hennessy Milner logic Bisimultion, Gmes & Hennessy Milner logi Leture 1 of Modelli Mtemtii dei Proessi Conorrenti Pweł Soboiński Univeristy of Southmpton, UK Bisimultion, Gmes & Hennessy Milner logi p.1/32 Clssil lnguge theory

More information

#A42 INTEGERS 11 (2011) ON THE CONDITIONED BINOMIAL COEFFICIENTS

#A42 INTEGERS 11 (2011) ON THE CONDITIONED BINOMIAL COEFFICIENTS #A42 INTEGERS 11 (2011 ON THE CONDITIONED BINOMIAL COEFFICIENTS Liqun To Shool of Mthemtil Sienes, Luoyng Norml University, Luoyng, Chin lqto@lynuedun Reeived: 12/24/10, Revised: 5/11/11, Aepted: 5/16/11,

More information

Model Reduction of Finite State Machines by Contraction

Model Reduction of Finite State Machines by Contraction Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900

More information

Symmetrical Components 1

Symmetrical Components 1 Symmetril Components. Introdution These notes should e red together with Setion. of your text. When performing stedy-stte nlysis of high voltge trnsmission systems, we mke use of the per-phse equivlent

More information

Discrete Structures Lecture 11

Discrete Structures Lecture 11 Introdution Good morning. In this setion we study funtions. A funtion is mpping from one set to nother set or, perhps, from one set to itself. We study the properties of funtions. A mpping my not e funtion.

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Thoery of Automata CS402

Thoery of Automata CS402 Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...

More information

A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA

A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA PHILIP DANIEL AND CHARLES SEMPLE Astrt. Amlgmting smller evolutionry trees into single prent tree is n importnt tsk in evolutionry iology. Trditionlly,

More information

@#? Text Search ] { "!" Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata

@#? Text Search ] { ! Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata g Text Serh @#? ~ Mrko Berezovský Rdek Mřík PAL 0 Nondeterministi Finite Automt n Trnsformtion NFA to DFA nd Simultion of NFA f Text Serh Using Automt A B R Power of Nondeterministi Approh u j Regulr Expression

More information

CS241 Week 6 Tutorial Solutions

CS241 Week 6 Tutorial Solutions 241 Week 6 Tutoril olutions Lnguges: nning & ontext-free Grmmrs Winter 2018 1 nning Exerises 1. 0x0x0xd HEXINT 0x0 I x0xd 2. 0xend--- HEXINT 0xe I nd ER -- MINU - 3. 1234-120x INT 1234 INT -120 I x 4.

More information

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings... Tle of contents: Lecture N0.... 3 ummry... 3 Wht does utomt men?... 3 Introduction to lnguges... 3 Alphets... 3 trings... 3 Defining Lnguges... 4 Lecture N0. 2... 7 ummry... 7 Kleene tr Closure... 7 Recursive

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer

More information

12.4 Similarity in Right Triangles

12.4 Similarity in Right Triangles Nme lss Dte 12.4 Similrit in Right Tringles Essentil Question: How does the ltitude to the hpotenuse of right tringle help ou use similr right tringles to solve prolems? Eplore Identifing Similrit in Right

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

Part 4. Integration (with Proofs)

Part 4. Integration (with Proofs) Prt 4. Integrtion (with Proofs) 4.1 Definition Definition A prtition P of [, b] is finite set of points {x 0, x 1,..., x n } with = x 0 < x 1

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Logic Synthesis and Verification

Logic Synthesis and Verification Logi Synthesis nd Verifition SOPs nd Inompletely Speified Funtions Jie-Hong Rolnd Jing 江介宏 Deprtment of Eletril Engineering Ntionl Tiwn University Fll 22 Reding: Logi Synthesis in Nutshell Setion 2 most

More information

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon LIP Lortoire de l Informtique du Prllélisme Eole Normle Supérieure de Lyon Institut IMAG Unité de reherhe ssoiée u CNRS n 1398 One-wy Cellulr Automt on Cyley Grphs Zsuzsnn Rok Mrs 1993 Reserh Report N

More information

Engr354: Digital Logic Circuits

Engr354: Digital Logic Circuits Engr354: Digitl Logi Ciruits Chpter 4: Logi Optimiztion Curtis Nelson Logi Optimiztion In hpter 4 you will lern out: Synthesis of logi funtions; Anlysis of logi iruits; Tehniques for deriving minimum-ost

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Hyers-Ulam stability of Pielou logistic difference equation

Hyers-Ulam stability of Pielou logistic difference equation vilble online t wwwisr-publitionsom/jns J Nonliner Si ppl, 0 (207, 35 322 Reserh rtile Journl Homepge: wwwtjnsom - wwwisr-publitionsom/jns Hyers-Ulm stbility of Pielou logisti differene eqution Soon-Mo

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

More information

THE PYTHAGOREAN THEOREM

THE PYTHAGOREAN THEOREM THE PYTHAGOREAN THEOREM The Pythgoren Theorem is one of the most well-known nd widely used theorems in mthemtis. We will first look t n informl investigtion of the Pythgoren Theorem, nd then pply this

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

More information

Fast index for approximate string matching

Fast index for approximate string matching Fst index for pproximte string mthing Dekel Tsur Astrt We present n index tht stores text of length n suh tht given pttern of length m, ll the sustrings of the text tht re within Hmming distne (or edit

More information

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic Chpter 3 Vetor Spes In Chpter 2, we sw tht the set of imges possessed numer of onvenient properties. It turns out tht ny set tht possesses similr onvenient properties n e nlyzed in similr wy. In liner

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Pure 2D Context-free Puzzle P system with Conditional Communication

Pure 2D Context-free Puzzle P system with Conditional Communication IOSR Journl of Mthemtis (IOSR-JM) e-issn: 78-578 p-issn: 39-765X. Volume 0 Issue 6 Ver. III (Nov - De. 04) PP 06- www.iosrjournls.org Pure D Context-free Puzzle P system with Conditionl Communition S.Hemlth

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,

More information

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours Mi-Term Exmintion - Spring 0 Mthemtil Progrmming with Applitions to Eonomis Totl Sore: 5; Time: hours. Let G = (N, E) e irete grph. Define the inegree of vertex i N s the numer of eges tht re oming into

More information

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Voting Prdoxes Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Voting Prdoxes Properties Arrow s Theorem Leture Overview 1 Rep

More information

Graph States EPIT Mehdi Mhalla (Calgary, Canada) Simon Perdrix (Grenoble, France)

Graph States EPIT Mehdi Mhalla (Calgary, Canada) Simon Perdrix (Grenoble, France) Grph Sttes EPIT 2005 Mehdi Mhll (Clgry, Cnd) Simon Perdrix (Grenole, Frne) simon.perdrix@img.fr Grph Stte: Introdution A grph-sed representtion of the entnglement of some (lrge) quntum stte. Verties: quits

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem. 27 Lesson 2: The Pythgoren Theorem nd Similr Tringles A Brief Review of the Pythgoren Theorem. Rell tht n ngle whih mesures 90º is lled right ngle. If one of the ngles of tringle is right ngle, then we

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information