1 Structural induction
|
|
- Daisy Williams
- 5 years ago
- Views:
Transcription
1 Discrete Structures Prelim 2 smple questions Solutions CS2800 Questions selected for Spring Structurl induction 1. We define set S of functions from Z to Z inductively s follows: Rule 1. For ny n Z, the trnsltion (or offset) function t n : x x + n is in S. Rule 2. For ny k 0 Z, the scling function r k : x kx is in S. Rule 3. If f nd g re elements of S, then the composition f g S. Rule 4. If f S nd f hs right inverse g, then g is lso in S. In other words, S consists of functions tht trnslte nd scle integers, nd compositions nd right inverses thereof. Note: This semester, we mde bigger distinction between the elements of n inductively defined set nd the mening of n inductively defined set. We probbly would hve phrsed this question s follows: Let S be given by s S ::= t n r k s 1 s 2 rinv s nd inductively, let the function defined by s (written F s : Z Z) be given by the rules F tn (x) ::= x + n, F rk (x) ::= ks, F s1 s 2 (x) ::= F s1 F s2 nd let F rinv s ::= g where g is right inverse of F s. () [1 point] Show tht the function f : x 3x + 17 is in S. Solution By rule 1, the function t 17 : x x + 17 is in S, nd by rule 2, r 3 : x 3x is in S. By rule 3, therefore, t 17 r 3 : x 3x + 17 is in S. (b) Use structurl induction to prove tht for ll f S, f is injective. You my use without proof the fct tht the composition of injective functions is injective. Solution We must show tht ll functions formed with ech of the rules re injective. Let P (s) be the sttement s is injective. P (t k ) holds, becuse t k hs two sided inverse t k, nd is therefore injective. P (r k ) holds, becuse we required tht k 0. Therefore, if kx 1 = kx 2, we cn cncel k to find x 1 = x 2. P (f g) holds, ssuming P (f) nd P (g), becuse the composition of injections is n injection. If g is the right inverse of f, then P (g) holds, becuse g hs left-inverse (nmely f) nd is therefore injective. (c) Give surjection φ from S to Z (proof of surjectivity not necessry). Remember tht this surjection must mp function to n integer, nd for every integer there must be function tht mps to it. Solution Let φ(s) ::= s(0). This is surjection, becuse t n (0) = 0 + n = n, so for ny n there exists s S (nmely t n ) with φ(s) = n. 1
2 2 Automt 1. Given DFAs M 1 = (Q 1, Σ, δ 1, q 01, F 1 ) nd M 2 = (Q 2, Σ, δ 2, q 02, F 2 ), we cn construct mchine M 12 with L(M 12 ) = L(M 1 ) L(M 2 ) s follows: Let Q = Q 1 Q 2 = the set of ll ordered pirs (q 1, q 2 ), where q 1 Q 1 nd q 2 Q 2. Let q 0 Q = (q 01, q 02 ). Let F = F 1 F 2 = {(q 1, q 2 ) q 1 F 1 nd q 2 F 2 }. Let δ 12 ((q 1, q 2 ), ) = (δ 1 (q 1, ), δ 2 (q 2, )). Let M 12 = (Q, Σ, δ 12, q 0, F ). Use structurl induction to prove tht for ll x Σ, δ 12 ((q 1, q 2 ), x) = ( δ1 (q 1, x), δ ) 2 (q 2, x). Solution The min chllenge here is wding through the nottionl jungle to understnd wht the problem ctully sys. Once you ve done this, the proof is short nd strightforwrd. Here it is in ll its glory: We will prove the result by structurl induction on x, s suggested. Both the set of strings Σ nd the extended trnsition function δ re defined recursively (see the definitions t the end). The bse cse for x is the empty string ɛ. We cn simply red off the corresponding line in the definition of δ, which tells us tht δ 1 (q 1, ɛ) = q 1, δ 2 (q 2, ɛ) = q 2, nd δ 12 ((q 1, q 2 ), ɛ) = (q 1, q 2 ). Hence δ 12 ((q 1, q 2 ), ɛ) = (q 1, q 2 ) = ( δ1 (q 1, ɛ), δ ) 2 (q 2, ɛ), so the sttement is true in the bse cse. Now ssume the sttement is true for some string x, nd consider the next lrger string x. Agin reding off the pproprite line in the definition of δ, we know tht δ 1 (q 1, x) = δ 1 ( δ 1 (q 1, x), ), nd δ 2 (q 2, x) = δ 2 ( δ 2 (q 2, x), ) Wht is δ 12 ((q 1, q 2 ), x)? Well, we lso hve δ 12 ((q 1, q 2 ), x) = δ 12 ( δ 12 ((q 1, q 2 ), x), ) (definition of δ 12 ) = δ 12 (( δ1 (q 1, x), δ ) ) 2 (q 2, x), (inductive hypothesis) ( ) )) = δ 1 ( δ1 (q 1, x),, δ 2 ( δ2 (q 2, x), (definition of δ 12 ) = ( δ1 (q 1, x), δ ) 2 (q 2, x) (definition of δ 1, δ 2 ) This proves the sttement for ll strings x Σ by (structurl) induction. 2. Drw finite utomton (DFA, NFA or ɛ-nfa) with lphbet {0, 1} to recognize the lnguge {x {0, 1} x contins the substring 010} 2
3 Solution An NFA is probbly the esiest to construct. 0, 1 0, 1 q 0 strt 0 q 1 1 q 0 2 q 3 3. Drw finite utomton (DFA, NFA or ɛ-nfa) with lphbet {, b} to recognize strings of the form x 1 x 2 x 3 where ech x i is either b or b. b q strt q 0 hell, b b Solution 4. Prove tht L = {0 n 10 n n N} is not DFA-recognizble. q b b Solution Suppose tht this lnguge is ccepted by some deterministic finite utomton with N sttes. Consider the string x = 0 n 10 n. Since x is in the lnguge nd x N, by the Pumping Lemm, there exist strings u, v, nd w such tht x = uvw, v 1, uv N, nd M ccepts uv i w for ll i > 0. Since uv N, it must be the cse tht uv is string of 0 s, nd tht w contins the 1 in 0 N 10 N. Thus, if i > 1, uv i w hs more thn N 0s to the left of the 1 nd only N 0s to the right of the 1, nd thus is not in the lnguge. This contrdicts the ssumption tht the lnguge is ccepted by M (since M ccepts string not in the lnguge). 5. Build deterministic finite utomton tht recognizes the set of strings of 0 s nd 1 s, tht only contin single 0 (nd ny number of 1 s). Describe the set of strings tht led to ech stte. Solution q 0 strt 0 q 0 1 q ,1 The strings leding to q i contin i 0 s. 6. Given string x, we cn define the chrcter doubling of x to be x with every chrcter doubled: for exmple cd(bc) = bbcc. Formlly, cd(ɛ) = ɛ, nd cd(x) = cd(x). We cn then define the chrcter doubling of lnguge L to be the set of ll strings formed by doubling the chrcters of strings in L; formlly cd(l) = {cd(x) x L}. Given DFA M = (Q, Σ, δ, q 0, F ), we cn construct new DFA M cd tht recognizes cd(l(m)) by dding new stte q q to the middle of every trnsition from q on chrcter : 3
4 q 1 q 2 becomes q 1 q q 1 q 2 () Formlly describe the components (Q cd, Σ cd, δ cd, q 0cd, F cd ) of M cd in terms of the components of M. Be sure to describe δ cd on ll inputs (you my need to dd one or more dditionl sttes). Solution Q cd = Q {q q q Q, A} {X} δ cd : (q, ) q q; δ cd : (q q, ) δ(q, ); δ cd : (q q, b) X if b, nd δ cd : (X, ) X. The remining components re unchnged: Σ cd = Σ, q 0cd = q 0, nd F cd = F. (b) Use structurl induction on x to prove tht for ll x, δ(q 0, x) = δ cd (q 0cd, cd(x)). Solution Let P (x) be the sttement tht δ(q 0, x) = δ cd (q 0, cd(x)). I will prove x, P (x) by structurl induction. To show P (ε), note tht δ(q 0, ɛ) = q 0. Moreover, cd(ε) = ɛ, so δ cd (q 0, cd(ε)) = δ cd (q 0, ɛ) = q 0 = δ(q 0, ε), s required. To show P (x), we ssume the inductive hypothesis P (x). we compute: δ cd (q 0, cd(x)) = δ cd (q 0, cd(x)) by definition of cd = δ cd (δ cd ( δ cd (q 0, cd(x)), ), ) by definition of δ cd = δ cd (δ cd ( δ(q 0, x), ), ) by definition of δ cd = δ cd (q, ) ( δ(q0,x)) by definition of δ cd = δ( δ(q 0, x), ) by definition of δ cd = δ(q 0, x) by definition of δ (c) We cn lso define the string doubling of x to be xx. For exmple, sd(bc) = bcbc. Show tht the set of regulr lnguges is not closed under string doubling. In other words, give regulr lnguge L nd prove tht sd(l) = {sd(x) x L} is not regulr. You cn use ny theorem proved in clss to help prove this result. Solution Let L = 0 1. Clerly L is regulr. Moreover, sd(l) = {0 n 10 n 1 n N}. This lnguge is not regulr. To see this, ssume for the ske of contrdiction tht it is. Then there exists some nturl number m s in the pumping lemm. Let x = 0 m 10 m 1. Clerly x sd(l), nd x m, so we cn split x into u, v, nd w, s in the pumping lemm. We know tht uv n, so v cn only contin 0 s. Then x = uv 2 w contins more 0 s before the first 1 thn fter, nd thus x / sd(l). But the pumping lemm sys tht x sd(l); this is contrdiction, nd thus sd(l) is not regulr. 7. Hppy Ct hs been shown the following proof, nd hs promptly turned into Grumpy Ct. Briefly but clerly identify the error which hs induced grumpiness. To prove: The lnguge of the regulr expression 0 1 is, in fct, not DFA-recognizble. Proof. Let L be the lnguge of 0 1. Assume there is some DFA M with n sttes tht recognizes L. Let x = 0 n Clerly, x L nd x n. Therefore ccording to the Pumping Lemm, 4
5 we cn split x into three prts u, v nd w, such tht uv n, v 1, nd uv i w L for ll nturl numbers i. Let v = n. Since uv n, it must be the cse tht u = ɛ, nd v = 0 n 1 1. Then uv 2 w = 0 n 1 10 n 1 11, which is clerly not in L. This contrdicts our ssumption tht there is DFA which recognizes the lnguge. Solution The pumping lemm sys there exists some v, but we hve chosen specific v. It my be tht the pumping lemm gives some other v (such s 0). 3 Number theory 1. Determine the prime fctoriztions, gretest common divisor, nd lest common multiple of the following pirs of numbers (m, n). In ech cse, give Bézout coefficients s nd t such tht sm + tn = gcd(m, n). () (6, 8) prime fctoriztions = gcd = 2 lcm = 24 s = 1 t = 1 (b) (5, 7) prime fctoriztions = 5 7 gcd = 1 lcm = 35 s = 3 t = 2 (c) (21, 12) prime fctoriztions = gcd = 3 lcm = 84 s = 1 t = 2 2. Prove tht 7 m 1 is divisible by 6 for ll positive integers m. Solution There re two wys to do this. One wy: notice tht 7 1 mod 6, thus 7 m 1 mod 6 for ny m (pplying the known result tht if b (mod m) nd c d (mod m) then c bd (mod m) m 1 times), nd thus 7 m 1 0 mod 6. This implies 7 m 1 is divisible by 6. Alterntively you cn do direct proof by induction: Bse cse: m = 1, = 6 which is obviously divisible by 6. Inductive step: Assume 7 m 1 is divisible by 6 for some m 1 (inductive hypothesis). Then 7 m+1 1 = 7 m = 7(7 m 1) + 6. But 7 m 1 is divisible by 6 (by the inductive hypothesis) nd so is 6, so 7 m+1 1 is lso divisible by 6. Hence proved by induction. 3. Suppose tht Alice sends the messge to Bob, encrypted using RSA. Suppose tht Bob s implementtion of RSA is buggy, nd computes k 1 mod 4φ(m) insted of k 1 mod φ(m). Wht decrypted messge does Bob see? Justify your nswer. Solution Alice trnsmits k mod m to Bob, who then computes ( k ) k 1 mod m. Becuse Bob miscomputed k 1, we know tht kk 1 1 mod 4φ(m). In other words, kk 1 = 1 + t 4φ(m) for some t. 5
6 Therefore Bob receives ( k ) k 1 1+4tφ(m) 4tφ(m) ( φ(m) ) 4t 1 4t mod m 4. () Wht re the units of Z mod 12? Solution A unit in set of numbers is number tht hs n inverse. In the set Z 12 = {[0], [1], [2], [3], [4], [5], [6], [7], [8] the units re [1], [5], [7], nd [11]. In generl, [n] is unit mod m if n nd m re reltively prime. (b) Wht re their inverses? Solution [1] 1 = [1], [5] 1 = [5], [7] 1 = [7], nd [11] 1 = [11]. This is becuse [1] [1] = [1], [5] [5] = [25] = [1], [7] [7] = [49] = [1] nd [11] [11] = [121] = 1. (c) Wht is φ(12)? Solution By definition of φ, φ(12) is the number of units mod 12. Since there re 4 units, φ(12) = Use Euler s theorem nd repeted squring to efficiently compute 8 n mod 15 for n = 5, n = 81 nd n = Hint: you cn solve this problem with 4 multiplictions of single digit numbers. Plese fully evlute ll expressions for this question (e.g. write 15 insted of 3 5). Solution We use the fct tht 8 ϕ(15) = 1 mod 15. ϕ(15) = (3 1)(5 1) = 8 [multipliction #1], so we cn reduce ll of the exponents mod 8. We then use repeted squring to compute 8 2k : [8] 1 = [8] [8] 2 = [64] = [4] [multipliction #2] [8] 4 = [4] 2 = [16] = [1] [multipliction #3] We cn then use these to compute the powers of [8]: [8] 5 = [8] 4 [8] = [1][8] = [8] [8] 81 = [8] 1 = [8] [8] = [8] 7 = [8] 4 [8] 2 [8] = [1][4][8] = [32] = [2] [multipliction #4] 6. In this problem, we re working mod 7, i.e. denotes congruence mod 7 nd [] is the equivlence of mod 7. () Wht re the units of Z 7? Wht re their inverses? 6
7 Solution [1] s inverse is [1] [2] s inverse is [4] [3] s inverse is [5] [4] s inverse is [2] [5] s inverse is [3] [6] s inverse is [6] (b) Compute [2] 393. Solution [2] 393 = ([2] 3 ) 131 = [1] 131 = [1] 7. () Recll Bézout s identity from the homework: for ny integers n nd m, there exist integers s nd t such tht gcd(n, m) = sn + tm. Use this to show tht if gcd(k, m) = 1 then [k] is unit of Z m. Solution If gcd(k, m) = 1 then 1 = sk + tm. Reducing this eqution mod m gives [1] = [s][k] + [t][0] = [s][k]. Therefore, [k] hs n inverse (nmely [s]); nd is thus unit. (b) Use prt () to show tht if p is prime, then φ(p) = p 1. Solution Since p is prime, everything less thn p is reltively prime to p, except for 0. There re p 1 such numbers, nd thus p 1 units. (c) Use Euler s theorem to compute 3 38 mod 37 (note: 37 is prime). Solution ϕ(37) = 36, so [3] 38 = [3] 2 = [9] mod Bob the Bomber wishes to receive encrypted messges from Alice the Accomplice. He genertes public key pir m = 21 nd k = 5. Luckily, you hve ccess to n NSA supercomputer tht ws ble to fctor 21 into 7 3. () Use this informtion to find the decryption key k 1. Solution We must find the inverse of 5 mod φ(m) = φ(7 3) = (7 1)(3 1) = 12. Experimentlly, [5 5] = [25] = [1]. Alterntively, you cn use the pulverizer. This results in 1 = , giving n inverse of 5. (b) Without chnging m, wht other possible keys k could Bob hve chosen? Find the decryption keys for those keys s well. Solution By inspection, the units of Z 12 re [1], [5], [7], nd [11] (ll other numbers shre fctor with 12). Experimentlly, they re ll their own inverses. Note tht [1] is not smrt key choice, but we ccepted it. (c) Alice encrypts secret messge msg using Bob s public key (k = 5), nd sends the ciphertext c = 4. Wht ws the originl messge? 7
8 Solution We must compute [4] [5] = [4 5 ]. We see [4 2 ] = [16]; squring this gives [4 4 ] = [(4 2 ) 2 ] = [256] = [4] 21. Thus [4 5 ] = [4 4 4 ] = [16]. 9. [4 points] Which of the following does RSA depend on? Explin your nswer briefly. () Fctoring is esy nd testing primlity is hrd. (b) Fctoring is hrd nd testing primlity is esy. (c) Both fctoring nd testing primlity re hrd. (d) Both fctoring nd testing primlity re esy. Solution RSA depends on (b), tht fctoring is hrd nd testing primlity is esy. The public key in RSA is the product of two lrge primes. We couldn t generte public keys if testing primlity wsn t esy. On the other hnd, we could esily decrypt encrypted messges if fctoring ws esy (becuse in tht cse, given public key, which is the product of two lrge primes could esily compute the secret the two fctors, nd tht s wht we need to know to decrypt. 10. () Let m nd n be integers greter thn 1. Show tht the function f : Z m Z n Z m given by f : ([] m, [b] n ) [ + b] m is not necessrily well defined. [Hint: you just need n exmple here.] Solution Consider m = 2, n = 3. Then [1] m = [3] m nd [1] n = [4] n, but [1 + 3] m = [0] m while [3 + 4] m = [1] m. (b) Show tht f is well defined if m n. Solution Suppose m n. Then n = mc for some c. Suppose lso tht [] m = [ ] m (so tht = + md for some d) nd [b] n = [b ] n (so tht b = b + ne). Then + b = ( + md) + (b + ne) = + b + md + mce = + b + m(d + ce) Thus [ + b] m = [ + b ] m. 8
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 informationCS2800 Questions selected for fall 2017
Discrete Structures Final exam sample questions Solutions CS2800 Questions selected for fall 2017 1. Determine the prime factorizations, greatest common divisor, and least common multiple of the following
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 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 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 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 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 informationFinite 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 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 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 informationFinite 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 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 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 informationHomework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama
CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)
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 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 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 information1 Functions, relations, and infinite cardinality
Discrete Structures Prelim 2 sample questions s CS2800 Questions selected for fall 2017 1 Functions, relations, and infinite cardinality 1. True/false. For each of the following statements, indicate whether
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 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 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 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 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 informationCS: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 informationFor convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir
CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction
More informationMath 130 Midterm Review
Mth 130 Midterm Review April 6, 2013 1 Topic Outline: The following outline contins ll of the mjor topics tht you will need to know for the exm. Any topic tht we ve discussed in clss so fr my pper on the
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 informationUSA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year
1/1/21. Fill in the circles in the picture t right with the digits 1-8, one digit in ech circle with no digit repeted, so tht no two circles tht re connected by line segment contin consecutive digits.
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 informationRevision Sheet. (a) Give a regular expression for each of the following languages:
Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)
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 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 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 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 informationMath 4310 Solutions to homework 1 Due 9/1/16
Mth 4310 Solutions to homework 1 Due 9/1/16 1. Use the Eucliden lgorithm to find the following gretest common divisors. () gcd(252, 180) = 36 (b) gcd(513, 187) = 1 (c) gcd(7684, 4148) = 68 252 = 180 1
More informationHomework Solution - Set 5 Due: Friday 10/03/08
CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.
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 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 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 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 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 informationMATH 573 FINAL EXAM. May 30, 2007
MATH 573 FINAL EXAM My 30, 007 NAME: Solutions 1. This exm is due Wednesdy, June 6 efore the 1:30 pm. After 1:30 pm I will NOT ccept the exm.. This exm hs 1 pges including this cover. There re 10 prolems.
More informationSome Theory of Computation Exercises Week 1
Some Theory of Computtion Exercises Week 1 Section 1 Deterministic Finite Automt Question 1.3 d d d d u q 1 q 2 q 3 q 4 q 5 d u u u u Question 1.4 Prt c - {w w hs even s nd one or two s} First we sk whether
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 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 informationCS 330 Formal Methods and Models
CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q
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 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 informationNon 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 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 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 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 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 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 informationPARTIAL FRACTION DECOMPOSITION
PARTIAL FRACTION DECOMPOSITION LARRY SUSANKA 1. Fcts bout Polynomils nd Nottion We must ssemble some tools nd nottion to prove the existence of the stndrd prtil frction decomposition, used s n integrtion
More informationNFAs 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 informationClosure Properties of Regular Languages
Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L
More informationConsolidation Worksheet
Cmbridge Essentils Mthemtics Core 8 NConsolidtion Worksheet N Consolidtion Worksheet Work these out. 8 b 7 + 0 c 6 + 7 5 Use the number line to help. 2 Remember + 2 2 +2 2 2 + 2 Adding negtive number is
More informationCS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions
CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p
More informationAutomata 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 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 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 information11.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 informationSUMMER KNOWHOW STUDY AND LEARNING CENTRE
SUMMER KNOWHOW STUDY AND LEARNING CENTRE Indices & Logrithms 2 Contents Indices.2 Frctionl Indices.4 Logrithms 6 Exponentil equtions. Simplifying Surds 13 Opertions on Surds..16 Scientific Nottion..18
More information1 Functions, relations, and infinite cardinality
Discrete Structures Prelim 2 sample questions CS2800 Questions selected for fall 2017 1 Functions, relations, and infinite cardinality 1. True/false. For each of the following statements, indicate whether
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 informationLecture 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 informationMATH 101A: ALGEBRA I PART B: RINGS AND MODULES 35
MATH 101A: ALGEBRA I PART B: RINGS AND MODULES 35 9. Modules over PID This week we re proving the fundmentl theorem for finitely generted modules over PID, nmely tht they re ll direct sums of cyclic modules.
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) - Spring L. Blum
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES nd REGULAR EXPRESSIONS TUESDAY Jn 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w hs equl numer of
More informationCSCI 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 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 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 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 informationLecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.
Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one
More informationARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac
REVIEW OF ALGEBRA Here we review the bsic rules nd procedures of lgebr tht you need to know in order to be successful in clculus. ARITHMETIC OPERATIONS The rel numbers hve the following properties: b b
More informationLecture 6 Regular Grammars
Lecture 6 Regulr Grmmrs COT 4420 Theory of Computtion Section 3.3 Grmmr A grmmr G is defined s qudruple G = (V, T, S, P) V is finite set of vribles T is finite set of terminl symbols S V is specil vrible
More informationIs there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them!
PUSHING PYTHAGORAS 009 Jmes Tnton A triple of integers ( bc,, ) is clled Pythgoren triple if exmple, some clssic triples re ( 3,4,5 ), ( 5,1,13 ), ( ) fond of ( 0,1,9 ) nd ( 119,10,169 ). + b = c. For
More informationSOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014
SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 014 Mrk Scheme: Ech prt of Question 1 is worth four mrks which re wrded solely for the correct nswer.
More informationE 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)
cs3102: Theory of Computtion Clss 5: Non-Regulr PS1, Prolem 8 Menu Non-regulr lnguges Spring 2010 University of Virgini Dvid Evns PS1 Generl Comments Proofs re for mking convincing rguments, not for ofusction.
More informationQuadratic reciprocity
Qudrtic recirocity Frncisc Bozgn Los Angeles Mth Circle Octoer 8, 01 1 Qudrtic Recirocity nd Legendre Symol In the eginning of this lecture, we recll some sic knowledge out modulr rithmetic: Definition
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 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 informationTuring 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 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 informationCOMPUTER 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 informationTuring Machines Part One
Turing Mchines Prt One Wht problems cn we solve with computer? Regulr Lnguges CFLs Lnguges recognizble by ny fesible computing mchine All Lnguges Tht sme drwing, to scle. All Lnguges The Problem Finite
More informationCS 330 Formal Methods and Models
CS 330 Forml Methods nd Models Dn Richrds, section 003, George Mson University, Fll 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 7 1. Prove (p q) (p q), () (5pts) using truth tles. p q
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 informationDISCRETE MATHEMATICS HOMEWORK 3 SOLUTIONS
DISCRETE MATHEMATICS 21228 HOMEWORK 3 SOLUTIONS JC Due in clss Wednesdy September 17. You my collborte but must write up your solutions by yourself. Lte homework will not be ccepted. Homework must either
More informationThe 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 informationMyhill-Nerode Theorem
Overview Myhill-Nerode Theorem Correspondence etween DA s nd MN reltions Cnonicl DA for L Computing cnonicl DFA Myhill-Nerode Theorem Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute
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 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 information3 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 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 information(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer
Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.
More informationToday s Topics Automata and Languages
Tody s Topics Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn DFA to Regulr Expression GFNA DFAèGNFA GNFA è RE DFA è RE Exmples 2 DFA è RE NFA DFA -NFA REX GNFA 3 Definition
More informationAutomata and Languages
Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Tody s Topics DFA to Regulr Expression GFNA DFAèGNFA GNFA è RE DFA è RE Exmples 2 DFA è RE NFA DFA -NFA REX GNFA 3 Definition
More informationCS 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