Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 14, 2009 Final versions: June 15, 2009

Size: px
Start display at page:

Download "Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 14, 2009 Final versions: June 15, 2009"

Transcription

1 DCFS 2009 Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 14, 2009 Final versions: June 15, 2009 Quotient Complexity of Regular Languages Janusz Brzozowski David R. Cheriton School of Computer Science University of Waterloo Waterloo, ON Canada N2L 3G1 Abstract. The past research on the state complexity of operations on regular languages is examined, and a new approach based on an old method (derivatives of regular expressions) is presented. Since state complexity is a property of a language, it is appropriate to define it in formallanguage terms as the number of distinct quotients of the language, and to call it quotient complexity. The problem of finding the quotient complexity of a language f(k, L) is considered, where K and L are regular languages and f is a regular operation, for example, union or concatenation. Since quotients can be represented by derivatives, one can find a formula for the typical quotient of f(k, L) in terms of the quotients of K and L. To obtain an upper bound on the number of quotients of f(k, L) all one has to do is count how many such quotients are possible, and this makes automaton constructions unnecessary. The advantages of this point of view are illustrated by many examples. Moreover, new general observations are presented to help in the estimation of the upper bounds on quotient complexity of regular operations. Keywords: automaton, derivative, expression, language, operation, quotient, rational, regular, state complexity, upper bound 1 Introduction It is assumed that the reader is familiar with the basic concepts of regular languages and finite automata, as described in many textbooks. General background material can be found in Dominique Perrin s [25] (1990) and Sheng Yu s [30] (1997) handbook articles; the latter has an introduction to state complexity. A more detailed treatment of state complexity can be found in Sheng Yu s survey [31]. The present paper concentrates on the complexity of basic operations on regular languages. Other aspects of complexity of regular languages and finite automata are discussed in [2, 6, 9, 14, 16, 18, 28, 29]; this list is not exhaustive, but it should give the reader a good idea of the scope of the work on this topic. This research was supported by the Natural Sciences and Engineering Research Council of Canada under grant no. OGP

2 2 J. Brzozowski 2 State complexity or quotient complexity? The English term state complexity of a regular language seems to have been introduced by Birget 1 [1] in 1991, and is now in common use. It is defined as the number of states in the minimal deterministic finite automaton (DFA) accepting the language [31]. There had been much earlier studies of this topic, but the term state complexity was not used. For example, in 1963 Lupanov [20] showed that the bound 2 n is tight for the conversion of nondeterministic finite automata (NFA s) to DFA s, and he used the term slozhnost avtomatov, meaning complexity of automata representing the same set of words. The case of languages over a one-letter alphabet was studied in 1964 by Lyubich [21]. Lupanov s result is almost unknown in the English-language literature, and is often attributed to the 1971 paper by Moore [23]. In 1970, Maslov [22] studied the complexity of basic operations on regular languages, and stated without proof some tight bounds for these operations. In the introduction to his paper he states: An important characteristic of the complexity of these sets [of words] is the number of states of the minimal representing automaton. 2 In 1981 Leiss [19] referred to (deterministic) complexity of languages. Some additional references to early works related to this topic can be found in [11, 31], for example. A language is a subset of the free monoid Σ generated by a finite alphabet Σ. If state complexity is a property of a language, then why is it defined in terms of a completely different object, namely an automaton? Admittedly, regular languages and finite automata are closely related, but there is a more natural way to define this complexity of languages, as is shown below. The left quotient, or simply quotient of a language L by a word w is defined as the language w 1 L = {x Σ wx L}. The quotient complexity of L is the number of distinct languages that are quotients of L, and will be denoted by κ(l) (kappa for both kwotient and komplexity). Quotient complexity is defined for any language, and so may be finite or infinite. Since languages are sets, it is natural to define set operations on them. The following are typical set operations: complement (L = Σ \ L), union (K L), intersection (K L), difference (K \ L), and symmetric difference (K L). A general boolean operation with two arguments is denoted by K L. Since languages are also subsets of a monoid, it is also natural to define product, usually called (con)catenation, (K L = {w Σ w = uv,u K,v L}), star (K = i 0 Ki ), and positive closure (K + = i 1 Ki ). The operations union, product and star are called rational or regular. Rational (or regular) languages over Σ are those languages that can be obtained from the set {, {ε}} {{a} a Σ} of basic languages, where ε is the empty word, (or, equivalently, from another basis, such as the finite languages over Σ) using 1 An error in [1] was corrected in [32]. 2 The emphasis is mine.

3 Quotient Complexity of Regular Languages 3 a finite number of rational operations. Since it is cumbersome to describe regular languages as sets for example, one has to write L = ({ε} {a}) {b} one normally switches to regular (or rational) expressions. These are the terms of the free algebra over the set Σ {,ε} with function symbols 3,, and [25]. For the example above, one writes E = (ε a) b. The mapping L from this free algebra onto the algebra of regular languages is defined inductively as follows: L( ) =, L(ε) = {ε}, L(a) = {a}, L(E F) = L(E) L(F), L(E F) = L(E) L(F), L(E ) = (L(E)), where E and F are regular expressions. The product symbol is usually dropped, and languages are denoted by expressions without further mention of the mapping L. Since regular languages are closed under complementation, complementation is treated here as a regular operator. Because regular languages are defined by regular expressions, it is natural to use regular expressions also to represent their quotients; these expressions are their derivatives [4]. First, the ε-function of a regular expression L, denoted by L ε, is defined as follows: a ε = {, if a =, or a Σ; ε, if a = ε. (1) (L) ε = {, if L ε = ε; ε, if L ε =. (2) (K L) ε = K ε L ε, (KL) ε = K ε L ε, (L ) ε = ε. (3) One verifies that L(L ε ) = {ε} if ε L, and L(L ε ) =, otherwise. The derivative by a letter a Σ of a regular expression L is denoted by L a and defined by structural induction: b a = {, if b {,ε}, or b Σ and b a; ε, if b = a. (4) (L) a = L a, (K L) a = K a L a, (KL) a = K a L K ε L a, (L ) a = L a L. (5) The derivative by a word w Σ of a regular expression L is denoted by L w and defined by induction on the length of w: L ε = L, L w = L a, if w = a Σ, L wa = (L w ) a. (6) A derivative L w is accepting if ε L w ; otherwise it is rejecting. One can verify by structural induction that L(L a ) = a 1 L, for all a Σ, and then by induction on the length of w that, for all w Σ, 3 The symbol + is used instead of in [25]. L(L w ) = w 1 L. (7)

4 4 J. Brzozowski Thus every derivative represents a unique quotient of L, but there may be many derivatives representing the same quotient. Two regular expressions are similar [3, 4] if one can be obtained from the other using the following rules: L L = L, K L = L K, K (L M) = (K L) M, (8) L = L, L = L =, εl = Lε = L. (9) Upper bounds on the number of dissimilar derivatives, and hence on the quotient complexity, were derived in [3, 4]: If m and n are the quotient complexities of K and L, respectively, then κ(l) = κ(l), κ(k L) mn, κ(kl) m2 n, κ(l ) 2 n 1. (10) This immediately implies that the number of derivatives, and hence the number of quotients, of a regular language is finite. It seems that the upper bounds in Equation (10), derived in 1962 [3, 4], were the first state complexity bounds to be found for the regular operations. Since the aim at that time was simply to show that the number of quotients of a regular language is finite, the tightness of the bounds was not considered. Of course, the concepts above are related to the more commonly used ideas. A deterministic finite automaton, or simply automaton, is a tuple A = (Q,Σ,δ,q 0,F), where Q is a finite, non-empty set of states, Σ is a finite, non-empty alphabet, δ : Q Σ Q is the transition function, q 0 Q is the initial state, and F Q is the set of final states. The transition function is extended to δ : Q Σ Q as usual. A word w is recognized (or accepted) by automaton A if δ(q 0,w) F. It was proved by Nerode [24] that a language L is recognizable by a finite automaton if and only if L has a finite number of quotients. The quotient automaton of a regular language L is A = (Q,Σ,δ,q 0,F), where Q = {w 1 L w Σ }, δ(w 1 L,a) = (wa) 1 L, q 0 = ε 1 L = L, and F = {w 1 L ε w 1 L}. It should now be clear that the state complexity of a regular language L is the number of states in its quotient automaton, i.e., the number κ(l) of its quotients. This terminology change may seem trivial, but has some nontrivial consequences. For convenience, derivative notation will be used to represent quotients, in the same way as regular expressions are used to represent regular languages. By convention, L ε w always means (L w) ε. 3 Derivation of bounds using quotients Since languages over one-letter alphabets have very special properties, we usually assume that the alphabet has at least two letters. The complexity of operations on unary languages has been studied in [26, 31].

5 Quotient Complexity of Regular Languages 5 In the literature on state complexity, it is assumed that automata A and B accepting languages K and L, respectively, are given. An assumption has to be made that the automata are complete, i.e., that for each q Q and a Σ, δ(q,a) is defined [33]. In particular, if a dead or sink state, which accepts no words, is present, one has to check that only one such state is included [7]. Also, every state must be useful in the sense that it appears on some accepting path [8]. Suppose that a bound on the state complexity of f(k,l) is to be computed, where f is some regular operation. In some cases a DFA accepting f(k,l) is constructed directly, (e.g., Theorems 2.3 and 3.1 in [33]), or an NFA with multiple initial states is used, and then converted to a DFA by the subset construction (e.g., Theorem 4.1 in [33]). Sometimes an NFA with empty-word transitions is used and then converted to a DFA [29]. The constructed automata then have to be proved minimal. Much of this is unnecessary. If quotients are used, the problem of completeness does not arise, since all the quotients of a language are included. A quotient is either empty or useful. If the empty quotient is present, then it appears only once. Since quotients are distinct languages, the set of quotients of a language is always minimal. To find an upper bound on the state complexity, instead of constructing an automaton for f(k,l), we need only find a regular expression for the typical quotient, and then do some counting. This is illustrated below for the basic regular operations. 3.1 Bounds for basic operations The following are some useful formulas for the derivatives of regular expressions: Theorem 1. If K and L are regular expressions, then (L) w = L w, (11) (K L) w = K w L w, (12) (KL) w = K w L K ε L w K ε ul v. (13) w=uv u,v Σ + For the Kleene star, (L ) ε = ε LL, and for w Σ +, (L ) w = (L ) ε ul v L. (14) w=uv u,v Σ Proof : Consider first the boolean operations. Since (K L) w = K w L w, and (L) w = L w, it follows that (K L) w = K w L w.

6 6 J. Brzozowski Equation 13 is easily verified by induction on the length w of a word w Σ. Thus (KL) w consists of K w L and a union (possibly empty) of derivatives of L. When w is in K, then ε K w and L is added to the union. For the star, the claim is obvious when w = ε. For w ε, we first prove that (L ) w = L w (L ) ε u L v L (15) w=uv u,v Σ + by induction on w. Let M = L. For w = a Σ, we have M a = L a L = L a M, by definition. This agrees with (15), because there is no decomposition a = uv with u,v Σ +. Now assume that (15) holds for w, and consider wa: M wa = L wa L ε wl a = L wa L ε w MuL ε va MuL ε ε vl a M w=uv u,v Σ + MuL ε ε v L a MuL ε va w=uv u,v Σ + w=uv u,v Σ + From (15), for w ε, Mw ε = L ε w w=uv Mε ul ε v; thus we have u,v Σ + M wa = L wa Mw ε L a Mu ε L va M = L wa w=uv u,v Σ + M. ε Mx L y wa=xy x,y Σ + M. So the induction step goes through, and we have (15). Note that M = MM; thus w M implies M w = (L ) w L LL = LM, and we have proved a useful alternate version of (15): M w = L w MwL ε M ε ul v M = S(w)M, (16) w=uv u,v Σ + ( where S(w) = L w MwL ε ) w=uv Mε ul v. Finally, note that L w = MεL ε w ; ( u,v Σ ) + hence S(w) = w=uv Mε u,v Σ u L v and we have (14). Theorem 1 can be applied to obtain upper bounds on the complexity of operations. In Theorem 2 below, the second part is a slight generalization of the bound in Theorem 4.3 of [33]. The third and fourth parts are reformulations of the bounds in Theorem 2.3 and 2.4, and of Theorem 3.1 of [33]: Theorem 2. For any languages K and L with κ(k) = m and κ(l) = n, (I) κ(l) = n. (II) κ(k L) mn.

7 Quotient Complexity of Regular Languages 7 (III) Suppose K has k accepting quotients and L has l accepting quotients. (A) If k = 0 or l = 0, then κ(kl) = 1. (B) If k,l > 0 and n = 1, then κ(kl) m (k 1). (C) If k,l > 0 and n > 1, then κ(kl) m2 n k2 n 1. (IV)(A) If n = 1, then κ(l ) 2. (B) If n > 1 and L ε is the only accepting quotient of L, then κ(l ) = n. (C) If n > 1 and L has l > 0 accepting quotients not equal to L, then κ(l ) 2 n n l 1. Proof : The first part is well-known, and the second follows from (12). For the product, if k = 0 or l = 0, then KL = and κ(kl) = 1. Thus assume that k,l > 0. If n = 1, then L = Σ and w K implies (KL) w = Σ. Thus all k accepting quotients of K produce the one quotient Σ in KL. For each rejecting quotient of K, we have two choices for the union of quotients of L in (13): the empty union or Σ. If we choose the empty union, we can have at most m k quotients of KL. Choosing Σ results in (KL) w = Σ, which has been counted already. Altogether, there are at most 1 + m k quotients of KL. Suppose now that k,l > 0 and n > 1. If w / K, then we can choose K w in m k ways, and the union of quotients of L in 2 n ways. If w K, then we can choose K w in k ways, and the set of quotients of L in 2 n 1 ways, since L is then always present. Thus we have (m k)2 n + k2 n 1. For the star, if n = 1, then L = or L = Σ. In the first case, L = ε, and κ(l ) = 2; in the second case, L = Σ and κ(l ) = 1. Now suppose that n > 1; hence L has at least one accepting quotient. If L is the only accepting quotient of L, then L = L and κ(l ) = κ(l). Now assume that n > 1 and l > 0. From (14), every quotient of L by a nonempty word is a union of a subset of quotients of L, followed by L. Moreover, that union is non-empty, because (L ) ε ε L w is always present. We have two cases: (I) Suppose L is rejecting. Then L has l accepting quotients. (A) If no accepting quotient of L is included in the subset, then there are 2 n l 1 such subsets possible, the union being non-empty because L w is always included. (B) If an accepting quotient of L is included, then ε (L ) w, (L ) ε w = ε, and L = (L ) ε wl ε is also included. We have 2 l 1 non-empty subsets of accepting quotients of L and 2 n l 1 subsets of rejecting quotients, since L is not counted. Adding 1 for (L ) ε, we have a total of 2 n l 1 + (2 l 1)2 n l = 2 n n l 1. (II) Suppose L is accepting. Then L has l + 1 accepting quotients. (A) If there is no accepting quotient, there are 2 n l 1 1 non-empty subsets of rejecting quotients. (B) If an accepting quotient of L is included, then L is included, and 2 n 1 subsets can be added to L.

8 8 J. Brzozowski We need not add (L ) ε, since ǫ LL = LL in this case, and this has already been counted. The total is 2 n n l 1. The worst-case bound of 2 n n l 1 occurs in the first case only. 3.2 Witnesses to bounds for basic operations Finding witness languages showing that a bound is tight is often challenging. However, once a guess is made, the verification can be done using quotients. Let w a be the number of a s in w, for a Σ and w Σ. Unary, binary, and ternary languages are languages over a one-, two-, and three-letter alphabet, respectively. Union and Intersection If we have a bound for intersection, then for union we can use the fact that κ(k L) = κ(k L) = κ(k L); thus the pair (K,L) is a witness for union. Similarly, given a witness for union, we also have a witness for intersection. The upper bound mn for the complexity of intersection was observed in by Rabin and Scott [27]. Binary languages K = {w {a,b} w a m 1 mod m} and L = {w {a,b} w b n 1 mod n} have quotient complexities m and n, respectively. In 1970 Maslov [22] stated without proof that K L meets this upper bound mn. Yu, Zhuang and K. Salomaa [33], used similar languages K = {w {a,b} w a 0 mod m} and L = {w {a,b} w b 0 mod n} for intersection, apparently unaware of [22]. Hricko, Jirásková and Szabari [11] showed that a complete hierarchy of quotient complexities of binary languages exists between the minimum complexity 1 and the maximum complexity mn. More specifically, it was proved that for any integers m,n,α such that m 2, n 2 and 1 α mn, there exist binary 5 languages K and L such that κ(k) = m, κ(l) = n, and κ(k L) = α, and the same holds for intersection. For a one-letter alphabet Σ = {a}, Yu showed that the bound can be reached if m and n are relatively prime [31]. The witnesses are K = (a m ) and L = (a n ). For other cases, see the paper by Pighizzini and Shallit [26]. Set difference For set difference we have κ(k \ L ) = κ(k L ); thus the pair (K,L ) is a witness. Symmetric difference For symmetric difference, let m, n 1, let K = (b a) m 1 (a b) and let L = (a b) n 1 (a b). There are mn words of the form a i b j, where 0 i m 1 and 0 j n 1. We claim that all the quotients of K L by these words are distinct. Let x = a i b j and y = a k b l. If i < k, let u = a m 1 k b n. Then xu / K, yu K, and xu,yu L, 4 The work was done in 1957, but published in The proof in [11] is for ternary languages; a proof for the binary case can be found in [10].

9 Quotient Complexity of Regular Languages 9 showing that xu K L, and yu / K L, i.e., that (K L) x (K L) y. Similarly, if j < l, let v = a m b n 1 l. Then xv K L, but yv / K L. Therefore all the quotients of K L by these mn words are distinct. For a one-letter alphabet, the witnesses are K and L as in the case of union above. Other boolean functions There are six more two-variable boolean functions that depend on both variables: K L = K L, K L = K L, K L = K \ L, K L = L\K, K L = L \ K, and K L. The witnesses for these functions can be found using the four functions above. Product The upper bound of m2 n 2 n 1 was given by Maslov in 1970 [22], and he stated without proof that it is tight for binary languages K = {w {a,b} w a m 1 mod m} and L = (a b) n 2 (a b)(b a(a b)). The bound was refined by Yu, Zhuang and K. Salomaa [33] to m2 n k2 n 1, where k is the number of accepting quotients of K. Jirásek, Jirásková and Szabari [12] proved that, for any integers m,n,k such that m 2, n 2 and 0 < k < m, there exist binary languages K and L such that κ(k) = m, κ(l) = n, and κ(kl) = m2 n k2 n 1. Furthermore, Jirásková [15] proved that, for all m, n, and α such that either n = 1 and 1 α m, or n 2 and 1 α m2 n 2 n 1, there exist languages K and L with κ(k) = m and κ(l) = n, defined over a growing alphabet, such that κ(kl) = α. For a one-letter alphabet, mn is a tight bound for product if m and n are relatively prime [33]. The witnesses are K = (a m ) a m 1 and L = (a n ) a n 1. See also [26]. Star Maslov [22] stated 6 without proof that κ(l ) 2 n 1 +2 n 2, and provided a binary language meeting this bound. Three cases were considered by Yu, Zhuang and K. Salomaa [33]: n = 1. If L =, then κ(l) = 1 and κ(l ) = 2. If L = Σ, then κ(l ) = 1. n = 2. L = {w {a,b} w a 1 mod 2} has κ(l) = 2, and κ(l ) = 3. n > 2. Let Σ = {a,b}. Then L = (b aσ n 1 ) aσ n 2 has n quotients, one of which is accepting, and κ(l ) = 2 n n 2. This example is different from Maslov s. Moreover, Jirásková [13] proved that, for all integers n and α with either 1 = n α 2, or n 2 and 1 α 2 n 1 +2 n 2, there exists a language L over a 2 n letter alphabet such that has κ(l) = n and κ(l ) = α. For a one-letter alphabet, n 2 2n + 2 is a tight bound for star [33]. The witness is L = (a n ) a n 1. See also [26]. 6 The bound is incorrectly stated as 2 n n 2 1, but the example is correct.

10 10 J. Brzozowski 4 Generalization of non-returning state A quotient L w of a language L is uniquely reachable if L x = L w implies that x = w. If L wa is uniquely reachable for a Σ, then so is L w. Thus, if L has a uniquely reachable quotient, then L itself is uniquely reachable by the empty word, i.e., the minimal automaton of L is non-returning 7. Thus the set of uniquely reachable quotients of L is a tree with root L, if it is non-empty. We now apply the concept of uniquely reachable quotients to boolean operations and product. Theorem 3. Suppose κ(k) = m, κ(l) = n, K and L have m u and n u uniquely reachable quotients, respectively, and there are r words w i such that both K wi and L wi are uniquely reachable. If is a boolean operator, then κ(k L) mn (α + β + γ), where (17) α = r(m+n) r(r+1); β = (m u r)(n (r+1)); γ = (n u r)(m m u 1). (18) If K has k accepting quotients, t of which are uniquely reachable, and s rejecting uniquely reachable quotients, then κ(kl) m2 n k2 n 1 s(2 n 1) t(2 n 1 1). (19) Proof : Suppose the quotients of K and L are K 1,...,K m and L 1,...,L n, respectively. Without loss of generality, we can assume that this numbering is such that K wi = K i and L wi = L i, for each i = 1,...,r. Moreover, assume that the remaining m u r uniquely reachable quotients of K are numbered K r+1,...,k mu, and the remaining n u r uniquely reachable quotients of L are L mu+1,...,l mu+(n u r). Because of (12), the number of quotients of K L is bounded from above by the number of pairs (K w,l w ). Consider first K w1 = K 1 and L w1 = L 1. Since K 1 can appear only with L 1 in any pair, we know that the n 1 pairs of the form (K 1,L j ), j > 1, and the m 1 pairs of the form (K i,l 1 ), i > 1 will never appear. Next, if K 2 and L 2 are both uniquely reachable, then we know that the n 2 pairs (K 2,L j ), j > 2, and m 2 pairs (K i,l 1 ), i > 2 will not appear. Finally, the n r pairs (K r,l j ), j > r, and the m r pairs (K i,l r ), i > r, will not appear. Thus, we have the following reduction due to the r pairs: α = m m r + n n r = r(m + n) r(r + 1). We have now examined r of the m u quotients that are uniquely reachable in K. For each of the remaining m u r uniquely reachable quotients of K we can eliminate n (r+1) pairs of the form (K i,l j ), r+1 < i < m u, where K w = K i, but L w L j. This yields the second part of the reduction: β = (m u r)(n (r+1)). For each of the n u r uniquely reachable quotients of L, we can eliminate m m u 1 pairs of the form (K i,l j ), r + 1 < i < m u, where L w = L j, but K w K i, obtaining the third reduction: γ = (n u r)(m m u 1). 7 The term non-returning suggests that once a state is left it cannot be visited again. However, such non-returning states are not necessarily uniquely reachable.

11 Quotient Complexity of Regular Languages 11 For the product, each quotient of KL corresponds to one of the m quotients of K together with a subset of the n quotients of L. If K w is rejecting, then it can appear with 2 n subsets of quotients of L. This gives (m k)2 n such possible quotients of KL. If a rejecting quotient of K is uniquely reachable, then it can appear with only one subset. Hence there is a savings of s(2 n 1). If K w is accepting, then L is always present in (KL) w. Hence there are at most k2 n 1 such possible quotients of KL. But, if t of the accepting quotients of K are uniquely reachable, then each can appear with only one subset of quotients of L that does not include L, for a saving of t(2 n 1 1). Altogether, we have at most (m k)2 n s(2 n 1) + k2 n 1 t(2 n 1 1) quotients of KL, as claimed. The following observation was stated for union and intersection of finite languages in [31]; we add the suffix-free case: Corollary 4. If K and L are non-empty and finite or suffix-free and κ(k) = m > 1, κ(l) = n > 1, then κ(k L) mn (m + n 2). Proof : The quotients K ε and L ε are uniquely reachable if K and L are finite. This also holds if K and L are suffix-free. For suppose L ε = L w. Since L is non-empty, we have ε L x for some x Σ. Then also ε L wx and both wx and x are in L, contradicting suffix-freeness. The bound mn (m + n 2) for union of suffix-free languages was shown to be tight for quinary languages by Han and Salomaa [7]. It is also tight for the binary languages K = a((ba ) m 3 b) (ba ) m 3 and L = a((a b) n 3 b) (a b) n 3, as shown recently by Jirásková and Olejár [17]. b b 1 a b 3 2 a a, b 4 7 a, b a 3 b 5 1 a b a 6 b a, b 2 b a a b a 4 a, b 5 (a) (b) Figure 1. Illustrating unique reachability. Example 5. The automaton of Fig. 1 (a) accepting K has m = 7 and four uniquely reachable states: 1, 2, 3, and 4. The automaton of Fig. 1 (b) accepting L has n = 5 and three uniquely reachable states: 1, 2, and 5. In pairs (1,1) and (2,2) both states are reachable by the same word (ε and b, respectively); hence r = 2. The m n = 7 5 table of all pairs is shown below, where uniquely reachable states are in boldface type. We have α = 18, where the removed pairs are all the

12 12 J. Brzozowski pairs in the first two rows and columns, except (1,1) and (2,2). Next, β = 4, and we remove the pairs (3,4), (3,5), (4,3) and (4,5) from rows 3 and 4. Finally, γ = 2, and we remove the pairs (6,5) and (7,5) from column 5. (1,1) (1, 2) (1, 3) (1, 4) (1, 5) (2, 1) (2,2) (2, 3) (2, 4) (2, 5) (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (5, 1) (5, 2) (5, 3) (5, 4) (5,5) (6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (7, 1) (7, 2) (7, 3) (7, 4) (7, 5) Altogether, we have removed 24 states from K L, leaving 11 possibilities. The minimal automaton of K L has 8 states. Notice that state 7 corresponds to the quotient Σ. Since Σ L w = Σ for all w, we need to account for only one pair (7, x), and we could remove the remaining four pairs. However, we have already removed pair (7,5) by Theorem 3. Hence, there are only three pairs left to remove, and we have an automaton with 8 states. More will be said about the effects of Σ later. It is also possible to use Theorem 3 if K has some uniquely reachable quotients and L has none, or when L is completely unknown. If n u = 0, then r = 0, α = 0, β = m u (n 1), and γ = 0. Then, for any L, κ(k L) mn m u (n 1). (20) For example, for any L with n = 101 and K as in Fig. 1 (a), κ(k L) 307, instead of the general bound 707. Let K and L be the automata of Fig. 1 (a) and (b), respectively. Then the general bound on κ(kl) is 192. Here s = 3 (states 1, 2, and 4), and t = 1 (state 3). By Theorem 3 the bound is reduced by = 108 to 84. The actual quotient complexity of KL is 14. The general bound for LK is 512, the reduced bound is 195, and the actual quotient complexity is Languages with ε, Σ +,, or Σ as quotients In this section we consider the effects of the presence of special quotients in a language. In particular, we study the quotients ε, Σ +,, and Σ. Theorem 6. If κ(k) = m, κ(l) = n, and K and L have k > 0 and l > 0 accepting quotients, respectively, then (I) If K and L have ε as a quotient, then κ(k L) mn 2. κ(k L) mn (2m + 2n 6). κ(k \ L) mn (m + 2n k 3). κ(k L) mn 2.

13 Quotient Complexity of Regular Languages 13 (II) If K and L have Σ + as a quotient, then κ(k L) mn 2. κ(k L) mn (2m + 2n 6). κ(k \ L) mn (2m + l 3). κ(k L) mn 2. (III) If K and L have as a quotient, then κ(k L) mn (m + n 2). κ(k \ L) mn n + 1. (IV) If K and L have Σ as a quotient, then κ(k L) mn (m + n 2). κ(k \ L) mn m + 1. (V) If L has ε as a quotient, then κ(l R ) 2 n Proof : If L has Σ + as a quotient, then κ(l R ) 2 n If L has as a quotient, then κ(l R ) 2 n 1. If L has Σ as a quotient, then κ(l R ) 2 n 1. Moreover, the effect of these quotients on complexity is cumulative. For example, if L R has both and Σ, then κ(l R ) 2 n 2, if L R has both and Σ +, then κ(l R ) 2 n 3 + 1, etc. (I) The quotient of ε by every non-empty word is ; thus, if L has ε, it also has. Since ε ε = ε = ε = ε, we subtract two quotients for union. For intersection, for any K u and L v, K u = L v =. This eliminates m 1+n 1 possibilities. Moreover, if K u,l v are rejecting, then K u ε = ε L v =. This removes another m k 1+n l 1 possibilities. If K u,l v are accepting, then K u ε = ε L v = ε, and k 1+l 1 quotients are removed. Altogether, κ(k L) mn (2m + 2n 6). For set difference, since K has and L w = for all w, this saves n 1 quotients. Since K has ε, if ε L w, then ε L w = ε; otherwise ε L w =. This saves another n 1 quotients. If L has ε and, then L has Σ + and Σ. For each rejecting quotient K w, we have K w Σ = K w Σ +. This saves another (m k) 1 quotients of K \ L. Since ε = ε = ε, and ε ε = = we can subtract two quotients for symmetric difference. (II) The proofs are dual to those of (i): The quotient of Σ + by every non-empty word is Σ ; thus, if L has Σ +, it also has Σ. Since Σ + Σ + = Σ Σ + = Σ + Σ = Σ +, we subtract two quotients for intersection. For union, for any K u and L v, K u Σ = Σ L v = Σ. This eliminates m 1 + n 1 possibilities. Moreover, if K u,l v are accepting, then K u Σ + = Σ + L v = Σ. This removes another k 1 + l 1

14 14 J. Brzozowski possibilities. If K u,l v are rejecting, then K u Σ + = Σ + L v = Σ +, removing m k 1 + n l 1 quotients. For set difference, if L has Σ + and Σ, then L has ε and. Since K w = for all w, this saves m 1 quotients. Also, if ε K w, then K w ε = ε, and otherwise K w ε =. This saves another m 1 quotients. Finally, for each accepting quotient L w, we have Σ L w = Σ + L w. This saves another l 1 quotients. Since Σ Σ + = Σ + Σ = ε and Σ Σ = Σ + Σ + =, we can subtract two quotients for symmetric difference. (III) Since K w = L w =, we can subtract (m 1)+(n 1) quotients. For difference, since L w = for all w, this saves n 1 quotients. (IV) Dual to iii. (V) The subset construction is used to convert the nondeterministic automaton N R, which is the reverse of the quotient automaton A recognizing L, to a deterministic automaton A R recognizing L R. In that construction, the state of N R corresponding to is not reachable from the set of initial states, and the state corresponding to ε appears only in the initial set of states, but is not reachable by any non-empty word from that set. Dually, the state corresponding to Σ appears in all the sets reachable from the set of initial states, and Σ + appears in all the sets reachable from the set of initial states, except the set of initial states. Corollary 7. If K and L are both non-empty and both suffix-free with κ(k) = m and κ(l) = n, then κ(k L) mn 2(m + n 3). Proof : We have shown in Corollary 4 that κ(k L) mn (m + n 2) by removing all pairs (K,L u ) and (K v,l), where L u L and K v K. If K is suffix-free, then it must have as a quotient [7], and the same holds for L. Thus all pairs of the form (K w, ) and (,L w ) are equivalent to (, ). We have already removed (K, ) and (,L) by unique reachability. Hence we can remove a further (m + n 2) 2 quotients, for a total of 2(m + n 3). It is shown in [7] that the bound can be reached with K = {#w w {a,b}, w a 0 mod m 2}, L = {#w w {a,b}, w b 0 mod n 2}. It was recently proved in [17] that this bound can be reached by the binary languages given after Corollary 4. Proposition 8. If κ(l) = n 3, L has l > 0 accepting quotients, and L has ε as a quotient, then κ(l ) 2 n n l

15 Quotient Complexity of Regular Languages 15 Proof : If L has ε, then it also has. From (14), every quotient of L by a non-empty word is a union of a non-empty subset of quotients of L, followed by L. We have two cases: (I) Suppose L is rejecting. (A) If no accepting quotient is included, then there are 2 n l 1 1 nonempty subsets of non-empty rejecting quotients plus the subset consisting of the empty quotient alone, for a total of 2 n l 1. (B) If an accepting quotient is included in the subset, then so is L. We can add the subset {ε} or any non-empty subset S of accepting quotients that does not contain ε, since S {ε} is equivalent to S. Thus we have 2 l 1 subsets of accepting quotients. To this we can add 2 n l 2 rejecting subsets, since the empty quotient and L need not be counted. The total is 2 l 1 2 n l 2 = 2 n 3. Adding 1 for (L ) ε, we have a total of 2 n n l (II) Suppose L is accepting. Since n 3, we have L ε. (A) If there is no accepting quotient, there are 2 n l 1 subsets, as before. (B) If an accepting quotient is included, then L is included and L itself is sufficient to guarantee that (L ) w is accepting. Since L ε = L = L, we also exclude ε and. Thus any one of the 2 n 3 subsets of the remaining quotients can be added to L. The total is 2 n n l 1. We need not add (L ) ε, since it is LL which has been counted already. The worst-case bound of 2 n n l occurs in the first case only. 6 Prefix-free languages As another example of the application of the quotient methods, we now derive the bounds for basic operations on prefix-free languages [8]. Proposition 9. If K and L are both prefix-free and non-empty with κ(k) = m and κ(l) = n, then (I) κ(k L) mn 2, (II) κ(k L) mn 2, (III) κ(k L) mn (2m + 2n 6), (IV) κ(kl) m + n 2, (V) κ(l ) n. Proof : If L is non-empty, then it has at least one accepting quotient L w. If L is also prefix-free, then ε L w implies L w = ε. Thus both K and L have ε as a quotient. Parts (i) (iii) follow directly from Theorem 6. For (iv), consider Equation (13). If K = ε, then m = 2, KL = L and κ(kl) = n. If n = 1, then L can only be Σ, which is not prefix-free. If n 2, then n m + n 2. Assume now that ε K; hence the term K ε L w is missing

16 16 J. Brzozowski in (13). Consider any w ε. If ε K w, K w, and ε K u for some proper prefix u of w = uv, then K cannot be prefix-free, because it contains u and wx, for some x Σ +. Thus, if K w is rejecting and non-empty, then (KL) w = K w L; there are m 2 such quotients, the remaining two quotients being ε and. If K w = ε, then (KL) w = L. Then (KL) wx = L x, for all x Σ, and there are n such quotients. If K w =, then (KL) w =, and this quotient has already been counted in the case where K w = ε and L x =. Thus the total is at most m + n 2. For (v), we have (L ) ε = L, and for w Σ +, consider Equation (14). By the argument we used in (iv), if L w is rejecting and non-empty, then (L ) w = L w L, and there are n 2 such quotients. If L w is accepting, then L w = ε, and (L ) w = L w L = L = (L ) ε. Finally, if L w =, then (L ) w may be empty, if for every prefix u of w, L u is rejecting. Thus the bound is n. It is shown in [8] that the bounds are tight: Let K = (a m 2 ) b and L = (a n 2 ) b. Then κ(kl) = m + n 2, and κ(l ) = n. If Σ = {a,b,c} and K = {wc w {a,b} and w a 0 mod m}, L = {wc w {a,b} and w b 0 mod n}, then κ(k L) = mn (2m + 2n 6). Finally, if Σ = {a,b,c,d} and then κ(k L) = mn 2. K = {wc w {a,b,d} and w a 0 mod m}, L = {wd w {a,b,c} and w b 0 mod n}, 7 Conclusions Quotients provide a uniform approach for finding upper bounds for the complexity of operations on regular languages, and for verifying that particular languages meet these bounds. It is hoped that this is a step towards a theory of complexity of languages and automata. Acknowledgments I am very grateful to Galina Jirásková for correcting several errors in early versions of this paper, suggesting better examples, improving proofs, and helping me with references, in particular, with the early work on complexity. I thank Sheng Yu for his help with references, and for answering many of my questions on complexity. I also thank Baiyu Li, Shengying Pan, and Jeff Shallit for their careful reading of the manuscript. References [1] J. C. Birget. Intersection of regular languages and state complexity. ACM SIGACT News, 22(2), 49, 1991.

17 Quotient Complexity of Regular Languages 17 [2] H. Bordihn, M. Holzer, M. Kutrib. State complexity of NFA to DFA conversion for subregular language families. Proc. DCFS 2008, C. Câmpeanu, G. Pighizzini, (eds.), University of Prince Edward Island, 85 96, [3] J. Brzozowski. Regular expression techniques for sequential circuits. PhD Dissertation, Department of Electrical Engineering, Princeton University, 242 pp., [4] J. Brzozowski. Derivatives of regular expressions. J. ACM, 11, , [5] C. Câmpeanu, K. Salomaa, K. Culik II, S. Yu. State complexity of basic operations on finite languages. Proc. WIA 1999, LNCS, 2214, 60 70, [6] H. Gruber, M. Holzer. Finite automata, digraph connectivity, and regular expression size. Proc. ICALP 2008, Part II, L. Aceto, I. Damgård, L. A. Goldberg, M. M. Halldórsson, A. Ingólfsdóttir, I. Walukiewicz, (eds.), LNCS, 5126, 39 50, [7] Y.-S. Han, K. Salomaa. State complexity of basic operations on suffix-free regular languages. Theoret. Comput. Sci., 410, , [8] Y.-S. Han, K. Salomaa, D. Wood. State complexity of prefix-free regular languages. Proc. DCFS 2006, , [9] M. Holzer, M. Kutrib. Descriptional and computational complexity of finite automata. Proc. LATA 2009, A. H. Dediu, A. M. Ionescu, C. Martin-Vide, (eds.), LNCS, 5457, 23 42, [10] M. Hricko. Finite automata, regular languages, and state complexity. Master s thesis. P. J. Šafárik University in Košice, Slovakia, [11] M. Hricko, G. Jirásková, A. Szabari. Union and intersection of regular languages and descriptional complexity. Proc. DCFS 2005, C. Mereghetti, B. Palano, G. Pighizzini, D. Wotschke (eds.), University of Milano, Milano, Italy, , [12] J. Jirásek, G. Jirásková, A. Szabari. State complexity of concatenation and complementation. Internat. J. Found. Comput. Sci., 16, , [13] G. Jirásková. On the state complexity of complements, stars, and reversals of regular languages. Proc. DLT 2008, M. Ito, M. Toyama, (eds.), LNCS 5257, , [14] G. Jirásková. Magic numbers and ternary alphabet. Proc. DLT 2009, V. Diekert, D. Nowotka, (eds.,) LNCS, 5583, , [15] G. Jirásková. Concatenation of regular languages and descriptional complexity. Proc. CSR 2009, to appear, [16] G. Jirásková, A. Okhotin. State complexity of cyclic shift. RAIRO Theor. Inform. Appl., 42, , [17] G. Jirásková, P. Olejár. State complexity of union and intersection of binary suffixfree languages. Manuscript, June [18] G. Jirásková, G. Pighizzini. Converting self-verifying automata into deterministic automata. Proc. LATA 2009, A. H. Dediu, A. M. Ionescu, C. Martin-Vide, (eds.), LNCS, 5457, , [19] E. Leiss. Succinct representation of regular languages by boolean automata. Theoret. Comput. Sci., 13, , [20] O. B. Lupanov. A comparison of two types of finite automata. Problemy Kibernetiki, 9, , 1963 (in Russian). German translation: Über den Vergleich zweier Typen endlicher Quellen. Probleme der Kybernetik 6, , 1966.

18 18 J. Brzozowski [21] Yu. I. Lyubich. Estimates for optimal determinization of nondeterministic autonomous automata. Sibirskii Matematicheskii Zhurnal, 5, , 1964 (in Russian). [22] A. N. Maslov. Estimates of the number of states of finite automata. Dokl. Akad. Nauk SSSR, 194, (in Russian) English translation: Soviet Math. Dokl , [23] F. R. Moore. On the bounds for state-set size in the proofs of equivalence between deterministic, nondeterministic, and two-way finite automata. IEEE Trans. Comput., C20 (10), , [24] A. Nerode. Linear automaton transformations. Proc. Amer. Math. Soc., 9, , [25] D. Perrin. Finite automata. Handbook of Theoretical Computer Science, J. van Leewen, (ed.), Elsevier, B, 1 57,1990. [26] G. Pighizzini, J. Shallit. Unary language operations, state complexity and Jacobsthal s function. Internat. J. Found. Comput. Sci., 13(1), , [27] M. Rabin and D. Scott. Finite automata and their decision problems. IBM J. Res. and Dev. 3, , [28] A. Salomaa, K. Salomaa, S. Yu. State complexity of combined operations. Theoret. Comput. Science, 383, , [29] K. Salomaa, S. Yu. On the state complexity of combined operations and their estimation. Internat. J. Found. Comput. Sci., 18(4), , [30] S. Yu. Regular languages. Handbook of Formal Languages, G. Rozenberg, A. Salomaa, (eds.), Springer, 1, , [31] S. Yu. State complexity of regular languages. J. Autom., Lang. and Comb., 6(2), , [32] S. Yu, Q. Zhuang. On the state complexity of intersection of regular languages. ACM SIGACT News, 22(3), 52 54, [33] S. Yu, Q. Zhuang, K. Salomaa. The state complexities of some basic operations on regular languages. Theoret. Comput. Sci. 125, , 1994.

Reversal of Regular Languages and State Complexity

Reversal of Regular Languages and State Complexity Reversal of Regular Languages and State Complexity Juraj Šebej Institute of Computer Science, Faculty of Science, P. J. Šafárik University, Jesenná 5, 04001 Košice, Slovakia juraj.sebej@gmail.com Abstract.

More information

Quotient Complexity of Regular Languages

Quotient Complexity of Regular Languages Quotient Complexity of Regular Languages Janusz Brzozowski David R. Cheriton School of Computer Science University of Waterloo Waterloo, ON Canada N2L 3G1 rzozo@uwaterloo.ca The past research on the state

More information

Theoretical Computer Science. State complexity of basic operations on suffix-free regular languages

Theoretical Computer Science. State complexity of basic operations on suffix-free regular languages Theoretical Computer Science 410 (2009) 2537 2548 Contents lists available at ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs State complexity of basic operations

More information

State Complexity of Two Combined Operations: Catenation-Union and Catenation-Intersection

State Complexity of Two Combined Operations: Catenation-Union and Catenation-Intersection International Journal of Foundations of Computer Science c World Scientific Publishing Company State Complexity of Two Combined Operations: Catenation-Union and Catenation-Intersection Bo Cui, Yuan Gao,

More information

Reversal of regular languages and state complexity

Reversal of regular languages and state complexity Reversal of regular languages and state complexity Juraj Šeej Institute of Computer Science, Faculty of Science, P. J. Šafárik University Jesenná 5, 04001 Košice, Slovakia juraj.seej@gmail.com Astract.

More information

Nondeterministic State Complexity of Basic Operations for Prefix-Free Regular Languages

Nondeterministic State Complexity of Basic Operations for Prefix-Free Regular Languages Fundamenta Informaticae 90 (2009) 93 106 93 DOI 10.3233/FI-2009-0008 IOS Press Nondeterministic State Complexity of Basic Operations for Prefix-Free Regular Languages Yo-Sub Han Intelligence and Interaction

More information

Operations on Unambiguous Finite Automata

Operations on Unambiguous Finite Automata Mathematical Institute, Slovak Academy of Sciences, Košice, Slovakia Joint work with Jozef Jirásek, Jr, and Juraj Šebej DLT 2016, Montréal, Québec, Canada Nondeterministic and Deterministic Finite Automata

More information

State Complexity of Neighbourhoods and Approximate Pattern Matching

State Complexity of Neighbourhoods and Approximate Pattern Matching State Complexity of Neighbourhoods and Approximate Pattern Matching Timothy Ng, David Rappaport, and Kai Salomaa School of Computing, Queen s University, Kingston, Ontario K7L 3N6, Canada {ng, daver, ksalomaa}@cs.queensu.ca

More information

On Properties and State Complexity of Deterministic State-Partition Automata

On Properties and State Complexity of Deterministic State-Partition Automata On Properties and State Complexity of Deterministic State-Partition Automata Galina Jirásková 1, and Tomáš Masopust 2, 1 Mathematical Institute, Slovak Academy of Sciences Grešákova 6, 040 01 Košice, Slovak

More information

Universal Disjunctive Concatenation and Star

Universal Disjunctive Concatenation and Star Universal Disjunctive Concatenation and Star Nelma Moreira 1 Giovanni Pighizzini 2 Rogério Reis 1 1 Centro de Matemática & Faculdade de Ciências Universidade do Porto, Portugal 2 Dipartimento di Informatica

More information

SYNTACTIC COMPLEXITY OF R- AND J-TRIVIAL REGULAR LANGUAGES

SYNTACTIC COMPLEXITY OF R- AND J-TRIVIAL REGULAR LANGUAGES International Journal of Foundations of Computer Science Vol. 25, No. 7 (2014) 807 821 c World Scientific Publishing Company DOI: 10.1142/S0129054114400097 SYNTACTIC COMPLEXITY OF R- AND J-TRIVIAL REGULAR

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

DESCRIPTIONAL COMPLEXITY OF NFA OF DIFFERENT AMBIGUITY

DESCRIPTIONAL COMPLEXITY OF NFA OF DIFFERENT AMBIGUITY International Journal of Foundations of Computer Science Vol. 16, No. 5 (2005) 975 984 c World Scientific Publishing Company DESCRIPTIONAL COMPLEXITY OF NFA OF DIFFERENT AMBIGUITY HING LEUNG Department

More information

CS 121, Section 2. Week of September 16, 2013

CS 121, Section 2. Week of September 16, 2013 CS 121, Section 2 Week of September 16, 2013 1 Concept Review 1.1 Overview In the past weeks, we have examined the finite automaton, a simple computational model with limited memory. We proved that DFAs,

More information

Remarks on Separating Words

Remarks on Separating Words Remarks on Separating Words Erik D. Demaine, Sarah Eisenstat, Jeffrey Shallit 2, and David A. Wilson MIT Computer Science and Artificial Intelligence Laboratory, 32 Vassar Street, Cambridge, MA 239, USA,

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

CONCATENATION AND KLEENE STAR ON DETERMINISTIC FINITE AUTOMATA

CONCATENATION AND KLEENE STAR ON DETERMINISTIC FINITE AUTOMATA 1 CONCATENATION AND KLEENE STAR ON DETERMINISTIC FINITE AUTOMATA GUO-QIANG ZHANG, XIANGNAN ZHOU, ROBERT FRASER, LICONG CUI Department of Electrical Engineering and Computer Science, Case Western Reserve

More information

Mergible States in Large NFA

Mergible States in Large NFA Mergible States in Large NFA Cezar Câmpeanu a Nicolae Sântean b Sheng Yu b a Department of Computer Science and Information Technology University of Prince Edward Island, Charlottetown, PEI C1A 4P3, Canada

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular

More information

arxiv: v1 [cs.fl] 5 Dec 2009

arxiv: v1 [cs.fl] 5 Dec 2009 Quotient Complexity of Closed Languages Janusz Brzozowski 1, Galina Jirásková 2, and Chenglong Zou 1 arxiv:0912.1034v1 [s.fl] 5 De 2009 1 David R. Cheriton Shool of Computer Siene, University of Waterloo,

More information

c 1998 Society for Industrial and Applied Mathematics Vol. 27, No. 4, pp , August

c 1998 Society for Industrial and Applied Mathematics Vol. 27, No. 4, pp , August SIAM J COMPUT c 1998 Society for Industrial and Applied Mathematics Vol 27, No 4, pp 173 182, August 1998 8 SEPARATING EXPONENTIALLY AMBIGUOUS FINITE AUTOMATA FROM POLYNOMIALLY AMBIGUOUS FINITE AUTOMATA

More information

Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 25, 2010 Final versions: July 8, 2010

Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 25, 2010 Final versions: July 8, 2010 DCFS 2010 Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 25, 2010 Final versions: July 8, 2010 On the Complexity of the Evaluation of Transient Extensions of Boolean

More information

The Separating Words Problem

The Separating Words Problem The Separating Words Problem Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 Canada shallit@cs.uwaterloo.ca https://www.cs.uwaterloo.ca/~shallit 1/54 The Simplest

More information

Obtaining the syntactic monoid via duality

Obtaining the syntactic monoid via duality Radboud University Nijmegen MLNL Groningen May 19th, 2011 Formal languages An alphabet is a non-empty finite set of symbols. If Σ is an alphabet, then Σ denotes the set of all words over Σ. The set Σ forms

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Results on Transforming NFA into DFCA

Results on Transforming NFA into DFCA Fundamenta Informaticae XX (2005) 1 11 1 IOS Press Results on Transforming NFA into DFCA Cezar CÂMPEANU Department of Computer Science and Information Technology, University of Prince Edward Island, Charlottetown,

More information

Hellis Tamm Institute of Cybernetics, Tallinn. Theory Seminar, April 21, Joint work with Janusz Brzozowski, accepted to DLT 2011

Hellis Tamm Institute of Cybernetics, Tallinn. Theory Seminar, April 21, Joint work with Janusz Brzozowski, accepted to DLT 2011 Theory of Átomata Hellis Tamm Institute of Cybernetics, Tallinn Theory Seminar, April 21, 2011 Joint work with Janusz Brzozowski, accepted to DLT 2011 This work was supported by the Natural Sciences and

More information

State Complexity and Magic Number Problem for Unary Operations

State Complexity and Magic Number Problem for Unary Operations SLOVENSKÁ AKADÉMIA VIED MATEMATICKÝ ÚSTAV Mgr. Kristína Čevorová Autoreferát dizertačnej práce State Complexity and Magic Number Problem for Unary Operations Na získanie akdemického titulu philosophiae

More information

The Separating Words Problem

The Separating Words Problem The Separating Words Problem Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 Canada shallit@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~shallit 1 / 48 An Advertisement

More information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Syntactic Complexity of Ideal and Closed Languages

Syntactic Complexity of Ideal and Closed Languages Syntactic Complexity of Ideal and Closed Languages Janusz Brzozowski 1 and Yuli Ye 2 1 David R. Cheriton School of Computer Science, University of Waterloo, Waterloo, ON, Canada N2L 3G1 {brzozo@uwaterloo.ca

More information

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission. CSE 5 Homework Due: Monday October 9, 7 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in this

More information

Finite Automata, Palindromes, Patterns, and Borders

Finite Automata, Palindromes, Patterns, and Borders Finite Automata, Palindromes, Patterns, and Borders arxiv:0711.3183v1 [cs.dm] 20 Nov 2007 Terry Anderson, Narad Rampersad, Nicolae Santean, and Jeffrey Shallit School of Computer Science University of

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three

More information

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties Salil Vadhan September 13, 2012 Reading: Sipser, 1.2. How to simulate NFAs? NFA accepts w if there is at least one accepting computational

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

More information

CS 455/555: Finite automata

CS 455/555: Finite automata CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation 1/19/2016 LECTURE 3 Last time: DFAs and NFAs Operations on languages Today: Nondeterminism Equivalence of NFAs and DFAs Closure properties of regular languages Sofya Raskhodnikova

More information

Lecture 3: Nondeterministic Finite Automata

Lecture 3: Nondeterministic Finite Automata Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where

More information

arxiv: v2 [cs.fl] 29 Nov 2013

arxiv: v2 [cs.fl] 29 Nov 2013 A Survey of Multi-Tape Automata Carlo A. Furia May 2012 arxiv:1205.0178v2 [cs.fl] 29 Nov 2013 Abstract This paper summarizes the fundamental expressiveness, closure, and decidability properties of various

More information

Closure under the Regular Operations

Closure under the Regular Operations September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure

More information

Finite Automata and Regular languages

Finite Automata and Regular languages Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/

More information

Kleene Algebras and Algebraic Path Problems

Kleene Algebras and Algebraic Path Problems Kleene Algebras and Algebraic Path Problems Davis Foote May 8, 015 1 Regular Languages 1.1 Deterministic Finite Automata A deterministic finite automaton (DFA) is a model of computation that can simulate

More information

Equivalence of DFAs and NFAs

Equivalence of DFAs and NFAs CS 172: Computability and Complexity Equivalence of DFAs and NFAs It s a tie! DFA NFA Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum What we ll do today Prove that DFAs

More information

Quantifying Nondeterminism in Finite Automata

Quantifying Nondeterminism in Finite Automata Quantifying Nondeterminism in Finite Automata Alexandros Palioudakis, Kai Salomaa and Selim G. Akl Abstract - Various ways of quantifying the nondeterminism in finite automata have been considered since

More information

CSE 105 Theory of Computation Professor Jeanne Ferrante

CSE 105 Theory of Computation  Professor Jeanne Ferrante CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s agenda NFA Review and Design NFA s Equivalence to DFA s Another Closure Property proof for Regular Languages

More information

arxiv: v3 [cs.fl] 2 Jul 2018

arxiv: v3 [cs.fl] 2 Jul 2018 COMPLEXITY OF PREIMAGE PROBLEMS FOR DETERMINISTIC FINITE AUTOMATA MIKHAIL V. BERLINKOV arxiv:1704.08233v3 [cs.fl] 2 Jul 2018 Institute of Natural Sciences and Mathematics, Ural Federal University, Ekaterinburg,

More information

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata : Organization of Programming Languages Theory of Regular Expressions Finite Automata Previous Course Review {s s defined} means the set of string s such that s is chosen or defined as given s A means

More information

Languages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet:

Languages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet: Languages 1 Languages A language is a set of strings String: A sequence of letters Examples: cat, dog, house, Defined over an alphaet: a,, c,, z 2 Alphaets and Strings We will use small alphaets: Strings

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2 5-25 Great Theoretical Ideas in Computer Science Lecture 4: Deterministic Finite Automaton (DFA), Part 2 January 26th, 27 Formal definition: DFA A deterministic finite automaton (DFA) M =(Q,,,q,F) M is

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

Aperiodic languages and generalizations

Aperiodic languages and generalizations Aperiodic languages and generalizations Lila Kari and Gabriel Thierrin Department of Mathematics University of Western Ontario London, Ontario, N6A 5B7 Canada June 18, 2010 Abstract For every integer k

More information

Distinguishability Operations and Closures

Distinguishability Operations and Closures Fundamenta Informaticae XX (26) 24 DOI.3233/FI-22- IOS Press Distinguishability Operations and Closures Cezar Câmpeanu Department of Computer Science The University of Prince Edward Island, Charlottetown,

More information

Computational Theory

Computational Theory Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen

More information

Theory of Computation (I) Yijia Chen Fudan University

Theory of Computation (I) Yijia Chen Fudan University Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael

More information

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

Descriptional complexity of unambiguous input-driven pushdown automata

Descriptional complexity of unambiguous input-driven pushdown automata Descriptional complexity of unambiguous input-driven pushdown automata Alexander Okhotin a,1, Kai Salomaa b,2 a Department of Mathematics, University of Turku, 20014 Turku, Finland b School of Computing,

More information

Closure under the Regular Operations

Closure under the Regular Operations Closure under the Regular Operations Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have

More information

NOTES ON AUTOMATA. Date: April 29,

NOTES ON AUTOMATA. Date: April 29, NOTES ON AUTOMATA 1. Monoids acting on sets We say that a monoid S with identity element ɛ acts on a set Q if q(st) = (qs)t and qɛ = q. As with groups, if we set s = t whenever qs = qt for all q Q, then

More information

Regular Expressions. Definitions Equivalence to Finite Automata

Regular Expressions. Definitions Equivalence to Finite Automata Regular Expressions Definitions Equivalence to Finite Automata 1 RE s: Introduction Regular expressions are an algebraic way to describe languages. They describe exactly the regular languages. If E is

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata. CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

More information

THE DISTINGUISHABILITY OPERATION ON REGULAR LANGUAGES

THE DISTINGUISHABILITY OPERATION ON REGULAR LANGUAGES THE DISTINGUISHABILITY OPERATION ON REGULAR LANGUAGES Cezar Câmpeanu (B) Nelma Moreira (A) Rogério Reis (A) arxiv:47.6v [cs.fl] Jul 24 (B) Department of Computer Science and Information Technology The

More information

Watson-Crick ω-automata. Elena Petre. Turku Centre for Computer Science. TUCS Technical Reports

Watson-Crick ω-automata. Elena Petre. Turku Centre for Computer Science. TUCS Technical Reports Watson-Crick ω-automata Elena Petre Turku Centre for Computer Science TUCS Technical Reports No 475, December 2002 Watson-Crick ω-automata Elena Petre Department of Mathematics, University of Turku and

More information

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA) Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

More information

Theory of Computation

Theory of Computation Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L

More information

Two-Way Automata and Descriptional Complexity

Two-Way Automata and Descriptional Complexity Two-Way Automata and Descriptional Complexity Giovanni Pighizzini Dipartimento di Informatica Università degli Studi di Milano TCS 2014 Rome, Italy September 1-3, 2014 IFIP TC1, Working Group 1.2, Descriptional

More information

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1 Properties of Regular Languages BBM 401 - Automata Theory and Formal Languages 1 Properties of Regular Languages Pumping Lemma: Every regular language satisfies the pumping lemma. A non-regular language

More information

languages by semifilter-congruences

languages by semifilter-congruences ideas Suffix semifilter-congruences Southwest Univ. Southwest Univ. Hongkong Univ. July 5 9, 2010, Nankai, China. Prefixsuffix Contents ideas 1 2 ideas 3 Suffix- 4 Prefix-suffix- Suffix Prefixsuffix ideas

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a

More information

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar Büchi Automata and their closure properties - Ajith S and Ankit Kumar Motivation Conventional programs accept input, compute, output result, then terminate Reactive program : not expected to terminate

More information

Varieties Generated by Certain Models of Reversible Finite Automata

Varieties Generated by Certain Models of Reversible Finite Automata Varieties Generated by Certain Models of Reversible Finite Automata Marats Golovkins 1 and Jean-Eric Pin 2 1 Institute of Mathematics and Computer Science, University of Latvia, Raiņa bulv. 29, Riga, Latvia

More information

Theory of Computation 4 Non-Deterministic Finite Automata

Theory of Computation 4 Non-Deterministic Finite Automata Theory of Computation 4 Non-Deterministic Finite Automata Frank Stephan Department of Computer Science Department of Mathematics National University of Singapore fstephan@comp.nus.edu.sg Theory of Computation

More information

On Strong Alt-Induced Codes

On Strong Alt-Induced Codes Applied Mathematical Sciences, Vol. 12, 2018, no. 7, 327-336 HIKARI Ltd, www.m-hikari.com https://doi.org/10.12988/ams.2018.8113 On Strong Alt-Induced Codes Ngo Thi Hien Hanoi University of Science and

More information

Sri vidya college of engineering and technology

Sri vidya college of engineering and technology Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order

More information

ON THE NUMBER OF DISTINCT LANGUAGES ACCEPTED BY FINITE AUTOMATA WITH n STATES 1

ON THE NUMBER OF DISTINCT LANGUAGES ACCEPTED BY FINITE AUTOMATA WITH n STATES 1 Journal of Automata, Languages and Combinatorics 7 (2002) 4, c Otto-von-Guericke-Universität Magdeburg ON THE NUMBER OF DISTINCT LANGUAGES ACCEPTED BY FINITE AUTOMATA WITH n STATES 1 Michael Domaratzki

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

Combinatorial Interpretations of a Generalization of the Genocchi Numbers

Combinatorial Interpretations of a Generalization of the Genocchi Numbers 1 2 3 47 6 23 11 Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.6 Combinatorial Interpretations of a Generalization of the Genocchi Numbers Michael Domaratzki Jodrey School of Computer Science

More information

Lecture 2: Connecting the Three Models

Lecture 2: Connecting the Three Models IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 2: Connecting the Three Models David Mix Barrington and Alexis Maciel July 18, 2000

More information

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Regular Languages. Problem Characterize those Languages recognized by Finite Automata. Regular Expressions Regular Languages Fundamental Question -- Cardinality Alphabet = Σ is finite Strings = Σ is countable Languages = P(Σ ) is uncountable # Finite Automata is countable -- Q Σ +1 transition

More information

On NFAs Where All States are Final, Initial, or Both

On NFAs Where All States are Final, Initial, or Both On NFAs Where All States are Final, Initial, or Both arxiv:88.247v2 [cs.cc] 3 Jul 29 Jui-Yi Kao, Narad Rampersad, and Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario

More information

Fooling Sets and. Lecture 5

Fooling Sets and. Lecture 5 Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,

More information

Foundations of

Foundations of 91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.3: Regular Expressions) David Martin dm@cs.uml.edu d with some modifications by Prof. Karen Daniels, Spring 2012

More information

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 Automata Theory Lecture Note 2 - Nondeterminism COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly

More information

Classes and conversions

Classes and conversions Classes and conversions Regular expressions Syntax: r = ε a r r r + r r Semantics: The language L r of a regular expression r is inductively defined as follows: L =, L ε = {ε}, L a = a L r r = L r L r

More information

C2.1 Regular Grammars

C2.1 Regular Grammars Theory of Computer Science March 22, 27 C2. Regular Languages: Finite Automata Theory of Computer Science C2. Regular Languages: Finite Automata Malte Helmert University of Basel March 22, 27 C2. Regular

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Before we show how languages can be proven not regular, first, how would we show a language is regular? CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information