AUBER (Models of Computation, Languages and Automata) EXERCISES

Size: px
Start display at page:

Download "AUBER (Models of Computation, Languages and Automata) EXERCISES"

Transcription

1 AUBER (Models of Computation, Languages and Automata) EXERCISES Xavier Vera, 2002

2 Languages and alphabets 1.1 Let be an alphabet, and λ the empty string over. (i) Is λ in? (ii) Is it true that λλλ=λ? Is it true for λ i, i 2? (iii) Let x and y be two strings over. Is the concatenation of x and y always equal to the concatenation of y and x? Describe when this situation holds. 1.2 A string is infinite when its length is infinite. Let be an alphabet. Does * contain any infinite string? If we change the restriction that makes finite, and let it be infinite, does it change the answer? 1.3 Let x, y and z be three strings over alphabet. Prove that xy concatenated with z is always the same as concatenating x with yz; this is, that concatenation is associative. 1.4 For a string x, x R is the same string read backward. Prove that (xy) R =y R x R, for any x y over. (hint: try to define x R inductively) 1.5 Prove: (i) (ii) (iii) There is no string x over {a,b} * such that ax=xb. If x is in {a,b} * and abx=xab, then there exists n such that x=(ab) n If w is a prefix of y and x is a prefix of yz, then either w is a prefix of x or x is a prefix of w. 1.6 Let u, v, w, z be strings over * such that uv=wz. Prove that there exists y in * such that: either uy=w and v=yz, or u=wy and yv=z 1.7 Let L i in *, i=1,2,3, be three languages. Are the following claims true? (i) (L 1 L 2 )L 3 =L 1 (L 2 L 3 ) (ii) (L 1 L 2 )L 3 =L 1 L 3 L 2 L 3 (iii) L 1 (L 2 L 3 )=L 1 L 2 L 1 L 3 (iv) (L 1 L 2 )L 3 =L 1 L 3 L 2 L 3 (v) L 1 (L 2 L 3 )=L 1 L 2 L 1 L 3 (vi) (L C ) C =L (vii) (L C ) * =(L * ) C (viii) (L 1 L 2 ) * =(L * 1 L * 2 ) * (ix) (L 1 L 2 L 1 ) * =L 1 (L 2 L 1 L 1 ) * 2

3 (x) (L 1 L 2 L 1 )*=L 1 (L 2 L 1 L 2 ) * (xi) (L * 1 ) * * =L 1 (xii) (L 1 L 2 ) * L 1 =L 1 (L 2 L 1 ) * * (xiii) L 1 =L 1 (xiv) (L 1 L 2 ) * =L * * 1 L 2 (xv) (L + 1 ) * =(L * 1 ) + (xvi) (L + 1 ) * * =L 1 (xvii) L + 1 L =L 1 (xviii) (Ø) + =(Ø) * In case the claims are false in the general case, try to describe in which particular situations they are true. 1.8 Give examples of strings that belong and those that do not belong to the following languages defined over {a,b}: (i) (ii) (iii) (iv) {w u (w=uu R u)} {w ww=www} {w u,v (uvw=wvu)} {w u (uu=www)} 1.9 Give formal expressions for the following languages over {0,1}: (i) Strings that contain 000 but do not contain 001 (ii) Strings with at least one substring with length 3 which appears 3 or more times. (iii) Strings which none prefix represents, in binary, a multiple of 3. (iv) Strings with even length which codify an odd number. (v) Strings which has one prefix with more 0 s than 1 s. (vi) Strings with one suffix which is palindrome and length 3 (vii) Strings with a suffix equal to a prefix. (viii) Strings that if start with 00, do not concatenate 11. (ix) Strings that do not contain 000 and 111 at the same time. (x) Strings we can concatenate another string to in order to get a palindrome string. (xi) Strings with a substring that codify a prime number larger than 5. (xii) Strings which contain a number of 1 s multiple of Let ={a,b,c} and L={c i xc j : i,j 0, x=λ or x=aw or x=wb, w * }. Is L= *? Is L 2 = *? 3

4 Finite Automata 2.1 We are living in a building with 6 floors, and a new elevator is being installed. Since your mum is telling everyone that you are studying computer science, the board asks you to design the system that controls the decisions of the elevator. 2.2 Let M be the following DFA (i) Write down four strings accepted by M and the sequence of configurations that prove it (ii) Write down four strings that are not accepted by M. 2.3 Which are the languages accepted by the following automata? 4

5 2.4 Let M be the following NFA: (i) Write down four strings accepted by M and the sequence of configurations that prove it (ii) Write down four strings that are not accepted by M. 2.5 Prove that the following automata accepts the language L={a i b j, a i c j : i,j 1}. 2.6 Give DFA s that accept the following languages: (i) Strings over {a,b} that end in aa. (ii) Strings over {a,b} with three consecutive a s. (iii) Strings over {a,b} that do not contain the string aaa. (iv) The set of all the strings over {a,b} such that each string of length 5 contains at least two a s. (v) The set of all the strings over {a,b} such that the fifth symbol from the right is a b. (vi) The strings over {a,b} that have a pair of a s separated by a string of length 4i, i 0. (vii) The set of all the strings over {a,b} where all pairs of a s are just before a pair of b s. (viii) Strings λ, 001 and (ix) Strings over {0,1} that starts with 1 and that interpreted as binary numbers are 0 mod 5. (x) {w {a,b} * : w a =2n, w b =2m, m, n N} 5

6 (xi) {w {a,b} * : w =3n, n N and w does not contain aba} 2.7 Describe algorithms that decide: (i) (ii) (iii) (iv) whether two automata M and M accept the same language if an automata accepts, at least, one string if an automata accepts the language which contains all strings with odd length whether an automata accepts a cofinite language. 6

7 Regular Languages 3.1 Let E be the following regular expression: (i) Is L(E)={a,b,c} *? (ii) Is L(EE)={a,b,c} *? c * (λ+a(a+b+c) * +(a+b+c) * b)c * 3.2 Build regular expressions that are equivalent to the following languages over {a,b,c} of the strings that fulfill the following conditions: (i) there is an even number of a s in w, (ii) there are 4i+1 b s in w, i 0 (iii) w =3i, i 0 (iv) string abc does not appear in w. 3.3 A regular expression is ambiguous when there is a string that can be obtained following two different ways. Which regular expressions are ambiguous? (i) a((ab) * cd) * +a(ababcb * ) * a * (ii) aab * (ab) * +ab * +a * bba * (iii) aaba * +aaaba+aabba * +a 3.4 Build DFAs that recognize the languages defined by the regular expressions: (i) a * ba * ab * (ii) b((aab * +a 4 )b) * a (iii) ab[((ba) * +bbb) * +a] * b 3.5 Say whether the following equalities are true or false, where r, s and t are regular expressions. (r=s means, L(r)=L(s)) (i) r(sr) * =(rs) * r (ii) (r * s) * r * =(r+s) * (iii) (rs+r) * r=r(sr+r) * (iv) s(rs+s) * r=rr * s(rr * s) * (v) (r+s) * =r * +s * (vi) (λ+(0+1) * 100)0 * =λ+0+(0+1) * 00 (vii) (λ+1)0 * (1+110 * ) * =1 * ( ) * 1 * (viii) ( ) * 0(0+1+01)0(0+1) * =(0+1) * 0(0+1)0(0+1) * 3.6 Build regular expressions equivalent to the following DFA s: 7

8 3.7 Find regular expressions for the DFAs defined in exercises 2.3 and Build a DFA equivalent to the regular expression: (00+(1+01)(11+0) * 10) * 3.9 Obtain the regular expression for the following automata and simplify it until you get ( ) * 100 * 3.10 Is it true that if a language is the union of non-regular languages, it can not be regular? What about intersection? And concatenation? If it is true, prove it. Otherwise, give counterexamples Prove that the following languages are not regular: (i) {0 m 1 n 0 m+n : m,n 1} (ii) {ww: w (0+1) + } (iii) {(01) n (10) n : n 0} (iv) The set of all the strings over {0,1} with the same number of 1 s and 0 s. (v) {w (0+1) * : w=w R } (vi) {xx R w: x,w (0+1) + } (vii) {0 n : n is prime} (viii) {0 n : n is compound} 8

9 (ix) {0 m 1 n : m n} (x) {0 m 1 n : (m,n)=1} (m,n) is the gcd 3.12 Let L, defined over {0,1}, the set of the strings that interpreted as a number in binary are multiple of 3. Prove that L=L R Prove that if L is regular, L R is regular. 9

10 Grammars Consider the following languages: (i) The set of lists with compensated parenthesis, this is, where each left parenthesis has its right parenthesis, and they are correctly nested. (ii) The set of all strings over alphabet {a,b,.,*,(,),λ, } which are regular expressions over {a,b}. We should distinguish between λ as the empty string and λ as a symbol in the regular expression, which we denote as. (iii) {w (a+b) * :w=w R } (iv) {ww R :w (0+1) * } (v) The set {w#w R #:w (0+1) + } * (vi) The language of such strings over {a,b} such that each prefix has at least the same number of a s as b s. (vii) {a i b i c j d j :i,j 1} (viii) {a i b j b i a j :i,j 0} (ix) {0 m 1 n :m>n 0} (x) {a i b j c k :i j or j k} (xi) {0 k 1 m 0 n :n=k+m} (xii) {a n b m :1 n 2m} (xiii) {0 i 1 j 2 k :i=j or j=k} (xiv) {0 n 1 m :m=n or m=2n} (xv) {0 n 1 m :m n 2m} (xvi) The set of all strings over {0,1} with the same number of 0 as 1. (xvii) The set of all strings over {a,b} that have double numbers of a s as b s. (xviii) a * c * b * +(a * d) * cb * (xix) a * ba * ab * (xx) a((ab) * cb * ) * +a(ababcb * ) * a * (xxi) (a+b+c) * -{a k b k c k :k>0} 4.1 Give CFGs that generate the previous languages 4.2 Prove that the previous grammars actually generate those languages 4.3 Let G be a CFG with m variables, whose productions do not have a right side with length larger than k. Prove that if A * λ, there is a derivation of (km-1)/(k-1) steps at most from A to λ. Is possible to improve this lower bound? 4.4 Prove that for each grammar G there is a constant c such that if w L(G) and w λ, then w has a derivation with at most c w steps. 4.5 A grammar is right linear if all its productions have the following shape, either X wy or X v, where w and v belong to * and X and Y are variables. Prove that for all right linear grammars there is another equivalent one which has all the productions such as X ay or X λ, where a belongs to. 4.6 Simplify and transform all grammars from ex. 4.1 to Chomsky Form. 10

11 4.7 Let L 1 and L 2 two CFLs. Prove that: is a CFL. U n 1 ( L 1 ) n n ( L2 ) 4.8 Prove that the following grammar: S abs abs bas λ A baa a B abb b (i) (ii) It generates the language of all strings with the same number of a s as b s. It is not ambiguous. 4.9 Prove that for all languages L, L is CFL iff L R is CFL. 11

12 Pushdown Automata (PDA) 5.1 Give deterministic pushdown automata for the following languages: (i) {a 2i cb i :i 0} (ii) {a 2i+1 b i :i 0} (iii) {xcx R :x (a+b) * } (iv) {x:x (a+b) * and x a = x b } (v) The languages 1, 6, 7, 9, 11, 12 and 17 proposed in previous chapter. 5.2 Justify via pushdown automata that the following languages are not CFL: (i) {a i b j c k :i<j<k} (ii) {w (a+b+c) * : w a = w b = w c } (iii) {a n b n c m :n m 2n} (iv) {a i b j c k :i j k i} (v) {a i b j c k :i j k} (vi) {a i b j c i d j :i,j>0} (vii) {ww:w (a+b) * } (viii) {a i b j a k :k=max(i,k)} 5.3 Prove via the pumping lemma that languages from exercise 5.2 are not CFL. 12

13 Turing Machines 6.1 Design a Turing Machine that accepts the following languages over ={a,b} (i) {aba n b n 0} (ii) {w w is even} (iii) {a n b m n 1 and m n} (iv) {w w a = w b } (v) {a n b m a n+m n 0, m 1} (vi) {a n b n a n b m n 0, m 0} (vii) {a n b 2n n 1} (viii) {ww w {a,b} * } (ix) {w w=w R } (x) Set of strings over {(,)} that have balanced parenthesis 6.2 Build a TM which computes the parity function of the natural numbers: f(n)= 0 if n is even 1 if n is odd 6.3 Design a copy machine C. C transforms bwb to b3wb (b is the blank symbol) 6.4 Build a TM that computes f(n,m)=nm 6.5 Build a TM that computes f(n,m)=n-m, for n,m Naturals. How do you cope with n-m<0? 6.6 Build a TM such that: (i) Computes the integer function f(n)= floor(n/2) (ii) Given a string w and an integer n w, moves the reader/writer to the n- th symbol of w (iii) Adds two binary numbers (iv) Generate the complementary of a binary number (v) Shifts a binary number to the left, inserting 0. 13

14 Decidability 7.1 Classify the following problems as recursive, e.r or non of them. (i) A={x x,y f x (y)=z} (ii) A={x y f x (y)=y} (iii) A={x f x (x)=x} (iv) A={x Dom(f x ) is recursive} (v) A={x Dom(f x ) is not recursive} (vi) A={x Im(f x ) is recursive} (vii) A={x Im(f x ) is not recursive} (viii) A={x Dom(f x ) is e.r} (ix) A={x Dom(f x ) is recursive} 7.2 Let f be a decidable function. Let N(f)={x f(x)=0}. Prove that N(f) is e.r but it can t be recursive. 7.3 Classify the following languages/problems as recursive, e.r or non of them. (i) A={<x,y,z,t> M x (y)=z in t or less steps} (ii) A={<x,y,z,t> M x (y)=z in more than t steps} (iii) A={x z M x with input z halts in z steps} (iv) A={<x,y,z,t> M x (t)=m y (t)=m z (t)} (v) A={x f x =Id} (vi) A={x f x (2000) and f x (1000) } (vii) A={x y x f x =f y } (viii) A={<x,y> fx(y) or ( z x f x (y)=f z (y))} 7.4 Consider the problem of testing whether a Turing machine M on input w ever attempts to move its head left when its head is on the left-most tape cell. Formulate this problem as a language and show that it is undecidable. 7.5 A common operation in Turing-machine programs involves shifting over. We need to move the contents of each of the cells to the right of the current head position one cell right, and then find our way back to the current head position. (a) (b) Give the high level description of how to perform this operation. Hint: Leave a special symbol to mark the position to which the head must return. Design a Turing machine that shifts the entire input string one cell to the right. In this part, you are to give the formal description of the machine (you can draw the state diagram, or provide the delta function for the entire domain). Precisely, you will design a Turing machine M such that, given an input string w {0,1}*, M s accepting configuration will be q accept #w. 14

15 Recursive Functions 8.1 Write a recursive function that decides whether a number is a perfect square. 8.2 Write a recursive definition of the factorial of a natural number. 8.3 Write the following function in a recursive fashion: even(n)= 0 if n is even, 1 otherwise. 15

16 Unsorted Exercises 1. Given the following automata, which is minimal, prove that it accepts the language of all the strings over {0,1} * which length is odd and that do not ever have the same symbol in consecutive positions. 2. Prove that the language of the strings over {0,1} * that do not have the substring 010, is the same as L(E), where E is 1 * ( ) * 1 * 3. Prove that L={w {0,1}* u www=uu} is not regular. 4. Let R be the language over {a,b} accepted by the following automata. Give a CFG that accepts the language L over {a,b,#} defined by: L={x#y x,y {a,b} * x = y x R} 16

17 5. Let L 1 and L 2 be the languages represented by the following automata. Give the minimal DFA that represents L1 L2. 6. Determinize the following automata. 7. Which is the DFA that represents the following language: L=L C a? 8. Let L be a regular language. What can we say about the following language L 1 ={w ww R ww R L}? 9. Which of the following languages are regular? {a n b m n>m n<m} {a n b m n m n m} {a n b m n>m n<m} {a n b m n m n m} 10. How many states do we need to describe the following language, L ij ={a k k is a multiple of i or j}? HINT: Make some particular cases. 11. What can you say about L={w {a,b}* abw=wba}? Is it the empty set? Is it regular? 12. Build the minimal DFA that recognizes the strings w over {a,b}, such that their length is larger than 4 and all the prefixes of length equal to 4 have the same number of a as b. (11 states) 13. Build the minimal DFA equivalent to the following regular expression: ((a+b)*+c)(ac)*b+a (8 states) 17

18 14. We say that x is a root of w if n 0 such that w=x n. Then, we define the root of a language L as root(l)={x n 0 x n L}. Prove that for any language L * : λ L <=> * =root(l) 18

JNTUWORLD. Code No: R

JNTUWORLD. Code No: R Code No: R09220504 R09 SET-1 B.Tech II Year - II Semester Examinations, April-May, 2012 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks: 75 Answer any five

More information

UNIT I PART A PART B

UNIT I PART A PART B OXFORD ENGINEERING COLLEGE (NAAC ACCREDITED WITH B GRADE) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS YEAR/SEM: III/V STAFF NAME: Dr. Sangeetha Senthilkumar SUB.CODE: CS6503 SUB.NAME:

More information

Multiple Choice Questions

Multiple Choice Questions Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Formal Language and Automata Theory Subject Code: CS 402 Multiple Choice Questions 1. The basic limitation of an FSM

More information

QUESTION BANK. Formal Languages and Automata Theory(10CS56)

QUESTION BANK. Formal Languages and Automata Theory(10CS56) QUESTION BANK Formal Languages and Automata Theory(10CS56) Chapter 1 1. Define the following terms & explain with examples. i) Grammar ii) Language 2. Mention the difference between DFA, NFA and εnfa.

More information

Skyup's Media. PART-B 2) Construct a Mealy machine which is equivalent to the Moore machine given in table.

Skyup's Media. PART-B 2) Construct a Mealy machine which is equivalent to the Moore machine given in table. Code No: XXXXX JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD B.Tech II Year I Semester Examinations (Common to CSE and IT) Note: This question paper contains two parts A and B. Part A is compulsory

More information

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III Year, V Semester Section : CSE - 1 & 2 Subject Code : CS6503 Subject

More information

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar Code No: R05310501 Set No. 1 III B.Tech I Semester Regular Examinations, November 2008 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science & Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE

More information

Compiler Construction

Compiler Construction Compiler Construction Exercises 1 Review of some Topics in Formal Languages 1. (a) Prove that two words x, y commute (i.e., satisfy xy = yx) if and only if there exists a word w such that x = w m, y =

More information

QUESTION BANK. Unit 1. Introduction to Finite Automata

QUESTION BANK. Unit 1. Introduction to Finite Automata QUESTION BANK Unit 1 Introduction to Finite Automata 1. Obtain DFAs to accept strings of a s and b s having exactly one a.(5m )(Jun-Jul 10) 2. Obtain a DFA to accept strings of a s and b s having even

More information

R10 SET a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA?

R10 SET a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA? R1 SET - 1 1. a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA? 2. a) Design a DFA that accepts the language over = {, 1} of all strings that

More information

1. Which of the following regular expressions over {0, 1} denotes the set of all strings not containing 100 as a sub-string?

1. Which of the following regular expressions over {0, 1} denotes the set of all strings not containing 100 as a sub-string? Multiple choice type questions. Which of the following regular expressions over {, } denotes the set of all strings not containing as a sub-string? 2. DFA has a) *(*)* b) ** c) ** d) *(+)* a) single final

More information

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which: P R O B L E M S Finite Autom ata. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which: a) Are a multiple of three in length. b) End with the string

More information

CMSC 330, Fall 2009, Practice Problem 3 Solutions

CMSC 330, Fall 2009, Practice Problem 3 Solutions CMC 330, Fall 2009, Practice Problem 3 olutions 1. Context Free Grammars a. List the 4 components of a context free grammar. Terminals, non-terminals, productions, start symbol b. Describe the relationship

More information

CpSc 421 Final Solutions

CpSc 421 Final Solutions CpSc 421 Final Solutions Do any eight of the ten problems below. If you attempt more than eight problems, please indicate which ones to grade (otherwise we will make a random choice). This allows you to

More information

1. [5 points each] True or False. If the question is currently open, write O or Open.

1. [5 points each] True or False. If the question is currently open, write O or Open. University of Nevada, Las Vegas Computer Science 456/656 Spring 2018 Practice for the Final on May 9, 2018 The entire examination is 775 points. The real final will be much shorter. Name: No books, notes,

More information

Automata Theory TEST 1 Answers Max points: 156 Grade basis: 150 Median grade: 81%

Automata Theory TEST 1 Answers Max points: 156 Grade basis: 150 Median grade: 81% Automata Theory TEST 1 Answers Max points: 156 Grade basis: 150 Median grade: 81% 1. (2 pts) See text. You can t be sloppy defining terms like this. You must show a bijection between the natural numbers

More information

AUTOMATA THEORY AND COMPUTABILITY

AUTOMATA THEORY AND COMPUTABILITY AUTOMATA THEORY AND COMPUTABILITY QUESTION BANK Module 1 : Introduction to theory of computation and FSM Objective: Upon the completion of this chapter you will be able to Define Finite automata, Basic

More information

Decision Properties for Context-free Languages

Decision Properties for Context-free Languages Previously: Decision Properties for Context-free Languages CMPU 240 Language Theory and Computation Fall 2018 Context-free languages Pumping Lemma for CFLs Closure properties for CFLs Today: Assignment

More information

Theory of Computation, Homework 3 Sample Solution

Theory of Computation, Homework 3 Sample Solution Theory of Computation, Homework 3 Sample Solution 3.8 b.) The following machine M will do: M = "On input string : 1. Scan the tape and mark the first 1 which has not been marked. If no unmarked 1 is found,

More information

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR-621113 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Third Year CSE( Sem:V) CS2303- THEORY OF COMPUTATION PART B-16

More information

CS5371 Theory of Computation. Lecture 8: Automata Theory VI (PDA, PDA = CFG)

CS5371 Theory of Computation. Lecture 8: Automata Theory VI (PDA, PDA = CFG) CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG) Objectives Introduce Pushdown Automaton (PDA) Show that PDA = CFG In terms of descriptive power Pushdown Automaton (PDA) Roughly

More information

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata Solved Subjective From Midterm Papers Dec 07,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 MIDTERM SPRING 2012 Q. Point of Kleen Theory. Answer:- (Page 25) 1. If a language can be accepted

More information

CMSC 330 Practice Problem 4 Solutions

CMSC 330 Practice Problem 4 Solutions CMC 330 Practice Problem 4 olutions 1. Context Free Grammars a. List the 4 components of a context free grammar. Terminals, non-terminals, productions, start symbol b. Describe the relationship between

More information

CT32 COMPUTER NETWORKS DEC 2015

CT32 COMPUTER NETWORKS DEC 2015 Q.2 a. Using the principle of mathematical induction, prove that (10 (2n-1) +1) is divisible by 11 for all n N (8) Let P(n): (10 (2n-1) +1) is divisible by 11 For n = 1, the given expression becomes (10

More information

Learn Smart and Grow with world

Learn Smart and Grow with world Learn Smart and Grow with world All Department Smart Study Materials Available Smartkalvi.com TABLE OF CONTENTS S.No DATE TOPIC PAGE NO. UNIT-I FINITE AUTOMATA 1 Introduction 1 2 Basic Mathematical Notation

More information

Theory Bridge Exam Example Questions Version of June 6, 2008

Theory Bridge Exam Example Questions Version of June 6, 2008 Theory Bridge Exam Example Questions Version of June 6, 2008 This is a collection of sample theory bridge exam questions. This is just to get some idea of the format of the bridge exam and the level of

More information

CS210 THEORY OF COMPUTATION QUESTION BANK PART -A UNIT- I

CS210 THEORY OF COMPUTATION QUESTION BANK PART -A UNIT- I CS210 THEORY OF COMPUTATION QUESTION BANK PART -A UNIT- I 1) Is it true that the language accepted by any NDFA is different from the regular language? Justify your answer. 2) Describe the following sets

More information

Closure Properties of CFLs; Introducing TMs. CS154 Chris Pollett Apr 9, 2007.

Closure Properties of CFLs; Introducing TMs. CS154 Chris Pollett Apr 9, 2007. Closure Properties of CFLs; Introducing TMs CS154 Chris Pollett Apr 9, 2007. Outline Closure Properties of Context Free Languages Algorithms for CFLs Introducing Turing Machines Closure Properties of CFL

More information

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA TABLE OF CONTENTS SNo DATE TOPIC PAGE NO UNIT-I FINITE AUTOMATA 1 Introduction 1 2 Basic Mathematical Notation Techniques 3 3 Finite State systems 4 4 Basic Definitions 6 5 Finite Automaton 7 6 DFA NDFA

More information

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 The entire examination is 925 points. The real final will be much shorter. Name: No books, notes, scratch paper, or calculators. Use pen

More information

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

Theory of Computation Dr. Weiss Extra Practice Exam Solutions Name: of 7 Theory of Computation Dr. Weiss Extra Practice Exam Solutions Directions: Answer the questions as well as you can. Partial credit will be given, so show your work where appropriate. Try to be

More information

Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5

Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5 Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5 1 Not all languages are regular So what happens to the languages which are not regular? Can we still come up with a language recognizer?

More information

DVA337 HT17 - LECTURE 4. Languages and regular expressions

DVA337 HT17 - LECTURE 4. Languages and regular expressions DVA337 HT17 - LECTURE 4 Languages and regular expressions 1 SO FAR 2 TODAY Formal definition of languages in terms of strings Operations on strings and languages Definition of regular expressions Meaning

More information

Ambiguous Grammars and Compactification

Ambiguous Grammars and Compactification Ambiguous Grammars and Compactification Mridul Aanjaneya Stanford University July 17, 2012 Mridul Aanjaneya Automata Theory 1/ 44 Midterm Review Mathematical Induction and Pigeonhole Principle Finite Automata

More information

CS402 - Theory of Automata Glossary By

CS402 - Theory of Automata Glossary By CS402 - Theory of Automata Glossary By Acyclic Graph : A directed graph is said to be acyclic if it contains no cycles. Algorithm : A detailed and unambiguous sequence of instructions that describes how

More information

Theory of Computation

Theory of Computation Theory of Computation For Computer Science & Information Technology By www.thegateacademy.com Syllabus Syllabus for Theory of Computation Regular Expressions and Finite Automata, Context-Free Grammar s

More information

T.E. (Computer Engineering) (Semester I) Examination, 2013 THEORY OF COMPUTATION (2008 Course)

T.E. (Computer Engineering) (Semester I) Examination, 2013 THEORY OF COMPUTATION (2008 Course) *4459255* [4459] 255 Seat No. T.E. (Computer Engineering) (Semester I) Examination, 2013 THEY OF COMPUTATION (2008 Course) Time : 3 Hours Max. Marks : 100 Instructions : 1) Answers to the two Sections

More information

CS402 - Theory of Automata FAQs By

CS402 - Theory of Automata FAQs By CS402 - Theory of Automata FAQs By Define the main formula of Regular expressions? Define the back ground of regular expression? Regular expressions are a notation that you can think of similar to a programming

More information

CS/B.Tech/CSE/IT/EVEN/SEM-4/CS-402/ ItIauIafIaAblll~AladUnrtel1ity

CS/B.Tech/CSE/IT/EVEN/SEM-4/CS-402/ ItIauIafIaAblll~AladUnrtel1ity CS/B.Tech/CSE/IT/EVEN/SEM-4/CS-402/2015-16 ItIauIafIaAblll~AladUnrtel1ity ~ t; ~~ ) MAULANA ABUL KALAM AZAD UNIVERSITY OF TECHNOLOGY, WEST BENGAL Paper Code: CS-402 FORMAL LANGUAGE AND AUTOMATA THEORY

More information

Regular Languages (14 points) Solution: Problem 1 (6 points) Minimize the following automaton M. Show that the resulting DFA is minimal.

Regular Languages (14 points) Solution: Problem 1 (6 points) Minimize the following automaton M. Show that the resulting DFA is minimal. Regular Languages (14 points) Problem 1 (6 points) inimize the following automaton Show that the resulting DFA is minimal. Solution: We apply the State Reduction by Set Partitioning algorithm (särskiljandealgoritmen)

More information

Answer All Questions. All Questions Carry Equal Marks. Time: 20 Min. Marks: 10.

Answer All Questions. All Questions Carry Equal Marks. Time: 20 Min. Marks: 10. Code No: 134BD Set No. 1 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech. II Year II Sem., I Mid-Term Examinations, February - 2018 FORMAL LANGUAGES AND AUTOMATA THEORY Objective Exam Name:

More information

CS 44 Exam #2 February 14, 2001

CS 44 Exam #2 February 14, 2001 CS 44 Exam #2 February 14, 2001 Name Time Started: Time Finished: Each question is equally weighted. You may omit two questions, but you must answer #8, and you can only omit one of #6 or #7. Circle the

More information

Automata Theory CS S-FR Final Review

Automata Theory CS S-FR Final Review Automata Theory CS411-2015S-FR Final Review David Galles Department of Computer Science University of San Francisco FR-0: Sets & Functions Sets Membership: a?{a,b,c} a?{b,c} a?{b,{a,b,c},d} {a,b,c}?{b,{a,b,c},d}

More information

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and Computer Language Theory Chapter 4: Decidability 1 Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 11 Ana Bove April 26th 2018 Recap: Regular Languages Decision properties of RL: Is it empty? Does it contain this word? Contains

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down

More information

Theory of Computations Spring 2016 Practice Final

Theory of Computations Spring 2016 Practice Final 1 of 6 Theory of Computations Spring 2016 Practice Final 1. True/False questions: For each part, circle either True or False. (23 points: 1 points each) a. A TM can compute anything a desktop PC can, although

More information

Decidable Problems. We examine the problems for which there is an algorithm.

Decidable Problems. We examine the problems for which there is an algorithm. Decidable Problems We examine the problems for which there is an algorithm. Decidable Problems A problem asks a yes/no question about some input. The problem is decidable if there is a program that always

More information

Context-Free Grammars

Context-Free Grammars Context-Free Grammars 1 Informal Comments A context-free grammar is a notation for describing languages. It is more powerful than finite automata or RE s, but still cannot define all possible languages.

More information

Glynda, the good witch of the North

Glynda, the good witch of the North Strings and Languages It is always best to start at the beginning -- Glynda, the good witch of the North What is a Language? A language is a set of strings made of of symbols from a given alphabet. An

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.2, 3.3 Define variants of TMs Enumerators Multi-tape TMs Nondeterministic TMs

More information

R10 SET a) Explain the Architecture of 8085 Microprocessor? b) Explain instruction set Architecture Design?

R10 SET a) Explain the Architecture of 8085 Microprocessor? b) Explain instruction set Architecture Design? Code No: R22054 COMPUTER ORGANIZATION (Com. to CSE, ECC) 1. a) Explain the Architecture of 8085 Microprocessor? b) Explain instruction set Architecture Design? 2. Explain Memory Subsystem Organization

More information

LECTURE NOTES THEORY OF COMPUTATION

LECTURE NOTES THEORY OF COMPUTATION LECTURE NOTES ON THEORY OF COMPUTATION P Anjaiah Assistant Professor Ms. B Ramyasree Assistant Professor Ms. E Umashankari Assistant Professor Ms. A Jayanthi Assistant Professor INSTITUTE OF AERONAUTICAL

More information

Chapter Seven: Regular Expressions

Chapter Seven: Regular Expressions Chapter Seven: Regular Expressions Regular Expressions We have seen that DFAs and NFAs have equal definitional power. It turns out that regular expressions also have exactly that same definitional power:

More information

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems The Turing Machine Unsolvable Problems Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical machine

More information

LECTURE NOTES THEORY OF COMPUTATION

LECTURE NOTES THEORY OF COMPUTATION LECTURE NOTES ON THEORY OF COMPUTATION Dr. K Rajendra Prasad Professor Ms. N Mamtha Assistant Professor Ms. S Swarajya Lakshmi Assistant Professor Mr. D Abdulla Assistant Professor INSTITUTE OF AERONAUTICAL

More information

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}.

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. 1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. (a) 0(010) 1 Examples: 01, 00101, 00100101, 00100100100101 (b) (21 10) 0012

More information

SECTION A. (i) The Boolean function in sum of products form where K-map is given below (figure) is:

SECTION A. (i) The Boolean function in sum of products form where K-map is given below (figure) is: SECTION A 1. Fill in the blanks: (i) The Boolean function in sum of products form where K-map is given below (figure) is: C B 0 1 0 1 0 1 A A (ii) Consider a 3-bit error detection and 1-bit error correction

More information

To illustrate what is intended the following are three write ups by students. Diagonalization

To illustrate what is intended the following are three write ups by students. Diagonalization General guidelines: You may work with other people, as long as you write up your solution in your own words and understand everything you turn in. Make sure to justify your answers they should be clear

More information

The CYK Algorithm. We present now an algorithm to decide if w L(G), assuming G to be in Chomsky Normal Form.

The CYK Algorithm. We present now an algorithm to decide if w L(G), assuming G to be in Chomsky Normal Form. CFG [1] The CYK Algorithm We present now an algorithm to decide if w L(G), assuming G to be in Chomsky Normal Form. This is an example of the technique of dynamic programming Let n be w. The natural algorithm

More information

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be

More information

Theory of Computations Spring 2016 Practice Final Exam Solutions

Theory of Computations Spring 2016 Practice Final Exam Solutions 1 of 8 Theory of Computations Spring 2016 Practice Final Exam Solutions Name: Directions: Answer the questions as well as you can. Partial credit will be given, so show your work where appropriate. Try

More information

Name: Finite Automata

Name: Finite Automata Unit No: I Name: Finite Automata What is TOC? In theoretical computer science, the theory of computation is the branch that deals with whether and how efficiently problems can be solved on a model of computation,

More information

From Theorem 8.5, page 223, we have that the intersection of a context-free language with a regular language is context-free. Therefore, the language

From Theorem 8.5, page 223, we have that the intersection of a context-free language with a regular language is context-free. Therefore, the language CSCI 2400 Models of Computation, Section 3 Solutions to Practice Final Exam Here are solutions to the practice final exam. For some problems some details are missing for brevity. You should write complete

More information

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou Administrative! [ALSU03] Chapter 3 - Lexical Analysis Sections 3.1-3.4, 3.6-3.7! Reading for next time [ALSU03] Chapter 3 Copyright (c) 2010 Ioanna

More information

ROEVER COLLEGE OF ENGINEERING AND TECHNOLOGY Elambalur, Perambalur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-I AUTOMATA

ROEVER COLLEGE OF ENGINEERING AND TECHNOLOGY Elambalur, Perambalur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-I AUTOMATA ROEVER COLLEGE OF ENGINEERING AND TECHNOLOGY Elambalur, Perambalur 621 220 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III / V Subject Code : CS6503 Subject Name : Theory of Computation

More information

Computation Engineering Applied Automata Theory and Logic. Ganesh Gopalakrishnan University of Utah. ^J Springer

Computation Engineering Applied Automata Theory and Logic. Ganesh Gopalakrishnan University of Utah. ^J Springer Computation Engineering Applied Automata Theory and Logic Ganesh Gopalakrishnan University of Utah ^J Springer Foreword Preface XXV XXVII 1 Introduction 1 Computation Science and Computation Engineering

More information

Context Free Languages and Pushdown Automata

Context Free Languages and Pushdown Automata Context Free Languages and Pushdown Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Context Free Languages and Pushdown

More information

ECS 120 Lesson 16 Turing Machines, Pt. 2

ECS 120 Lesson 16 Turing Machines, Pt. 2 ECS 120 Lesson 16 Turing Machines, Pt. 2 Oliver Kreylos Friday, May 4th, 2001 In the last lesson, we looked at Turing Machines, their differences to finite state machines and pushdown automata, and their

More information

Formal languages and computation models

Formal languages and computation models Formal languages and computation models Guy Perrier Bibliography John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman - Introduction to Automata Theory, Languages, and Computation - Addison Wesley, 2006.

More information

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

KHALID PERVEZ (MBA+MCS) CHICHAWATNI FAQ's about Lectures 1 to 5 QNo1.What is the difference between the strings and the words of a language? A string is any combination of the letters of an alphabet where as the words of a language are the

More information

Turing Machine Languages

Turing Machine Languages Turing Machine Languages Based on Chapters 23-24-25 of (Cohen 1997) Introduction A language L over alphabet is called recursively enumerable (r.e.) if there is a Turing Machine T that accepts every word

More information

CS525 Winter 2012 \ Class Assignment #2 Preparation

CS525 Winter 2012 \ Class Assignment #2 Preparation 1 CS525 Winter 2012 \ Class Assignment #2 Preparation Ariel Stolerman 2.26) Let be a CFG in Chomsky Normal Form. Following is a proof that for any ( ) of length exactly steps are required for any derivation

More information

CIT3130: Theory of Computation. Regular languages

CIT3130: Theory of Computation. Regular languages ƒ CIT3130: Theory of Computation Regular languages ( M refers to the first edition of Martin and H to IALC by Hopcroft et al.) Definitions of regular expressions and regular languages: A regular expression

More information

Languages and Compilers

Languages and Compilers Principles of Software Engineering and Operational Systems Languages and Compilers SDAGE: Level I 2012-13 3. Formal Languages, Grammars and Automata Dr Valery Adzhiev vadzhiev@bournemouth.ac.uk Office:

More information

UNIT 1 SNS COLLEGE OF ENGINEERING

UNIT 1 SNS COLLEGE OF ENGINEERING 1 SNS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING THEORY OF COMPUTATION TWO MARKS WITH ANSWERS UNIT 1 1. Define set. A set is a collection of objects. E.g.: The collection of

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser sec 3.2 Describe several variants of Turing machines and informally explain why they

More information

I have read and understand all of the instructions below, and I will obey the Academic Honor Code.

I have read and understand all of the instructions below, and I will obey the Academic Honor Code. Midterm Exam CS 341-451: Foundations of Computer Science II Fall 2014, elearning section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand all

More information

Computer Sciences Department

Computer Sciences Department 1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 D E C I D A B I L I T Y 4 Objectives 5 Objectives investigate the power of algorithms to solve problems.

More information

Actually talking about Turing machines this time

Actually talking about Turing machines this time Actually talking about Turing machines this time 10/25/17 (Using slides adapted from the book) Administrivia HW due now (Pumping lemma for context-free languages) HW due Friday (Building TMs) Exam 2 out

More information

Formal Languages and Automata

Formal Languages and Automata Mobile Computing and Software Engineering p. 1/3 Formal Languages and Automata Chapter 3 Regular languages and Regular Grammars Chuan-Ming Liu cmliu@csie.ntut.edu.tw Department of Computer Science and

More information

Final Course Review. Reading: Chapters 1-9

Final Course Review. Reading: Chapters 1-9 Final Course Review Reading: Chapters 1-9 1 Objectives Introduce concepts in automata theory and theory of computation Identify different formal language classes and their relationships Design grammars

More information

Derivations of a CFG. MACM 300 Formal Languages and Automata. Context-free Grammars. Derivations and parse trees

Derivations of a CFG. MACM 300 Formal Languages and Automata. Context-free Grammars. Derivations and parse trees Derivations of a CFG MACM 300 Formal Languages and Automata Anoop Sarkar http://www.cs.sfu.ca/~anoop strings grow on trees strings grow on Noun strings grow Object strings Verb Object Noun Verb Object

More information

Lec-5-HW-1, TM basics

Lec-5-HW-1, TM basics Lec-5-HW-1, TM basics (Problem 0)-------------------- Design a Turing Machine (TM), T_sub, that does unary decrement by one. Assume a legal, initial tape consists of a contiguous set of cells, each containing

More information

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory Proof Techniques Alphabets, Strings, and Languages Foundations of Computer Science Theory Proof By Case Enumeration Sometimes the most straightforward way to prove that a property holds for all elements

More information

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014 CMPSCI 250: Introduction to Computation Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014 Regular Expressions and Languages Regular Expressions The Formal Inductive Definition

More information

Automating Construction of Lexers

Automating Construction of Lexers Automating Construction of Lexers Regular Expression to Programs Not all regular expressions are simple. How can we write a lexer for (a*b aaa)? Tokenizing aaaab Vs aaaaaa Regular Expression Finite state

More information

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function TAFL 1 (ECS-403) Unit- V 5.1 Turing Machine 5.2 TM as computer of Integer Function 5.2.1 Simulating Turing Machine by Computer 5.2.2 Simulating Computer by Turing Machine 5.3 Universal Turing Machine 5.4

More information

Formal Grammars and Abstract Machines. Sahar Al Seesi

Formal Grammars and Abstract Machines. Sahar Al Seesi Formal Grammars and Abstract Machines Sahar Al Seesi What are Formal Languages Describing the sentence structure of a language in a formal way Used in Natural Language Processing Applications (translators,

More information

Last lecture CMSC330. This lecture. Finite Automata: States. Finite Automata. Implementing Regular Expressions. Languages. Regular expressions

Last lecture CMSC330. This lecture. Finite Automata: States. Finite Automata. Implementing Regular Expressions. Languages. Regular expressions Last lecture CMSC330 Finite Automata Languages Sets of strings Operations on languages Regular expressions Constants Operators Precedence 1 2 Finite automata States Transitions Examples Types This lecture

More information

Outline. Language Hierarchy

Outline. Language Hierarchy Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility Language Hierarchy Regular: finite memory CFG/PDA: infinite memory but in stack space TM: infinite

More information

Homework. Context Free Languages. Before We Start. Announcements. Plan for today. Languages. Any questions? Recall. 1st half. 2nd half.

Homework. Context Free Languages. Before We Start. Announcements. Plan for today. Languages. Any questions? Recall. 1st half. 2nd half. Homework Context Free Languages Homework #2 returned Homework #3 due today Homework #4 Pg 133 -- Exercise 1 (use structural induction) Pg 133 -- Exercise 3 Pg 134 -- Exercise 8b,c,d Pg 135 -- Exercise

More information

1.3 Functions and Equivalence Relations 1.4 Languages

1.3 Functions and Equivalence Relations 1.4 Languages CSC4510 AUTOMATA 1.3 Functions and Equivalence Relations 1.4 Languages Functions and Equivalence Relations f : A B means that f is a function from A to B To each element of A, one element of B is assigned

More information

Lexical Analysis. Dragon Book Chapter 3 Formal Languages Regular Expressions Finite Automata Theory Lexical Analysis using Automata

Lexical Analysis. Dragon Book Chapter 3 Formal Languages Regular Expressions Finite Automata Theory Lexical Analysis using Automata Lexical Analysis Dragon Book Chapter 3 Formal Languages Regular Expressions Finite Automata Theory Lexical Analysis using Automata Phase Ordering of Front-Ends Lexical analysis (lexer) Break input string

More information

CS154 Midterm Examination. May 4, 2010, 2:15-3:30PM

CS154 Midterm Examination. May 4, 2010, 2:15-3:30PM CS154 Midterm Examination May 4, 2010, 2:15-3:30PM Directions: Answer all 7 questions on this paper. The exam is open book and open notes. Any materials may be used. Name: I acknowledge and accept the

More information

CSC-461 Exam #2 April 16, 2014

CSC-461 Exam #2 April 16, 2014 Pledge: On my honor, I pledge that I have not discussed any of the questions on this exam with fellow students, nor will I until after 7 p.m. tonight. Signed: CSC-461 Exam #2 April 16, 2014 Name Time Started:

More information

Recursively Defined Functions

Recursively Defined Functions Section 5.3 Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps. BASIS STEP: Specify the value of the function at zero. RECURSIVE STEP: Give

More information

Regular Languages and Regular Expressions

Regular Languages and Regular Expressions Regular Languages and Regular Expressions According to our definition, a language is regular if there exists a finite state automaton that accepts it. Therefore every regular language can be described

More information

Languages and Finite Automata

Languages and Finite Automata Languages and Finite Automata or how to talk to machines... Costas Busch - RPI 1 Languages A language is a set of strings String: A sequence of letters (a word) Examples: cat, dog, house, Defined over

More information

KEY. A 1. The action of a grammar when a derivation can be found for a sentence. Y 2. program written in a High Level Language

KEY. A 1. The action of a grammar when a derivation can be found for a sentence. Y 2. program written in a High Level Language 1 KEY CS 441G Fall 2018 Exam 1 Matching: match the best term from the following list to its definition by writing the LETTER of the term in the blank to the left of the definition. (1 point each) A Accepts

More information