The size of subsequence automaton
|
|
- Roderick Chandler
- 5 years ago
- Views:
Transcription
1 Theoreticl Computer Science 4 (005) Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue, Czech Repulic Deprtment of Informtics, Kyushu University, Fukuok 8-858, Jpn c PRESTO, Jpn Science nd TechnologyCorportion (JST), Jpn Received Mrch 004; received in revised form 8 Ferury 005; ccepted Mrch 005 Communicted y M. Crochemore Astrct Given set of strings, the susequence utomton ccepts ll susequences of these strings. We derive lower ound for the mximum numer of sttes of this utomton. We prove tht the size of the susequence utomton for set of k strings of length n is Ω(n k /(k + ) k k!) for ny k. It solves n open prolem ecuse only the cse k ws shown efore. 005 Elsevier B.V. All rights reserved. Keywords: Serching susequences; Directed cyclic susequence grph; Susequence utomton. Introduction A susequence of string T is ny string otinle y deleting zero or more symols from T.GivensetP of strings, common susequence of P is string tht is susequence of every string in P. Motivtion for study of susequences comes from mny domins, e.g. from moleculr iology, signl processing, coding theory, nd rtificil intelligence. An exmple of the prolem with gret prcticl impct is the longest common susequence (LCS) prolem. The prolem is defined s follows: given set P of strings, we re to find common susequence of P tht hs mximl length mong ll common susequences of P. The decision version cn e, for exmple, to decide whether given string is common susequence of P. Another prolem, which comes from rtificil intelligence, is Corresponding uthor. E-mil ddresses: tronicek@fel.cvut.cz (Z. Troníček), yumi@i.kyushu-u.c.jp (A. Shinohr) /$ - see front mtter 005 Elsevier B.V. All rights reserved. doi:0.06/j.tcs
2 80 Z. Troníček, A. Shinohr / Theoreticl Computer Science 4 (005) the prolem of seprting two sets of strings: given two sets, P (positive) nd N (negtive), of strings, we re to find string tht est seprtes them. A string S seprtes sets P nd N if S is susequence of P nd simultneously is not susequence of ny string in N. The decision version is defined s follows: given two sets P nd N of strings nd string S, we re to decide whether S seprtes P nd N. If the prolem is supposed to e nswered for severl strings S then it is sensile to preprocess the sets P nd N. We cn uild n utomton ccepting ll common susequences of P nd n utomton tht ccepts ny string tht is susequence of t lest one string in N. With these utomt we cn decide the prolem in time liner in the length of S. Both utomt were studied nd descried. The ltter one is known s the Directed Acyclic Susequence Grph (DASG) nd three uilding lgorithms re ville: right-to-left [], left-to-right [], nd on-line []. The former one is clled the Common Susequence Automton (CSA) nd cn e uilt y n off-line or on-line lgorithm which re modifictions of lgorithms for uilding the DASG. In this pper, we investigte the numer of sttes of the CSA. The lnguge ccepted y the CSA is suset of the lnguge ccepted y the DASG for the sme strings nd the utomt re very similr. If we use either the off-line or the on-line lgorithm, the set of sttes of the CSA is suset of sttes of the DASG. The only previous results re, ccording to our knowledge, the lower ound for the mximum numer of sttes of the DASG for two strings proved in []. We will prove the lower ound for ny (fixed) numer of strings. The pper is orgnized s follows. In Section we will recll the definition of the CSA nd in Section we will exmine the symptotic ehvior of the numer of sttes of the CSA in the worst cse. Let Σ e finite lphet of size σ nd ε e the empty word. A finite utomton is, in this pper, 5-tuple (Q, Σ, δ,q 0,F), where Q is finite set of sttes, Σ is n input lphet, δ : Q Σ Q is trnsition function, q 0 is the initil stte, nd F Q is the set of finl sttes. Let δ e reflexive-trnsitive closure of δ, i.e. δ (q, ε) = q, δ (q, ) = δ(q, ), δ (q,,..., l ) = δ (δ(q, ),,..., l ), where q Q, Σ nd,..., l Σ. Nottion i, j mens the intervl of integers from i to j, including oth i nd j. All strings in this pper re considered over lphet Σ, if not stted otherwise.. Definition of CSA Let P denote the set of strings T,T,...,T k. Let n i e the length of T i nd T i [j] e jth symol of T i for ll j,n i nd ll i,k. GivenT = t t,...,t n nd i, j,n,i j, nottion T [i,...,j] mens the string t i,t i+,...,t j. Definition. We define position point of set P s n ordered k-tuple [p,p,...,p k ], where p i 0,n i is position in string T i.ifp i 0,n i then it denotes the position in front of (p i + )th symol of T i, nd if p i = n i then it denotes the position ehind the lst symol of T i for ll i,k.
3 Z. Troníček, A. Shinohr / Theoreticl Computer Science 4 (005) A position point [p,p,...,p k ] is clled initil position point if p i = 0 for ll i,k. We denote y ipp(p ) the initil position point of P nd y Pos(P ) the set of ll position points of P. Definition. For position point [p,p,...,p k ] Pos(P ) we define the common susequence position lphet Σ cp ([p,p,...,p k ]) s the set of ll symols which re contined simultneously in T [p +,...,n ],...,T k [p k +,...,n k ], i.e. Σ cp ([p,p,...,p k ]) = { Σ: i,k j p i +,n i :T i [j] =}. Definition. For position point [p,p,...,p k ] Pos(P ) nd Σ we define the common susequence trnsition function: csf ([p,p,...,p k ],)=[r,r,...,r k ], where r i = min{j : j>p i nd T i [j] =} for ll i,k if Σ cp ([p,p,...,p k ]), nd csf ([p,p,...,p k ],)= otherwise. Let csf e reflexive-trnsitive closure of csf, i.e. csf ([p,p,...,p k ], ε) =[p,p,...,p k ], csf ([p,p,...,p k ], ) = csf ([p,p,...,p k ], ), csf ([p,p,...,p k ],,..., l ) = csf (csf ([p,p,...,p k ], ),,..., l ), where j Σ cp (csf ([p,p,...,p k ],,..., j )) for ll j,l. Lemm. The utomton (Pos(P ), Σ, csf, ipp(p ), Pos(P )) ccepts string S iff S is common susequence of P. Proof. See []. The utomton from Lemm is clled the CSA for strings T,T,...,T k. An exmple of the CSA is in Fig.. Up to now, two lgorithms for uilding the CSA hve een descried. The first one is off-line nd uses the position points. The second one is on-line nd in ech step lods one input string into the utomton. We will riefly descrie the off-line lgorithm. The lgorithm genertes step y step ll rechle position points (sttes). At ech step we process one position point. First, we will find the common susequence position lphet for this point nd then determine the common susequence trnsition function for ech symol of tht lphet. When the position point hs een processed, we continue with next point until trnsitions of ll Fig.. The CSA for strings nd.
4 8 Z. Troníček, A. Shinohr / Theoreticl Computer Science 4 (005) rechle position points re determined. The complexity of the lgorithm depends on the numer of sttes of the resulting utomton. Providing tht the totl numer of sttes is O(t), the lgorithm requires O(kσt) time.. Numer of sttes of CSA We will investigte the numer of sttes (rechle position points) of the CSA for set of strings over inry lphet. First, we will introduce n uxiliry structure clled generting tree. The generting tree is defined s generl rooted tree where nodes nd edges re leled y n integer vlue. We sy tht node is of order v if it is leled y vlue v. A node of order v hs exctly v output edges leled y,,...,v. Ending node of ech edge is leled y the sme vlue s this edge. If the root of the tree is of order k, we sy tht the tree is of order k. An exmple of the tree of order is in Fig.. We use the tree to descrie set of strings. Any pth from the root corresponds to string over lphet {,}. All nodes ut the root contriute y. An edge leled y l dds l. For exmple, 4 pth root node(4) node() node() corresponds to string. A node hs t most one output edge for given vlue, therefore no two strings generted y the tree re identicl. In the susequent, we consider the tree of order k nd denote, for i Z, i 0, y p(k, i) the numer of nodes on ith level of this tree. Furthermore, we will denote y p j (k, i), j k the numer of nodes on ith level which re leled y vlue of j. There is just one node of order k on ech level, tht is p k (k, i) =. On the 0th level, there is only one node (root). A node of order j on ith level hs descendnts of orders,,...,j on (i + )th level. In other words, node of order j on ith level is descendnt either of node of order j or of higher order on (i )th level. The numer of these nodes of higher order is the sme s the numer of nodes of order j +onith level. Tht is, p j (k, i) = p j (k, i )+p j+ (k, i), where i>0nd j <k. This formul is known from comintorics nd holds for inomil coefficients. For further derivtion we use Pscl s tringle (see Fig. ) which is common mens for expressing the reltions etween inomil coefficients. From Pscl s tringle we get: ( i p k (k, i) = 0 ), p k (k, i) = ( ) i,...,p (k, i) = ( i + k k ). i = 0 i = i = Fig.. The top of the generting tree of order.
5 Z. Troníček, A. Shinohr / Theoreticl Computer Science 4 (005) i = p k (k, i) i = p k (k, i) i = p k (k, i) i = 5 i = p k (k, i) p k 4 (k, i) i = p k 5 (k, i) Fig.. The top of Pscl s tringle. The numer of nodes on ith level is hence p(k, i) = k ( ) i + k p j (k, i) =. k i=0 j= And the totl numer of nodes up to nth level is n p(k, i) = n ( ) ( ) i + k n + k =. k k i=0 This formul determines how mny strings ending with is generted y the tree of order k if we consider the first n levels of this tree. Lemm. Let k Z, k,n i Z, n i for ll i,k. Let T = () n,t = () n,...,t k = ( k ) n k,l k ={T,T,...,T k }, nd δ denote the trnsition function of the CSA for L k. Let M k e the set of strings generted ythe generting tree of order k. Then for ll u, v M k,u = v, oth ccepted ythe CSA for L k, holds δ (ipp(p ), u) = δ (ipp(p ), v). Proof (yinduction in k). Let Mk l denote the set of strings from the lth level of the generting tree of order k.. k=: M l={()l,() l,() () l,...,() l }. If two strings contin different numer of s they cnnot result in shift to the sme position in T. Therefore we cn consider only the strings with the sme numer of s. For given l Z, l, just ll strings in M l hve the sme numer of s. But simultneously no such two strings hve the sme numer of s. Thus, the trnsition function finishes t the sme position in T nd lwys t different position in T.. Let n k+ Z, n k+. We dd T k+ = ( k+ ) n k+ into set L k, tht is L k+ = L k {T k+ }. According to the induction hypothesis the lemm holds for k. We will show tht it holds for k + too y using induction in height h of the tree: () h = : Mk+ ={,,...,k+ }. No two strings from this set hve the sme numer of s, thus the lemm holds.
6 84 Z. Troníček, A. Shinohr / Theoreticl Computer Science 4 (005) () The hypothesis sys tht the lemm holds for Mk+,M k+,...,mh k+. We will prove tht it holds lso for Mk+ h+. From the generting tree we get: Mh+ k+ = Mh+ k { k+ s: s Mk+ h }. We need to show tht the result holds for ny u, v Mh+ k { k+ s: s Mk+ h }. There re three cses: (i) u, v Mk h+, (ii) u, v { k+ s: s Mk+ h }, (iii) u Mh+ k nd v { k+ s: s Mk+ h }. Cse (i) follows from the induction hypothesis. In cse (ii) oth u nd v hve prefix k+ nd for the suffixes we cn use the induction hypothesis. Let us now consider cse (iii). Any string from Mk h+ results in shift to the (h + )th in T k = ( k ) n k. Furthermore, k+ mkes shift to the second in T k nd ecuse ny string in Mk+ h contins h symols, the lemm holds for cse (iii) s well. Theorem. Let n, k Z, k. There is set L of k strings ech of length t most n such tht the numer of sttes of the CSA for L is Ω(n k /(k + ) k k!). Proof. Let n i = i+ n,t i = ( i ) n i for ll i,k nd let L ={T,T,...,T k }. The CSA for L then ccepts ll the strings generted y the generting tree of order k up to level n k. The numer of these strings is ( ) nk + k k which proves the lemm. = (n k + k)(n k + k )...(n k + ) k! ( n k ) = Ω (k + ) k k! We note gin tht the result of Theorem is pplicle lso for the DASG. 4. Conclusion We checked tht the mximum numer of sttes of the susequence utomton for k strings of length O(n) is Ω(n k /(k + ) k k!). We lso delt with the prolem of tight upper ound for the numer of sttes. By exhustive serching we found the worst cses for severl lengths of input strings nd verified in [4] tht the sequence of the mximum numers of the sttes does not form ny well-known integer sequence. Hence the prolem of tight upper ound remins open. References [] R.A. Bez-Ytes, Serching susequences, Theoret. Comput. Sci. 78 () (99) [] M. Crochemore, B. Melichr, Z. Troníček, Directed cyclic susequence grph overview, J Discrete Algorithms ( 4) (00) [] H. Hoshino, A. Shinohr, M. Tked, S. Arikw, Online construction of susequence utomt for multiple texts, in: Proc. Symp. on String Processing nd Informtion Retrievl 000, L Coruñ, Spin, 000, IEEE Computer Society Press, Silver Spring, MD. [4] N.J.A. Slone, The on-line encyclopedi of integer sequences, njs/sequences/.
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 information1 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 informationMinimal 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 informationCS 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 informationChapter 2 Finite Automata
Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht
More informationChapter 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 informationCHAPTER 1 Regular Languages. Contents
Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr
More informationHarvard University Computer Science 121 Midterm October 23, 2012
Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is
More informationAUTOMATA 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 information1. 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 informationFormal 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 informationDesigning 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 informationSpeech 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 informationAssignment 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 informationRegular 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 information12.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 informationNondeterminism 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 information5. (±±) Λ = 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 informationCMPSCI 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 informationModel 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 informationGrammar. 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 informationJava II Finite Automata I
Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression
More informationCoalgebra, 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 informationLecture 09: Myhill-Nerode Theorem
CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives
More information80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers
80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input
More informationFormal 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 informationCS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan
CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings
More informationFirst Midterm Examination
24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet
More informationFinite 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 informationCS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University
CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted
More informationSpeech 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 informationFirst Midterm Examination
Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does
More informationCSCI 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 informationDeterministic Finite Automata
Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite
More informationWorked out examples Finite Automata
Worked out exmples Finite Automt Exmple Design Finite Stte Automton which reds inry string nd ccepts only those tht end with. Since we re in the topic of Non Deterministic Finite Automt (NFA), we will
More informationLecture 9: LTL and Büchi Automata
Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled
More informationHomework 3 Solutions
CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.
More information12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014
CS125 Lecture 12 Fll 2014 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 informationCS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS
CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)
More informationConverting Regular Expressions to Discrete Finite Automata: A Tutorial
Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert
More informationa,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1
CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother
More informationCHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)
Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr
More informationCS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018
CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationRegular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*
Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion
More informationCSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes
CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic
More informationCS103B 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 informationThe University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS
The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationNon-deterministic Finite Automata
Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion
More informationNon-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1
Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet
More informationLecture 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 informationFinite-State Automata: Recap
Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under
More informationMore 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 informationNon-deterministic Finite Automata
Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent
More informationLexical Analysis Finite Automate
Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition
More informationTheory of Computation Regular Languages
Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of
More informationGNFA GNFA GNFA GNFA GNFA
DFA RE NFA DFA -NFA REX GNFA Definition GNFA A generlize noneterministic finite utomton (GNFA) is grph whose eges re lele y regulr expressions, with unique strt stte with in-egree, n unique finl stte with
More informationTheory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38
Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control
More informationDFA minimisation using the Myhill-Nerode theorem
DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,
More information2.4 Linear Inequalities and Interval Notation
.4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or
More information1. 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 informationSurface maps into free groups
Surfce mps into free groups lden Wlker Novemer 10, 2014 Free groups wedge X of two circles: Set F = π 1 (X ) =,. We write cpitl letters for inverse, so = 1. e.g. () 1 = Commuttors Let x nd y e loops. The
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More
More informationNFAs continued, Closure Properties of Regular Languages
lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions
More informationNFAs continued, Closure Properties of Regular Languages
Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,
More information1B40 Practical Skills
B40 Prcticl Skills Comining uncertinties from severl quntities error propgtion We usully encounter situtions where the result of n experiment is given in terms of two (or more) quntities. We then need
More informationTutorial Automata and formal Languages
Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we
More informationExercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.
1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,
More informationCS 311 Homework 3 due 16:30, Thursday, 14 th October 2010
CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w
More informationp-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 informationCS 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 informationCISC 4090 Theory of Computation
9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions
More informationCS375: Logic and Theory of Computing
CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks
More informationTalen en Automaten Test 1, Mon 7 th Dec, h45 17h30
Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100
More informationPART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA
PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T
More informationNFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.
NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD
More informationName Ima Sample ASU ID
Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to
More informationHamiltonian Cycle in Complete Multipartite Graphs
Annls of Pure nd Applied Mthemtics Vol 13, No 2, 2017, 223-228 ISSN: 2279-087X (P), 2279-0888(online) Pulished on 18 April 2017 wwwreserchmthsciorg DOI: http://dxdoiorg/1022457/pmv13n28 Annls of Hmiltonin
More informationKleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15
Models of Comput:on Lecture #8 Chpter 7 con:nued Any lnguge tht e defined y regulr expression, finite utomton, or trnsi:on grph cn e defined y ll three methods We prove this y showing tht ny lnguge defined
More information1.4 Nonregular Languages
74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll
More informationFinite Automata Approach to Computing All Seeds of Strings with the Smallest Hamming Distance
IAENG Interntionl Journl of Computer Science, 36:2, IJCS_36_2_05 Finite Automt Approch to Computing All Seeds of Strings with the Smllest Hmming istnce Ondřej Guth, Bořivoj Melichr Astrct Seed is type
More information1 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 informationFoundations of XML Types: Tree Automata
1 / 43 Foundtions of XML Types: Tree Automt Pierre Genevès CNRS (slides mostly sed on slides y W. Mrtens nd T. Schwentick) University of Grenole Alpes, 2017 2018 2 / 43 Why Tree Automt? Foundtions of XML
More information1.3 Regular Expressions
56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,
More informationSoftware Engineering using Formal Methods
Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,
More informationɛ-closure, Kleene s Theorem,
DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene
More informationCompiler 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 informationThoery 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 informationState Minimization for DFAs
Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid
More informationRegular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15
Regulr Lnguge Nonregulr Lnguges The Pumping Lemm Models of Comput=on Chpter 10 Recll, tht ny lnguge tht cn e descried y regulr expression is clled regulr lnguge In this lecture we will prove tht not ll
More informationAnatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute
Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn
More informationLet'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 informationScanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:
Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes
More informationBACHELOR THESIS Star height
BACHELOR THESIS Tomáš Svood Str height Deprtment of Alger Supervisor of the chelor thesis: Study progrmme: Study rnch: doc. Štěpán Holu, Ph.D. Mthemtics Mthemticl Methods of Informtion Security Prgue 217
More informationFundamentals of Computer Science
Fundmentls of Computer Science Chpter 3: NFA nd DFA equivlence Regulr expressions Henrik Björklund Umeå University Jnury 23, 2014 NFA nd DFA equivlence As we shll see, it turns out tht NFA nd DFA re equivlent,
More informationCM10196 Topic 4: Functions and Relations
CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input
More informationChapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:
Chpte 7 Kleene s Theoem 7.1 Kleene s Theoem The following theoem is the most impotnt nd fundmentl esult in the theoy of FA s: Theoem 6 Any lnguge tht cn e defined y eithe egul expession, o finite utomt,
More informationIntermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4
Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one
More information