CDM Memoryless Machines

Size: px
Start display at page:

Download "CDM Memoryless Machines"

Transcription

1 CDM Memoryless Mchines Zero Spce Klus Sutner Crnegie Mellon Universlity 2 Finite Stte Mchines Fll 27 3 DFA Decision Problems Where Are We? 3 Turing Mchines 4 We hve description of bstrct computbility in terms of Turing mchines, nd vrious equivlent models. Abstrct here refers to the fct tht we totlly ignore resource constrints, such s time, spce nd energy, tht re criticl in ctul computtion. work tpe b c b red/write hed Primitive recursive functions re more restricted, but they, too, re much too powerful for prcticl computtion. To get more relistic models, we first plunge to the very bottom: mchines without memory. Surprisingly, they still hve lots of interesting properties, nd re very useful in prcticl pplictions. finite stte control Very Concrete Computbility 5 Tming Turing Mchines 6 So fr we hve seen description of bstrct computbility in terms of register mchines nd generl recursive functions. Abstrct here refers to the fct tht we totlly ignore resource constrints (time nd spce). A more restricted clss of computble functions re the primitive recursive ones but they, too, re much too powerful for prcticl computtion. Klmár s elementry functions re more relistic. In modern complexity theory, the clss P of polynomil time computble (decision) problem re generlly considered to be n excellent mtch with the intuitive notion of efficient computtion. Here is model tht pushes the resource restrictions to the very limit but still hs mny surprising nd importnt pplictions. The centrl problem with generl Turing mchines is tht we hve no wy of predicting the mount of tpe used during computtion (which could be used to lso obtin bound on the length of the computtion). So how bout simply imposing bound on the mount of tpe tht the mchine my use? If the mchine ttempts to use more tpe, the computtion simply fils. A firly nturl restriction would be to llow only s much tpe s the input tkes up originlly: think of two specil end mrkers #x x 2... x n x n# where the hed is originlly positioned t the first symbol of x. The hed is not llowed to move beyond the two cells mrked #.

2 Liner Bounded Automt 7 Spce Constrints 8 work tpe This leds to n importnt clss of mchines: liner bounded utomt (LBA) nd the corresponding clss SPACE(n) of problems solvble in liner spce; introduced in their deterministic form in 96 by Myhill, nd in their full nondeterministic form in 964 by Kurod. Unfortuntely, LBAs re still much too powerful nd complicted. E.g., nondeterministic LBAs cn ccept every context-sensitive lnguge. input tpe b c b Ominously, the question whether the lnguges of nondeterministic LBAs re closed under complement ws open for three decdes before being nswered ffirmtively by Immermn nd Szelepcsényi independently. M q Y q N We need more stringent condition, something more restrictive thn just liner spce. A primitive decision lgorithm. It is convenient to seprte the input (red-only) of size n from the (red-write) worktpe, which hs size s(n). Little Spce 9 From Fixed to None One might suspect tht we get less nd less compute power s we decrese the memory-size function s(n), sy, to log n, log log n, log log log n, nd so on. Here is mjor surprise: Theorem (Hrtmnis, Lewis, Sterns 965) Suppose some decision problem is not solvble in constnt spce. Then every Turing mchine solving the problem requires spce Ω(log log n) infinitely often. But llowing only constnt mount of work tpe is lredy equivlent to llowing no work tpe t ll: there re only finitely mny possible work tpe contents nd hed positions. These finitely mny worktpe configurtions cn be coded s prt of the finite stte control. In other words, we move the fixed size tpe into the control unit of the Turing mchine nd we get Zero Spce. Hence, once we get to s(n) = o(log log n) we might s well hve worktpe of fixed size. The proof is somewht complicted, see the website. Zero Spce No Worktpe 2 Zero Spce sounds more impressive, but since we cn store limited mount of informtion in the stte of the mchine, it might be better to tlk bout Constnt Spce. input tpe Agin, we do not chrge for the size of the input on the red-only tpe; the strings there cn be rbitrrily long. Also, for the time being we will focus on decision lgorithms, so we don t need n output tpe: we cn use specil Yes/No sttes to indicte cceptnce. This is the old distinction between cceptors versus trnsducers, between decision problems versus function problems. M q Y q N

3 Left-To-Right 3 Simplified Configurtions 4 From the definition of Turing mchine, the red-only input tpe cn be scnned repetedly nd the tpe hed my move bck nd forth over it. As it turns out, one cn ssume without loss of generlity tht the red hed only moves from left to right only: t ech step one symbol is scnned nd then the hed moves right nd never returns. Theorem (Rbin/Scott, Shepherdson) Every decision problem solved by constnt spce two-wy mchine cn lredy be solved by constnt spce one-wy mchine. Note tht configurtions for these restricted Turing mchines re simpler thn in the generl cse, ll we need is p x p Q, x Σ There is no need to keep trck of the left prt of the tpe, we cn never go bck there. One step in the computtion is then given by mp δ, the so-clled trnsition function, where p x M q x δ(p, ) = q The proof of this result is quite messy, nd we won t go into detils. See the website. Acceptnce 5 Exmple: Prity nd Mjority 6 The computtion on input x ends fter exctly x steps in some stte p without ny input left. There is no need for specil hlting stte, we cn simply red off the response of the mchine by inspecting the lst stte. If this stte is good we think of the mchine s hving ccepted its input; otherwise it rejects. Let s suppose the input is given s bit sequence x = x x 2... x n x n. Here re two clssicl problems concerning these sequences: Prity: Is the number of -bits in x even? Mjority: Are there more -bits thn -bits in x? Prity requires just one bit: just dd the bits in x modulo 2. On the other hnd, Mjority seems to require n integer counter of unbounded size log n bits; we will see in while tht Mjority indeed cnnot be solved in zero spce. Prity Checker 7 Streming Algorithms 8 s = ; while( there is nother input bit x ) s = x xor s; return s; This relly computes the exclusive-or of ll the bits, which hppens to be the right nswer: s = x + x x n + x n (mod 2) We cn think of these restricted Turing mchines s lgorithms tht red ech bit in n input strem just once, perform very simple opertion fter ech bit is red, nd return the nswer fter the lst bit ws processed. initilize; while( there is nother input bit x ) process x; // stte trnsition return nswer; The lgorithm updtes its internl stte fter scnning new bit (performs stte trnsition).

4 Trnsition Digrms 9 Complete Informtion 2 An excellent representtion for our prity checker is digrm: e The edges re lbeled by the input bits, nd the nodes indicte the internl stte of the checker (clled e nd o for clrity, these re the sttes of the Turing mchine). Note tht similr digrms don t work well for ordinry Turing mchines. This pictures re very esy to red nd interpret for humns (nd useless for computers). o It is customry to indicte the initil stte by sourceless rrow, nd the so-clled finl sttes sttes (corresponding to nswer Yes) by mrking the nodes. In this cse stte e is both initil nd finl. e Finl stte is nother exmple of bd terminology, something like ccepting stte would be better. Als... o Another Exmple 2 Run-length Limited Codes 22 Consider ll binry words with the property tht ll -bits re seprted by between nd 3 -bits., There re 4 internl sttes {,, 2, 3} nd input x will tke us from stte to stte 3 if, nd only if, it contins t lest 3 -bits. Initil stte is nd 4 is the sole finl stte. Here ll sttes re considered ccepting. Note tht there is no trnsition lbeled out of stte 3: this is n incomplete utomton, it crshes on input. Checking Smll Divisors 23 Mod 5 Bse 2 24 A typicl primlity testing lgorithm strts very modestly by mking sure tht the given cndidte number x is not divisible by smll primes, sy, 2, 3, 5, 7, nd. Numbers up to 25 in binry tht re divisible by 5 (written here in columns, MSD on top). Note the regulrity of the bit ptterns. Assume n hs bits. Using stndrd rithmetic to do the tests is not prticulrly smrt, we wnt very fst method to eliminte lots of bd cndidtes quickly. One could customize the division lgorithm for smll divisor d but even tht s still clumsy. Cn we use scn lgorithm? Dire Wrning: At first glnce, it looks like there is self-similrity in this picture. There isn t, t lest not in ny technicl sense. Pictures cn be dngerous.

5 Induction to the Rescue 25 Tble Lookup 26 Write ν(x) for the numericl vlue of bit-sequence x, ssuming the MSD is red first. Then ν(x) = 2 ν(x) ν(x) = 2 ν(x) + So if we re interested in divisibility by, sy, d = 5 we hve ν(x) = 2 ν(x) + (mod 5) Since we only need to keep trck of reminders modulo 5 there re only 5 vlues, corresponding to 5 internl sttes of the loop body. In most implementtions, the opertion ν would be precomputed into lookup tble. In the ctul run ll tht s needed is then simple tble lookup, depending on the current stte, nd the next bit The precomputtion my be costly in generl (it s not in this prticulr cse), but once we hve the tble performnce will be excellent. Reminders Mod 5 27 Digrms 28 The lst picture is relly (prticulrly pretty) lyout of directed grph ssocited with the mchine: 4 The nodes of the grph re the sttes of the mchine. The edges correspond to trnsitions nd re lbeled by letters. Note tht strictly speking we hve to llow multiple lbels: different input symbols my cuse the sme trnsition from one stte to nother. It is coincidence tht this sitution does not rise in the lst exmple. 3 Alterntively, we could llow for multiple edges nd lbel ech with exctly one symbol. Conceptully, there is little difference between the two pproches but note tht implementtion detils could vry quite bit. 2 On occsion one lso ignores the lbels nd just dels with the underlying digrph. Optimlity in Time 29 The Killer App 3 Lower bound rguments re often tricky, but this relly is the fstest possible lgorithm for divisibility by 5 s cn be seen by n dversry rgument. Suppose there is n lgorithm tht tkes less thn n steps. text Then this lgorithm cnnot look t ll the bits in the input, so it will not notice single bit chnge t lest one prticulr plce. But tht cnnot possibly work, every single bit chnge in binry number ffects divisibility by 5: pttern converter FSM Y N for ny k. x ± 2 k x (mod 5)

6 Text Serch 3 Bck-Trnsitions 32 A C T T G A T A T A T A T A A C T G A T A T A T A T A A T A T T A T A T This mchine serches for strings ACGATAT, ATATATA nd TATAT. The Algorithms 33 Two Threds 34 We will shortly discuss closure properties of the lnguges ssocited with finite stte mchines. It will follow from these generl results tht mchine serching for words like ACGATAT, ATATATA nd TATAT trivilly exists. There re two somewht seprte resons s to why finite stte mchines re hugely importnt. The importnt point is tht there re lgorithms tht construct the mchines very efficiently, given the words s input. For exmple, the lgorithm used in the lst exmple is due to Aho nd Corsick. These lgorithms cn be quite sophisticted nd clever; there is whole field referred to s stringology tht dels with them. However, we will focus on nother importnt lgorithmic ppliction of finite stte mchines. They cn be used for text processing purposes, nd re lightning fst in this cpcity. There is no word processor nor ny compiler tht does not use FSMs. The cn be used in vriety of decision lgorithms. These lgorithms tend to be more complicted nd less efficient but re still very importnt for exmple in model checking. The Mchine Perspective 36 Zero Spce We cn think of our devices s consisting of two prts: trnsition system, nd n cceptnce condition. 2 Finite Stte Mchines The trnsition system includes the sttes nd the lphbet nd cn be construed s lbeled digrph. DFA Decision Problems A trnsition system or semi-utomton (SA) is structure Q, Σ, δ where Q nd Σ re finite sets nd δ Q Σ Q. The elements of δ re trnsitions nd often written in suggestively s p q.

7 Sequences, Words, Strings 37 Runs 38 It is customry to refer to the input sequences s words or strings. Given n lphbet Σ one writes Σ for the collection of ll words over Σ, nd Σ + for the collection of ll non-empty words. In prctice, the lphbet is usully one of 2 = {, } (2) {,,..., 9} () {,,..., 9, A,..., F } (6) lowercse letters (26) ASCII (28 or 256) UTF-8 (,2,64) but it is better to keep the definition generl. Very lrge lphbets cuse interesting lgorithmic problems. Suppose A is some semi-utomton. Given word u = 2... m over the lphbet of A run of the utomton on u is n lternting sequence of sttes nd letters i p,, p, 2, p 2,..., p m, m, p m such tht p i pi is vlid trnsition for ll i. p is the source of the run nd p m its trget, nd m its length. So run is just pth in lbeled digrph. Sometimes we will buse nottion nd lso refer to the corresponding sequence of sttes lone s run: p, p,..., p m, p m Trces 39 Nondeterminism 4 Given run π = p,, p, 2, p 2,..., p m, m, p m of n utomton, the corresponding sequence of lbels 2... m m Σ is referred to s the trce or lbel of the run. Every run hs exctly one ssocited trce, but the sme trce my hve severl runs, even if we fix the source nd trget sttes (mbiguous utomt). So, trnsition system is just n edge-lbeled digrph where the lbels re chosen from some lphbet. In the spirit of Rbin/Scott s 959 pper, it is perfectly cceptble to hve nondeterministic trnsitions p q nd p q Note tht these trnsitions re somewht problemtic from rel lgorithm perspective: re we supposed to go to q or to q? This ide my sound quint tody, but it ws huge conceptul brekthrough t the time. Specil Semi-Automt 4 Acceptnce Conditions 42 A semi-utomton is complete if for ll p Q nd Σ there is some q Q such tht is trnsition. p q In other words, the system cnnot get stuck in ny stte. A semi-utomton is deterministic if for ll p, q, q Q nd Σ p q, p q implies q = q Thus, deterministic system cn hve t most one run from given stte for ny input. The cceptnce condition depends much on the utomton in question but it is lwys condition on the runs ssocited with word u. The (cceptnce) lnguge L(A) of the utomton A is the set of ll words ccepted by the utomton. The most bsic kind of cceptnce condition is comprised of n initil stte q nd collection of finl sttes F Q. A run is ccepting if it strts t q nd ends in some stte in F. This corresponds to the ide of resetting the utomton to stte q before the computtion strts, ignoring ll intermedite steps, nd using only the lst stte to determine cceptnce.

8 DFAs 43 Extending the Trnsition Function 44 Combining the previous cceptnce condition with completeness nd determinism produces prticulrly useful type of utomton. It is often convenient to think of the trnsition function s mp δ : Q Σ Q defined by primitive recursion over words: A deterministic finite utomton (DFA) is structure A = Q, Σ, δ; q, F where Q, Σ, δ is deterministic nd complete semi-utomton nd q Q, F Q. δ(p, ε) = p δ(p, x) = δ(δ(p, x), ) In terms of the extended trnsition function cceptnce cn be expressed esily: A ccepts word u iff δ(q, u) F. It is strightforwrd to see tht DFA hs exctly one trce (or run) on ny possible input word. We use the stndrd cceptnce condition: run is ccepting if it leds from q to some q F. Note tht for ll words x nd y: δ(p, xy) = δ(δ(p, x), y) Regulr Lnguges 45 No Mjority 46 A lnguge L Σ is recognizble or regulr if there is DFA M tht ccepts L: L(M) = L. Thus regulr lnguge hs simple, finite description in terms of prticulr type of finite stte mchine. As we will see, one cn mnipulte the lnguges in mny wys by mnipulting the corresponding mchines. In sense, regulr lnguges re the simplest kind of lnguges tht re of interest (there re more complicted types of lnguges such s context-free lnguges tht re criticl for computer science). The digrm perspective is useful to show tht the Mjority lnguge M = { x 2 # x < # x } is not regulr. For ssume otherwise nd let n be the number of sttes in DFA ccepting M. By definition, n n+ is ccepted. But then there is pth from q to finl stte q, lbeled n n+. The first prt must contin loop tht we cn trverse multiple times, leding to n ccepted input of the form m n+ where m > n +. Contrdiction. This rther trivil observtion is lso known t the Pumping Lemm (for regulr lnguges). Agin: Killer Apps 47 Fst Acceptnce Testing 48 Membership in regulr lnguge cn be tested blindingly fst, nd using only sequentil ccess to the letters of the word. This works very well with strems nd is the foundtion of mny text serching nd editing tools (such s grep nd emcs). All compilers use similr tools. 2 Another importnt spect is the close connection between finite stte mchines nd logic. Here we don t cre so much bout cceptnce of prticulr words but bout the whole lnguge. The truth of formul cn then be expressed s some mchine hs non-empty cceptnce lnguge. Actully, this becomes relly interesting for infinite words (where the first ppliction disppers entirely). Proposition For ny DFA M nd ny input string x we cn test in time liner in x whether M ccepts x, with very smll constnts. p = q; // reset while( = x.next() ) // next input symbol p = delt[p][]; // tble look-up return p in F; // tble look-up First, bit of bsic theory. Of course, it might tke some time to compute the lookup tble δ in the first plce, but once we hve it cceptnce testing is very fst.

9 Exmple: Divisibility Testing DFA 49 Exmple: Checking Letter 5 Exmple A = {,..., 4}, {, }, δ;, {} where the trnsition reltion, written s function Σ Q Q, is ( ) δ = As we hve seen, this DFA checks whether binry number hs numericl vlue divisible by 5: L(A) = { x 2 ν(x) = (mod 5) }. A mchine tht ccepts ll words over lphbet {, b} tht hve n in the third position. A = {,..., 4}, {, b}, δ;, {3}, b, b, b, b b Note tht the terminology is ctully quite bd: DFA should relly be clled deterministic complete finite utomton or DCFA. Should, but isn t. Once bd terminology is widely ccepted there is no wy to get rid of it. Note tht stte number 4 is superfluous in wy. Sinks nd Trps 5 A stte p in DFA is trp if for ll symbols : δ(p, ) = p. A stte in DFA is sink if it is trp nd is not finl. Zero Spce Note tht we could remove sink from DFA without chnging the cceptnce lnguge. However, this would brek the completeness condition (though not determinism). This is relly n implementtion detil; on occsion completeness is importnt nd other times it is not. Finite Stte Mchines 3 DFA Decision Problems Wrning: some uthors llow incomplete mchines under the nme DFA to ccommodte sink removl. We will lwys refer to these devices s prtil DFAs (PDFAs) or incomplete DFAs. The Membership Problem 53 More Decision Problems 54 Given ny lnguge one is fced with nturl decision problem: determine whether some word belongs to the lnguge. In this prticulr cse the lnguge is represented by DFA. Lemm Problem: DFA Membership (DFA Recognition) Instnce: A DFA M nd word x. Question: Does M ccept input x? The DFA Membership Problem is solvble in liner time. As we will see, there re other representtions for regulr lnguges where the membership problem is more difficult to solve. This is of gret prcticl importnce; mny pttern mtching problems cn be phrsed s membership in regulr lnguges but using descriptions tht re more difficult to del with thn DFAs. Aprt from membership testing there re severl more complicted decision problems ssocited with finite stte mchines tht hve efficient solutions s long s the mchine is DFA. Agin, these re crucil in mny pplictions. Problem: Emptiness Instnce: A DFA M. Question: Does M ccept ny input string? Problem: Finiteness Instnce: A DFA M. Question: Does M ccept only finitely mny strings? Problem: Universlity Instnce: A DFA M. Question: Does M ccept ll input strings?

10 Esy Decidbility 55 Optimlity in Size 56 Theorem The Emptiness, Finiteness nd Universlity problem for DFAs re decidble in liner time. Proof. Consider the unlbeled digrm G of the mchine. Emptiness mens tht there is no pth in G from q to ny stte in F, property tht cn be tested by stndrd liner time grph lgorithms (such s DFS or BFS). Exercise Show how to del with Finiteness nd Universlity. A generl problem relted to computtion tht we hve not yet encountered is progrm size complexity: Wht is the (size of the) smllest progrm for given tsk? Note tht this is somewht orthogonl to the usul time nd spce complexity of n lgorithm: here the issue is the size of the code, not it s efficiency. Cn you progrm SAT checker on your wrist wtch? In generl identifying smllest progrms is very hrd. In prticulr for Turing/register mchines the problem is highly undecidble. But for DFAs there is very good solution. Equivlence nd Stte Complexity 57 Existence 58 It is esy to see tht the sme lnguge cn be recognized by mny different mchines. Two DFAs M nd M 2 over the sme lphbet re equivlent if they ccept the sme lnguge: L(M ) = L(M 2). Given few equivlent mchines, we re nturlly interested in the smllest one. In some sense, the smllest mchine is the best representtion of the corresponding regulr lnguge. The stte complexity of DFA is the number of its sttes. The stte complexity of regulr lnguge L is the size of smllest DFA ccepting L. Note tht the stte complexity of regulr lnguge lwys exists, lbeit for silly reson: the nturl numbers re well-ordered. However, there re two potentil problems tht could mke smllest mchine somewht useless. There might be severl DFAs of miniml size. Even if there is only one (up to isomorphism), lrger DFAs for the sme lnguge might hve no resonble connection to the miniml one. The first problem would mke it difficult to compre lnguges on the bsis of their smllest mchines. The second problem could mke it difficult to obtin smllest mchine given n rbitrry one. We will see tht for DFAs neither problem occurs. Computing Stte Complexity 59 Nturlly there is computtionl problem lurking in the drk: Problem: Stte Complexity Instnce: A regulr lnguge L. Solution: The stte complexity of L. As we will see, stte complexity is lwys computble but for efficient solutions we need L to be represented by DFA. Note tht we could sk similr questions for Turing mchines (Kolmogorov-Chitin complexity). Als, in this generl setting everything becomes highly undecidble. For exmple, one cnnot determine the smllest Turing mchine tht writes given trget string on the tpe nd then hlts. Stte Complexity: An Exmple 6 There re good lgorithms to clculte the stte complexity of given regulr lnguge (unless it is so lrge tht we cnnot ctully build DFA for it), so stte complexity becomes relly interesting only when we consider clss of lnguges. For exmple, one might sk wht is the stte complexity of the lnguges L,k = { x {, b} x k = }. Thus x L,k iff the kth symbol in x is n. For positive k this is not problem: we cn just skip over the first k symbols nd then verify tht x k relly is., b, b, b, b b

11 The Nsty Cse 6 Numbers nd DFAs 62 But wht if k is negtive? Mening tht we re looking for the k th symbol from the end. E.g, L, 3 = {, b, b, bb,, b, b, bb,...} The crucil problem here is tht the DFA does not know hed of time when the lst input will pper. We cn t just go bckwrds from the end. This my seem like preposterous restriction, but strems do behve just like this; we don t know when the lst input will come long. Exercise Figure out the stte complexity of L,k for negtive k. No strict lower bound is required t this point, just come up with mchine tht feels best possible. Here is much hrder problem tht dels with stndrd rdix representtions of integers. Write ν B(x) or simply ν(x) for the numericl vlue of string x written in bse B, so x {,,..., B }. Also, one hs to be bit creful bout the MSD nd LSD. Unless otherwise noted, we ssume tht the MSD is the first digit, so ν(x kx k... x x ) = i k x i B i. If the LSD is first we hve reverse rdix representtion. We lredy know tht divisibility by fixed number m cn be tested by DFA with respect to bse B = 2. But there re mny other, useful numertion systems nd is is not entirely cler whether one cn build DFAs for ll of them. Divisibility in Bse B 63 How About Stte Complexity? 64 Lemm Divisibility by m cn be tested by DFA in ny bse B. Proof. We cn construct cnonicl Horner utomton for this tsk. Keep the stte set Q = {,,..., m }. Chnge the trnsition function to δ(p, ) = p B + (mod m). But note tht tht in some specil cses this construction is not very clever. For exmple, to check whether number written in bse 5 is divisible by 5 the cnonicl solution looks like this:, 2, 3, 4, 2, 3, 4 Z N Initil stte nd only finl stte is. Since δ(q, x) = ν(x) (mod m) this works. This mkes it tempting to consider the stte complexity of divisibility lnguges: wht is the smllest possible DFA tht recognizes one of these lnguges? Experimentl Dt 65 Dt Mining The problem is to extrct useful informtion from this tble. Unfortuntely, there ren t too mny ptterns tht re clerly visible. For m prime things seem strightforwrd. Bse B = 2 seems potentilly doble (but not obvious). The problem ws solved few yers go by high-school student (Boris Alexeev, 2nd plce Intel STS 24). Als, the result is not very pretty. More lter when we hve the right tools vilble. m :, B :.

12 Hrd Question 67 How bout more complicted properties of numbers? Suppose we wnt to recognize powers of 3 written bse 2. This looks rther complicted. In fct there is no DFA tht could recognize these numbers (but the proof is quite hrd, see Cobhm s theorem).

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy 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 information

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages Automt & lnguges A primer on the Theory of Computtion Lurent Vnbever www.vnbever.eu Prt 5 out of 5 ETH Zürich (D-ITET) October, 19 2017 Lst week ws ll bout Context-Free Lnguges Context-Free Lnguges superset

More information

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-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 information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite 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 information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate 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

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory 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 information

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

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

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

Theory of Computation Regular Languages

Theory 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 information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tble of Contents: Week 1: Preliminries (set lgebr, reltions, functions) (red Chpters 1-4) Weeks

More information

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

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

More information

Designing finite automata II

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

More information

Formal Languages and Automata

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

More information

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA Nondeterminism Nondeterministic Finite Automt Nondeterminism Subset Construction A nondeterministic finite utomton hs the bility to be in severl sttes t once. Trnsitions from stte on n input symbol cn

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

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

More information

Convert the NFA into DFA

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

More information

Nondeterminism and Nodeterministic Automata

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

More information

1 Nondeterministic Finite Automata

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

More information

CDM Automata on Infinite Words

CDM Automata on Infinite Words CDM Automt on Infinite Words 1 Infinite Words Klus Sutner Crnegie Mellon Universlity 60-omeg 2017/12/15 23:19 Deterministic Lnguges Muller nd Rin Automt Towrds Infinity 3 Infinite Words 4 As mtter of principle,

More information

Minimal DFA. minimal DFA for L starting from any other

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

More information

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

12.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 information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

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

More information

Chapter 2 Finite Automata

Chapter 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 information

State Minimization for DFAs

State 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 information

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 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 information

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 UNIFORM CONVERGENCE Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 Suppose f n : Ω R or f n : Ω C is sequence of rel or complex functions, nd f n f s n in some sense. Furthermore,

More information

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model? CS125 Lecture 11 Fll 2016 11.1 Finite Automt Motivtion: TMs without tpe: mybe we cn t lest fully understnd such simple model? Algorithms (e.g. string mtching) Computing with very limited memory Forml verifiction

More information

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51 Non Deterministic Automt Linz: Nondeterministic Finite Accepters, pge 51 1 Nondeterministic Finite Accepter (NFA) Alphbet ={} q 1 q2 q 0 q 3 2 Nondeterministic Finite Accepter (NFA) Alphbet ={} Two choices

More information

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

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

More information

CMSC 330: Organization of Programming Languages

CMSC 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 information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

Finite Automata-cont d

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

More information

Deterministic Finite Automata

Deterministic 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 information

Formal languages, automata, and theory of computation

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

More information

p-adic Egyptian Fractions

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

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 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 information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

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

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

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types 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 information

First Midterm Examination

First 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 information

7.2 The Definite Integral

7.2 The Definite Integral 7.2 The Definite Integrl the definite integrl In the previous section, it ws found tht if function f is continuous nd nonnegtive, then the re under the grph of f on [, b] is given by F (b) F (), where

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types 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 information

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa CS:4330 Theory of Computtion Spring 208 Regulr Lnguges Equivlences between Finite utomt nd REs Hniel Brbos Redings for this lecture Chpter of [Sipser 996], 3rd edition. Section.3. Finite utomt nd regulr

More information

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

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

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

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

More information

Java II Finite Automata I

Java 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 information

NFAs continued, Closure Properties of Regular Languages

NFAs 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 information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

CISC 4090 Theory of Computation

CISC 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 information

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility) CS5371 Theory of Computtion Lecture 20: Complexity V (Polynomil-Time Reducibility) Objectives Polynomil Time Reducibility Prove Cook-Levin Theorem Polynomil Time Reducibility Previously, we lernt tht if

More information

Turing Machines Part One

Turing Machines Part One Turing Mchines Prt One Hello Hello Condensed Condensed Slide Slide Reders! Reders! Tody s Tody s lecture lecture consists consists lmost lmost exclusively exclusively of of nimtions nimtions of of Turing

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

More information

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

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

More information

1.4 Nonregular Languages

1.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 information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

20 MATHEMATICS POLYNOMIALS

20 MATHEMATICS POLYNOMIALS 0 MATHEMATICS POLYNOMIALS.1 Introduction In Clss IX, you hve studied polynomils in one vrible nd their degrees. Recll tht if p(x) is polynomil in x, the highest power of x in p(x) is clled the degree of

More information

Chapter 0. What is the Lebesgue integral about?

Chapter 0. What is the Lebesgue integral about? Chpter 0. Wht is the Lebesgue integrl bout? The pln is to hve tutoril sheet ech week, most often on Fridy, (to be done during the clss) where you will try to get used to the ides introduced in the previous

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 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 information

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

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

More information

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a). The Fundmentl Theorems of Clculus Mth 4, Section 0, Spring 009 We now know enough bout definite integrls to give precise formultions of the Fundmentl Theorems of Clculus. We will lso look t some bsic emples

More information

Math Lecture 23

Math Lecture 23 Mth 8 - Lecture 3 Dyln Zwick Fll 3 In our lst lecture we delt with solutions to the system: x = Ax where A is n n n mtrix with n distinct eigenvlues. As promised, tody we will del with the question of

More information

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

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

More information

1 From NFA to regular expression

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

More information

1 Structural induction

1 Structural induction Discrete Structures Prelim 2 smple questions Solutions CS2800 Questions selected for Spring 2018 1 Structurl induction 1. We define set S of functions from Z to Z inductively s follows: Rule 1. For ny

More information

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA 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 information

FLAC Closure Properties

FLAC Closure Properties FLAC Closure Properties 1 Nondeterministic Mchines Klus Sutner Crnegie Mellon Universlity 2 Determiniztion Fll 2017 3 Closure Properties Where Are We? 3 The Logic Link 4 We hve definition of regulr lnguges

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2011.2.1 COMPUTER SCIENCE TRIPOS Prt IA Tuesdy 7 June 2011 1.30 to 4.30 COMPUTER SCIENCE Pper 2 Answer one question from ech of Sections A, B nd C, nd two questions from Section D. Submit the nswers

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 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 information

How to simulate Turing machines by invertible one-dimensional cellular automata

How to simulate Turing machines by invertible one-dimensional cellular automata How to simulte Turing mchines by invertible one-dimensionl cellulr utomt Jen-Christophe Dubcq Déprtement de Mthémtiques et d Informtique, École Normle Supérieure de Lyon, 46, llée d Itlie, 69364 Lyon Cedex

More information

CSC 473 Automata, Grammars & Languages 11/9/10

CSC 473 Automata, Grammars & Languages 11/9/10 CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is

More information

ODE: Existence and Uniqueness of a Solution

ODE: Existence and Uniqueness of a Solution Mth 22 Fll 213 Jerry Kzdn ODE: Existence nd Uniqueness of Solution The Fundmentl Theorem of Clculus tells us how to solve the ordinry differentil eqution (ODE) du = f(t) dt with initil condition u() =

More information

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

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

More information

Math 1B, lecture 4: Error bounds for numerical methods

Math 1B, lecture 4: Error bounds for numerical methods Mth B, lecture 4: Error bounds for numericl methods Nthn Pflueger 4 September 0 Introduction The five numericl methods descried in the previous lecture ll operte by the sme principle: they pproximte the

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk bout solving systems of liner equtions. These re problems tht give couple of equtions with couple of unknowns, like: 6 2 3 7 4

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Lecture 08: Feb. 08, 2019

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

More information

Theoretical foundations of Gaussian quadrature

Theoretical foundations of Gaussian quadrature Theoreticl foundtions of Gussin qudrture 1 Inner product vector spce Definition 1. A vector spce (or liner spce) is set V = {u, v, w,...} in which the following two opertions re defined: (A) Addition of

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies Stte spce systems nlysis (continued) Stbility A. Definitions A system is sid to be Asymptoticlly Stble (AS) when it stisfies ut () = 0, t > 0 lim xt () 0. t A system is AS if nd only if the impulse response

More information

Lecture 9: LTL and Büchi Automata

Lecture 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 information

First Midterm Examination

First 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 information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019 ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS MATH00030 SEMESTER 208/209 DR. ANTHONY BROWN 7.. Introduction to Integrtion. 7. Integrl Clculus As ws the cse with the chpter on differentil

More information

Lecture 1. Functional series. Pointwise and uniform convergence.

Lecture 1. Functional series. Pointwise and uniform convergence. 1 Introduction. Lecture 1. Functionl series. Pointwise nd uniform convergence. In this course we study mongst other things Fourier series. The Fourier series for periodic function f(x) with period 2π is

More information

New Expansion and Infinite Series

New Expansion and Infinite Series Interntionl Mthemticl Forum, Vol. 9, 204, no. 22, 06-073 HIKARI Ltd, www.m-hikri.com http://dx.doi.org/0.2988/imf.204.4502 New Expnsion nd Infinite Series Diyun Zhng College of Computer Nnjing University

More information

Recitation 3: More Applications of the Derivative

Recitation 3: More Applications of the Derivative Mth 1c TA: Pdric Brtlett Recittion 3: More Applictions of the Derivtive Week 3 Cltech 2012 1 Rndom Question Question 1 A grph consists of the following: A set V of vertices. A set E of edges where ech

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

1.3 Regular Expressions

1.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 information

Lexical Analysis Finite Automate

Lexical 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 information

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

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

More information

1 Structural induction, finite automata, regular expressions

1 Structural induction, finite automata, regular expressions Discrete Structures Prelim 2 smple uestions s CS2800 Questions selected for spring 2017 1 Structurl induction, finite utomt, regulr expressions 1. We define set S of functions from Z to Z inductively s

More information

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Talen 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 information

Non-deterministic Finite Automata

Non-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 information