VALLIAMMAI ENGINEERING COLLEGE

Size: px
Start display at page:

Download "VALLIAMMAI ENGINEERING COLLEGE"

Transcription

1 VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK V SEMESTER CS Theory of Computation Regulation 2013 Academic Year Prepared by Dr. Dr. A. Samydurai, Associate Professor/ CSE & Ms. N. Poornima, Assistant Professor/ CSE

2 SUBJECT SEM / YEAR: V/III VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING : THEORY OF COMPUTATION QUESTION BANK UNIT I -FINITE AUTOMATA Introduction- Basic Mathematical Notation and techniques- Finite State systems Basic Definitions Finite Automaton DFA & NDFA Finite Automaton with - moves Regular Languages- Regular Expression Equivalence of NFA and DFA Equivalence of NDFA s with and without -moves Equivalence of finite Automaton and regular expressions Minimization of DFA- - Pumping Lemma for Regular sets Problems based on Pumping Lemma. PART - A Q.N o Questions BT Level Compete nce 1. Differentiate between DFA and NFA. BTL-2 Under 2. List the operators of Regular Expressions BTL-1 Reme 3. Define inductive proof. BTL-1 Reme 4. What is a finite automata? Transition diagram Transition Table BTL-1 Reme 5. Differentiate between regular expression and regular language BTL-4 Analy 6. Tabulate the regular expression for the following BTL-4 Analy 7. Describe what is non-deterministic finite automata and the BTL-1 Reme 8. Illustrate a regular expression for the set of strings over {0,1}that BTL-3 Apply 9. Define Language and Grammar with an example BTL-1 Reme 10. Describe an identifier with a transition diagram (automata). BTL-2 Under 11. Define ε-nfa BTL-1 Reme 12. Summarize minimization of DFA BTL-5 Evalua 13. Discuss the notation of DFA BTL-2 Under 14. Illustrate if L be a set accepted by an NFA then there exists a DFA BTL-3 Apply 15. Explain a finite automaton for the regular expression 0*1*. BTL-2 Under 16. Summarize the extended transition function for a ε-nfa BTL-5 Evalua 17. Develop a pumping lemma for regular set and what are the BTL Explain L={0 n 1 2n /n>=1}is not regular BTL-4 Analy 19. Illustrate a regular expression for the set of all the strings have odd BTL-3 Apply 20. Compose the difference between the + closure and * closure BTL-6 PART - B

3 1. i) Explain if L is accepted by an NFA with ε-transition then show that L is accepted by an NFA without ε- transition.(6) ii) Construct a DFA equivalent to the NFA. M=({p,q,r},{0,1},δ,p,{q,s}) Where δ is defined in the following table.(7) BTL-5 Evaluate 0 1 p {q,s} {q} q {r} {q,r} r {s} {p} s - {p} 2. i) Demonstrate how the set L= {ab n /n>=1} is not a regular.(7) ii) Construct a DFA equivalent to the NFA given below: (6) BTL-3 Apply 0 1 p {p,q} P q r R r s - s s S 3. (i)examine whether the language L=(0 n 1 n / n>=1) is regulator not? Justify your answer. (7) ii) Let L be a set accepted by a NFA then show that there exists a DFA that accepts L.(6) BTL-1 4. (i)summarize a construction of NDFA accepting all string in {a, b}with either two consecutive a sort two consecutive b s. (6) (ii)give the DFA accepting the following language. Set of all strings beginning with a 1 that when interpreted as a binary integer is a Multiple of 5.(7) BTL-2 Understan d

4 5. (i)describe the following: Let L be a set accepted by an NFA. Then prove that there exists a deterministic finite automaton that accepts L.Is the converse true? Justify your answer.(7) (ii)construct DFA equivalent to the NFA given below: (6) BTL-2 Understan d 6. (i)compose that a language L is accepted by some ε NFA if and only if L is accepted by some DFA. (6) (ii)consider the following ε NFA. Compute the ε closure of each state and find it s equivalent DFA. (7) 7. i)classify how a language L is accepted by some DFA if L is BTL p {p,q} {p} q {r} {r} r {s} ф *s {s} {s} accepted by some NFA(7) (ii)convert the following NFA to its equivalent DFA.(6) BTL-3 Apply 8. (i)describe that A language L is accepted by some DFA if and only if L is accepted by some NFA.(6) (ii)construct Finite Automate equivalent to the regular expression (ab+a)*(7) BTL-1

5 9. Point out the steps in conversion of NFA to DFA and for the following convert NFA to a DFA(7) BTL-4 (ii)discuss on the relation between DFA and minimal DFA.(6) 10. Describe the construction of NFA with ε-transition from any given regular expression.(6) b)let A= (Q,, δ,q0,{q f )be a DFA and suppose that for all a in we have δ(q0,a)=δ(q f, a). Show that if x is a non-empty string in L(A),then for all k>0,x k is also in L(A).(7) BTL Tabulate the difference between the NFA and DFA.Convert the following ε-nfa to DFA.(13) states ε a b C p Ф {p} {q} {r} q {p} {q} {r} Ф *r {q} {r} ф {p} BTL-1

6 12. (i).describe the extended transition function for NFA,DFA and ε-nfa(6) (ii) Consider the following ε-nfa for an identifier.consider the ε-closure of each state and find it s equivalent DFA.(7) 5 6 BTL-2 Understan d (i) and Construct a minimized DFA from the regular expression (x+y)x(x+y)*.trace for string w=xxyx. (7) (ii)using Pumping Lemma for the regular sets,prove that the language ]L={a m b n m>n} is not regular.(6) 14. (i) and Prove that if n is a positive integer such that n mod 4 is 2 or 3 then n is not a perfect square.(6) (ii)construct a DFA that accept the following language {x {a,b}: x n =odd and : x b=even.(7) BTL-4 BTL-4 PART-C 1. (i) Draw the transition diagram for recognizing the set of all operators in c Language.(8) (ii)explain the extended transition function for NFA, DFA and ε-nfa.(7) BTL-5 Evaluation 2 (i) Convert the regular expression a(a+b)*a into ε-nfa (8) (ii)find the minimal state DFA for the above ε-nfa.(7) BTL-6

7 3 Give DFA s accepting the following language over the alphabet{0,1}.the set of all the strings beginning with a1 that when interrupted as a binary integer, is multiple of 5, For example strings 101,1010 and 1111 are in the language 0,100 and 111 are not.(15) BTL-4 Analysis 4 Let A= (Q,, δ,q0,{qf}) be a DFA, and suppose that for all a in we have δ(q0, a) = δ(qf, a).show that for all w ε. We have δ(q0, w) = δ(qf, w).(15) BTL-6

8 UNIT II - GRAMMARS Grammar Introduction Types of Grammar - Context Free Grammars and Languages Derivations and Languages Ambiguity- Relationship between derivation and derivation trees Simplification of CFG Elimination of Useless symbols - Unit productions - Null productions Greiback Normal form Chomsky normal form Problems related to CNF and GNF. PART - A Q.N o Questions BT Level Competence 1 Examine the string aaabbabbba for the Grammar G with S- ab ba A a as baa BTL-1 B b bs abb 2 Define ambiguous grammar and CFG BTL-1 3 Infer the set of strings over the alphabet {O} of the form0 n where n is not a prime is regular? Prove or disprove 4 Give a CFG forth e language of palindrome string over {a,b}.write the CFG for the language,l=(a n b n n). 5 Examine the context free Grammar representing the set BTL-4 BTL-2 of Palindrome over (0+1)* BTL-1 6 Define parse tree and derivation BTL-1 7 Demonstrate the grammar is ambiguous S SS (S) S(S)S E BTL-3 Apply 8 Point out the various types of grammar with example BTL-4 9 Discuss L(G) where G=({S},{0,1},{S->0S1,S->ε},S) BTL-2

9 10 Describe that id+ id*id can be generated by two distinct leftmost and right most derivation in the grammar E->E+E E*E (E) id BTL-2 11 Differentiate null production and unit production BTL-2 12 Conclude the procedure for converting CNF to GNF with an example BTL-5 Evaluate 13 Define the two normalforms of CFG BTL-1 14 Compare no useless symbol and NULL production. BTL-4 15 Illustrate sententialforms with an example. BTL-3 Apply Show the following grammar into an equivalent one with no unit productions and no useless symbols S ABA A aaa abc bb B A bb Cb 16 C CC cc BTL-3 Apply Conclude CFG without null production from: S a Ab aba A b ε B b A 17 BTL-5 Evaluate 18 Convince your answer of acontext free Grammar for the given expression (a+b) (a+b+0+1) * BTL-6 List the three ways to simplify a context free grammar? BTL-1 19 What are the properties of the CFL generated by a CFG? 20 Define GNF and CNF. BTL-6 PART-B 1 (i)explain and draw the parse tree for the string 1+2*3 given the grammar G=(V,,R,E)where V={E,D,1,2,3,4,5,6,7,9,0,+,-,*,/,9,)} ={1,2,3,4,5,6,7,8,9,0,+,-,*,/,(,)} where R contains following rules : E D (E) E+E E-E E/E D (6) the BTL-5 Evaluate

10 (ii)let G=(V,T,P,S) be a Context Free Grammar then prove that if the recursive inference procedure calls tells us that terminal string W is in the language of variable A,then there is a parse tree with a root A and yield w.(7) 2 (i)define Leftmost derivation Let G be a CFG and let A.Design a left most derivation of w. (5) (ii) Let G be the grammar s->0b 1A, A->0 0S 1AA, B->1 1S 0BB.For the string , find its leftmost derivation and derivation tree.(8) 3 (i)if G is grammar S->SbS a, expressthat G is ambiguous.(6) BTL-1 (ii)show that the grammar S->a absb aab A->bS aaabis ambiguous.(7) BTL-2 4 (i)describe that the following grammars are ambiguous (5) BTL1 S asbs/bsas/ᵡ S AB/aaB, A a/aa, B b ii)if S->aSb aab, A->bSa A->ba is the context free grammar. Give the context free language.(8) 5 (i)by Considering the grammar E->E + E E*E (E) I I ->a+b Describe that the grammar is ambiguous and remove the ambiguity.(8) (ii) Discuss in detail about ambiguous grammar and removing ambiguity from grammar.(5) BTL1 6 Solve the following grammar S->aAa bbb BB A-> C B-> S A C -> S ε for the string abaaba.give i) Left most derivation(3) ii)right most derivation(3) iii)derivation Tree(3) iv) For the string abaabbba, find the right most derivation.(4) BTL-3 appy

11 7 (i)let G=(V,T,P,S)be a context free grammar (CFG).Then S α if and only if there is a derivation tree for G which yields α.illustrate the relationship between Derivation and Derivation Trees. (8) (ii)consider the productions: S->aB ba A->aS baa a B->bS abb b For the string aaabbabbba,find the leftmost derivation.(5) BTL-3 Apply (i)if S->aSb aab, A->bSa A->ba is the context free grammar. the context free language. (5) (ii)consider the grammar E->E + E E*E (E) I I ->a+b Show that the grammar is ambiguous and remove the ambiguity.(8) BTL-4 9 (i)give the formal pushdown automata that accepts {wcw R w in (0+1)}.(6) ii)convert the following grammar into GNF(7) S XY1/0 BTL-2 x 00X/Y Y 1X1 10 (i) Develop an equivalent grammar G in CNF for the grammar G1 where G1=({S,A,B},{a,b},{S A SB ε, A aas a, B SbS A bb},s) (7) (ii) What is an ambigous grammar?explain with an example. (6) 11 Examine the grammar S 0A0/1B1/BB B C B S/A C S/ ε and Simplify using the safe order (i) Eliminate ε- productions(3) (ii) Eliminate unit production(3) (iii)eliminate useless symbols(3) (iv) Put ( resultant) the grammar in Chomsky normal form(4) BTl-6 BTL-1

12 12 (i)give the Chomsky normal form equivalent to the grammar(6) S AB ab, A baa asa a B abb bs b (ii) Convert the grammar (7) S->AB A -> BS b B->SA a into GNF 13 (i) that For every CFG; there is an equivalent grammar in CNF.(6) (ii)find a Grammar in CNF equivalent to (7) S->aAbB A->aA a B->bB ε 14. (i)define GNF. Compare GNF and CNF.(6) (ii)every CGL L can be generated by a CFG G in GNF Construct a grammar in GNf equivalent to P={S->aSa, S ->bsb, S->aa, S->bb}(7) PART-C BTL-4 BTL-4 1. (i)state and prove using an example the properties of regular language(7) (ii)find on equalities for the following RE and prove for the same a. b+ab* +aa*b+aa*ab* (3) b. a*(b+ab*).(2) c. a(a+b)*+aa(a+b)*+aaa(a+b)*(3) 2. Set the algorithm for minimization of a DFA. Construct a minimized DFA for the RE (a+b)(a+b)* and trace for the string baaaab.(15) 3. Consider the grammar s-> as asbs ε. This grammar is ambigious. show in particular that the string aab has two: (i) Parse tree. (5) (ii) LMD.(5) (iii) RMD.(5) 4. (i) Consider the grammar s-> as asbs ε. Is this grammar is unambiguous? If not redesign it to be unambiguous.(7) (ii)when we try to apply the pumping lemma to a CFL, the adversary wins and we cannot complete the proof. Show BTL-5 BTL-6 BTL-4 BTL-6 Evaluation Analysis create

13 what goes wrong when we choose L to be one of the following languages a. {00,11}(2) b. {0 n 1 n n>=1}.(3) c. The set of palindrome over alphabet {0,1}.(3)

14 UNIT III- PUSHDOWN AUTOMATA Pushdown Automata- Definitions Moves Instantaneous descriptions Deterministic pushdown automata Equivalence of Pushdown automata and CFL - pumping lemma for CFL problems based on pumping Lemma. PART A Q.No Questions BT Level Competence 1. What are the different ways of languages accepted by PDA and define them? 2. Summarize PDA.Convert the following CFG to PDA S aaa, A as bs a. 3. Define the pumping Lemma for CFLs BTL 1 4. List the main application of pumping Lemma in CFL s BTL 1 5. Draw an example for PDA 6. Compare Deterministic and Non deterministic PDA. Is it true that non deterministic PDA is more powerful than that of deterministic PDA? Justify your answer 7. What is pushdown automaton BTL 1 8. Use the CFL pumping lemma to show how each of these languages not to be context-free {a i b j c k i<j<k} BTL 5 Evaluate 9. Describe the acceptance of a PDA with empty stack BTL Design equivalence of PDA and CFG BTL Point out the languages generated by a PDA using final state of the PDA and empty stack of that PDA BTL 4

15 12. Illustrate the rule for construction of CFG from given PDA BTL 3 Apply 13. Design a PDA for acception a language{ L=a n b n n>=1} BTL 5 Evaluate 14. What is Instantaneous Descriptions ( ID ) BTL Construct the languages generated by a PDA using final state of the PDA and empty stack of that PDA. BTL 3 Apply 16. What is the language generated by a PDA using the two methods of accepting a language BTL What is additional feature PDA has when compared with NFA? Is PDA superior over NFA in the sense of language acceptance? Justify your answer. BTL Illustrate what actions take place in the PDA by the transitions (moves) δ(q,a,z)={(p1,γ1),(p2, γ2),..(pm,γm)} and δ(q,ε,z)={(p1,γ1),(p2, γ2),..(pm,γm)}. What are the different ways in which a PDA accepts the language? 19. Point out the additional features a PDA has when compared with NFA 20. Formulate. the acceptance by final state and by empty stack in PDA PART B 1. (i)discuss about PDA and CFL Prove the equivalence of PDA and CFL.(6) (ii)if L is Context free language then prove that there exists PDA M such that L=N(M). (7) 2. (i)describe the different types of acceptance of a PDA. Are they equivalent in sense of language acceptance? Justify your answer. (7) (ii)design a PDA to accept {0 n 1 n n>1} Draw the transition diagram for the PDA. Show by instantaneous description that the PDA BTL 3 BTL 4 BTL6 BTL 1 Apply

16 accepts the string 0011.(6) 3. (i)define deterministic PDA s? Give example for Non deterministic and Deterministic PDA.(7) (ii)construct a PDA accepting {a n b m a n / m, n>=1} by empty stack. Also construct the corresponding context-free grammar accepting the same set.(6) 4. (i)state the Pumping Lemma for CFL and Develop the language L={ a n b n c n / n>=1}(6) (ii)prove that L is L(M2 ) for some PDA M2 if and only if L is N(M1) for some PDA M.(7) BTL 1 BTL 6 5. (i)define Non Deterministic Push Down Automata. Is it true that DPDA and NDPDA are equivalent in the sense of language acceptance is concern? Justify Your answer.(5) (ii)convert PDA to CFG.PDA is given by P=({p,q},{0,1},{X,Y},δ,q,Z}, δ is defined by δ(p,1,z)={(p,xz)}, δ(p,ε,z)={p, ε)}, δ(p,1,x)={(p,xx)}, δ(q,1,x)={(q, ε)}, δ(p,0,x)={(q,x0} δ(q,0,z)={(p,z)}(8) 6. (i)define PDA. Give an Example for a language accepted by PDA by empty stack.(7) (ii)convert the grammar S ->0S1 A A ->1A0 S ε into PDA that accepts the same language by the empty stack.check whether 0101 belongs to N(M).(6) 7. (i) the theorem: If L is Context free language then prove that there exists PDA M such that L=N (M). (7) (ii) Prove that if there is PDA that accepts by the final state then there exists an equivalent PDA that accepts by Null State.(6) 8. (i)recommend. Explain different types of acceptance of a PDA. Are they equivalent in sense of language acceptance? Justify your answer.(6) (ii)show that the language is not context free{0i1j j=i2}.(7) BTL 1 BTL 4 BTL 5 Evaluating

17 9. (i)examine Construct the grammar for the following PDAM. M=({q0, q1},{0,1},{x,z0},δ,q0,z0,φ) and where δis given by δ(q0,0,z0)={(q0,xz0)},δ(q0,0,x)={(q0,xx)},δ(q0,1,x)={(q1, ε)}, δ(q1,1,x)={(q1, ε)},δ(q1,ε,x)={(q1, ε)}, δ(q1, ε, Z0 )={(q1, ε)}. (7) (ii)prove that if L is N(M1) for some PDA M1 then L is L(M2 ) for some PDA M2. (6) 10 What Construct a PDA that recognizes the language {a i b j c k i,j,k>0 and i=j or i=k}. Discuss about PDA acceptance i) From empty Stack to final state(6). ii)from Final state to Empty Stack(7) 11 Examine and construct a CFG G which accepts N(M), where M=({q0, q1},{a,b},{z0,z},δ,q0,z0,φ) and where δis given by δ(q0,b,z0)={(q0,zz0)} δ(q0, ε,z0)={(q0, ε)} δ(q0,b,z)={(q0,zz)} δ(q0,a,z)={(q1,z)} δ(q1,b,z)={(q1, ε) δ(q1,a,z0)={(q0,z0)} Show that a n b n c n is not context free language i.e show that the set of strings of a s and b s and c s with an equal number of each is not context free(13) 12 (i)give PDA to accept the language L= {a n b n n>=1}by empty stack and by final stack.(7) (ii)construct PDA accepting L={a n b 3n n>=1}by empty store.(6) BTL 3 BTL 4 BTL-1 BTL-2 Applying 13 (i)show the PDA accepting the language {(ab) n n>1} by empty stack.(6) (ii)construct a Transition table for PDA which accepts the language L={a 2n b n n>+1}(7) 14 (i)explain and Prove Pumping Lemma for CFL.( 6) (ii)if L=N(PN)for some PDA PN =(Q,,,δ,N,qo,Zo) then there is a PDA PF such that L=L(pF). From empty stack to final stack.(7) BTL-3 BTL-4 Apply

18 PART-C 1 (i)design a PDA to accept each of the following language {a i b j c k i=j or j=k}(7) (ii) The set of all string with twice as many 0 s and 1 s. (8) 2 Let P be a PDA with empty stack language L=N(P) and suppose that ε is not in L.Describe how you would modify P so that it accepts L U { ε} by empty stack.(15) BTL-5 BTL-6 Evaluation 3 A PDA is called restricted if on any transition it can increase the height of the stack by at most one symbol. That is, for any rule δ(q,a,z) contain (p, γ), it must be that γ <= 2. Show that if P is a PDA, then there is a restricted PDA P3 such that L(P)=L(P2). (15) 4 (i)if L is a CFL then prove that there exists PDA M, such that L=N(M), language accepted by empty stack.(7) (ii)construct PDA empty store, L= {a m b n n<m}.(8) BTL-4 BTL-6 Analysis

19 UNIT IV- TURING MACHINES Definitions of Turing machines Models Computable languages and functions Techniques for Turing machine construction Multi head and Multi tape Turing Machines - The Halting problem Partial Solvability Problems about Turing machine- Chomskian hierarchy of languages. PART A Q.No Questions BT Level Competence 1. What is multitape Turing machine? Explain in one move. what are the actions take place in TM? 2. What is the Basic Turing Machine model and explain in one move. BTL 3 Apply What are the actions take place in TM 3. Canyou describe the non-deterministic Turing Machine model. Is it BTL 1 true the non-deterministic Turing Machine models are more powerful than the basic Turing Machines? (In thesense of language Acceptance 4. List out the hierarchy summarized in the Chomsky hierarchy BTL 4 5. What is meant by a Turing Machine with two way infinite tape BTL1 6. Define Turing Machine. BTL1 7. What are the applications of Turing machine 8. Define LBA. BTL 1 9. What is the class of language for which the TM has both accepting and rejecting configuration? Can this be called a Context free Language 10. Show a TM that accepts the language of odd integers written in binary BTL 3 Apply

20 11. What are the special features of TM?Define universal Tm.Define Instantaneous description of TM BTL 5 Evaluate 12. Define two way infinite Tape TM BTL Prepare the difference between multi head and multi tape Turing machine 14. Explain what is the class of language for which the TM has both accepting and rejecting configuration? Can this be called a Context free Language 15. Draw a transition diagram for a Turing machine to compute n mod 2. BTL 6 BTL 5 BTL 1 Evaluate 16. What are the techniques for TM construction? 17. How explain how a Turing Machine can be regarded as a BTL 6 computing device to compute integer functions 18. Differentiate TM and PDA BTL What is the role of checking off symbols in a Turing Machine BTL What Halting Problem. BTL 3 Apply PART B 1. (i)state and describe the Halting Problem for Turing machine(6) (ii)design a Turing Machine to accept the language L={0 n 1 n /n>=1} Draw the transition diagram (also specify the instantaneous description to trace the string 0011.(7) BTL 1 2. (i)describe the Chomsky hierarchy of languages (7) (ii)explain the programming techniques for the TM construction.(6) 3. (i)discuss a TM to accept the language LE={1 n 2 n 3 n n >= 1 } (6) (ii)explain in detail about programming techniques of the TM.(7) 4. (i)illustrate the Turing machine for computing f(m, n)=m-n ( proper subtraction). (7) (ii)design a Turing Machine to compute f(m+n)=m+n, V m,n>=0 and simulate their action on the input (6) BTL 3 Apply

21 5. (i)examine is the role of checking off symbols in a Turing Machine.(6) (ii)design a Turing Machine M to implement the function multiplication using the subroutine copy(7) 6. (i)demonstrate in in detail about Multitape TM with an example.(7) (ii)prove that if a language is accepted by a multitape Turing machine,it is accepted by a single-tape TM.(6) BTL 1 BTL 3 Apply 7. (i)summarize in detail about Multihead and multitape TM with an example.(7) (ii)construct a Turing Machine that recognizes the language {wcw / w {a, b} + } (6) 8. (i)explain the TM as computer of integer function with an example.(7) (ii)design a TM to implement the function f(x)= x+1. (6) 9. (i)design a TM to accept the set of all strings {0,1} with 010 as substring.(7) (ii)write shot notes on Two way infinite tape TM.(6) 10. (i)describe computing a partial function with a TM.(6) (ii)design a TM to accept the language LE={a n b n c n n > 1 }. (7) BTL 5 BTL 4 BTL 6 BTL 1 Evaluate 11. (i)define Turing machine for computing f(m, n)=m*n,n N(7) (ii)write notes on Partial solvability.(6) 12. (i)discuss in detail about Multiple tracks TM.(6) (ii)design a Tm which reverses the given string {abb}.(7) 13. (i) and Construct a TM to compute a function f(w) =W R where W {a,b}.(7) (ii)design a TM to accept the set of all strings {0,1} with 010 as substring(6) BTL -1 BTL 4

22 14. (i)explain in detail about Chomsky hierarchy of languages (6) (ii)design a TM with no more than three states that accepts the language. a(a+b) *.Assume ={a,b} (7) BTL 4 PART-C 1 (i)prove that turing machine with one way infinite tape and two-way infinite tape are equivalent (8). (ii) write short notes on checking off symbols(7) 2 (i) Define pumping lemma for CFL. Show that L={a i b j c k, i<j<k} is not context free.(6) (ii) Construct a TM to move an input string over the alphabet A= {a} to the right one cell. Assume that the tape head starts somewhere on a blank cell to the left of the input string to the right one cell, leaving all the remaining cell belank.(9) 3 (i) Design a TM to compute f(m,n) = m*n, for all m,n N.(6) (ii) (ii) Explain how a multi track in a TM can be used for testing given positive integer is a prime or not(9). BTL-6 BTL-5 BTL-4 Evaluation Analysis 4 Design a subroutine to move a TM head from its current position to the right, skipping over all 0 s until reaching a 1 or a blank. If the current position does not hold 0, then the TM should halt. You may assume that there are no tape symbol other than 0,1 and B(blank). Then, use this subroutine to design to TM that accepts all strings of 0 s and 1 s that do not have two 1 s in a row.(15) BTL-6

23 UNIT V - UNSOLVABLE PROBLEMS AND COMPUTABLE FUNCTIONS Unsolvable Problems and Computable Functions Primitive recursive functions Recursive and recursively enumerable languages Universal Turing machine. MEASURING AND CLASSIFYING COMPLEXITY: Tractable and Intractable problems- Tractable and possibly intractable problems - P and NP completeness - Polynomial time reductions. PART A Q.No Questions BT Level Competence 1. Distinguish between PCP and MPCP? What are the concepts used in UTMs? 2. Define the language NSA and SA BTL 1 3. When a recursively enumerable language is said to be recursive 4. Compare and contrast recursive and recursively enumerable languages 5. State when a problem is said to be decidable and give an example of an undecidable problem. BTL 4 BTL 1 6. Define. BTL 1 7. Whatis auniversal language Lu? BTL 1 8. Is it true that the language accepted by a non-deterministic Turing Machine is different from recursively enumerable language? BTL 5 Evaluate 9. Give two properties of recursively enumerable sets which are undecidable 10. When we say a problem is decidable? Give an example of undecidable problem BTL 6 BTL What are (a) recursively enumerable languages (b) recursive sets? BTL Define the classes of P and NP. BTL Is it true that complement of a recursive language is recursive? Justify your answer 14. Give an example for an undecidable problem BTL Compare the three ways to improve MTTF. BTL 4

24 16. Define Primitive Recursive Function BTL 3 Apply 17. Write the Properties of Recursive Languages BTL 3 Apply 18. When a language is said to be recursively enumerable? BTL 5 Evaluate 19. Prove that If P1 and P2 are primitive recursive n-place predicates,then so are the predicates p1 or p2,p1 and p2,and not p1 20. Define Time and space complexity of TM. BTL 3 Apply PART B 1. (i)describe about the tractable and intractable problems.(7) (ii)prove that MPCP reduce to PCP.(6) 2. (i)describe about Recursive and Recursive Enumerable languages with example.(7) (ii)state and explain RICE theorem.(6) 3. (i)summarize diagonalization language.(6) (ii) Show that the language Ld is not recursive enumerable language.(7) 4. Discuss post correspondence problem.let ={0,1}.Let A and B be the lists of three strings each,defined as List A List B i wi xi (i)does the PCP have a solution?(7) (ii)prove that the universal language is recursively enumerable.(6) BTL 1 BTL 1 5. (i)explain computable functions with suitable example.(6) (ii)explain in detail notes on Unsolvable Problems.(7) BTL 4 Apply

25 6. (i)describe in detail notes on universal Turing machines with example.(7) (ii)write short notes NP-complete problems.(6) 7. Show that the language L and its complement L are both recursively enumerable then L is recursive.(13) 8. (i)conclude problem p2 cannot be solved in polynomial time can be proved by the reduction of a problem p1, which is under class p1 to p2.(7) (ii)write short notes on PCP.(6) 9. Explain Universal Turing machine and show that the universal language is recursively enumerable but not recursive.(13) 10. (i)prepare the recursively Enumerable Language with example.(6) (ii)show that the following problem is undecidable. Giventwo CFGs G1 and G2 is L(G1) L(G2) = (7) 11. (i)show that the characteristic function of the set of all even numbers is recursive.(7) (ii)explain in detail notes on primitive recursive functions with examples.(6) 12. (i)point out the Measuring and Classifying Complexity.(7) (ii)does PCP with two lists x=(b,b ab 3,ba) and y=(b 3,ba,a) have a solution.(6) 13. (i)describe in detail Time and Space Computing of a Turing Machine(6) (ii)show that it is undecidable for arbitrary CFG S G1 and G2 whether L (G1) L(G2) is acfl.(7) 14. (i)explain in detail Polynomial Time reduction and NPcompleteness.(7) (ii)write short notes on NP-Hard Problems.(6) BTL 1 BTL 3 BTL 5 BTL 6 BTL 4 BTL-3 BTL-4 BTL-2 BTL 1 Apply Evaluate Apply

26 PART-C 1 (i)show that the special case of PCP in which the alphabet has only two symbols is still unsolvable.(8) (ii)show that the special case of PCP in which the alphabet has only one symbol is still solvable.(7) 2 Prove that the universal language is recursively enumerable but not recursive(15) 3 (i) Explain decidable and un-decidable problems with example(7) (ii) Consider the language of all TMs that given no input eventually write a non-blank symbol on their tapes. Explain why this set is decidable.(8) BTL-5 BTL-6 BTL-6 Evaluation 4 (i) Define Non-deterministic polynomial time. Explain it with Traveling Salesman problem. (ii) Define Class P problem. Explain it with Kruskal s Algorithm. BTL-4 Analysis

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

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

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

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

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

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

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

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

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

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

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

QUESTION BANK CS2303 THEORY OF COMPUTATION

QUESTION BANK CS2303 THEORY OF COMPUTATION QUESTION BANK CS2303 THEORY OF COMPUTATION UNIT-I AUTOMATA PART-A(2-MARKS) 1 What is Computation? and Write short notes on TOC. 2 Define Automaton 3 Define Inductive and Deductive proof 4 Define hypothesis.

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

(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

Department of Computer Science and Engineering

Department of Computer Science and Engineering SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (AN ISO 9001:2008 Certified Institution) SIRUGANOOR, TRICHY 621 105 Department of Computer Science and Engineering QUESTION BANK Subject Code /Title:

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

AUBER (Models of Computation, Languages and Automata) EXERCISES AUBER (Models of Computation, Languages and Automata) EXERCISES Xavier Vera, 2002 Languages and alphabets 1.1 Let be an alphabet, and λ the empty string over. (i) Is λ in? (ii) Is it true that λλλ=λ? Is

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

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Section : CSE 1 & 2 Subject Code : CS6660 Subject Name : COMPILER

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

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

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 20 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK VI SEMESTER CS6660 COMPILER DESIGN Regulation 20 Academic Year 207 8 Prepared by Ms. S.

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

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

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

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

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

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

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

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

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS BHARATHIDASAN ENGINEERING COLLEGE DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Degree & Branch : B.E (CSE) /B.Tech (Information Technology) Subject

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

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

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject.

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject. Turing Machines Transducers: A transducer is a finite state machine (FST) whose output is a string and not just accept or reject. Each transition of an FST is labeled with two symbols, one designating

More information

PDA s. and Formal Languages. Automata Theory CS 573. Outline of equivalence of PDA s and CFG s. (see Theorem 5.3)

PDA s. and Formal Languages. Automata Theory CS 573. Outline of equivalence of PDA s and CFG s. (see Theorem 5.3) CS 573 Automata Theory and Formal Languages Professor Leslie Lander Lecture # 20 November 13, 2000 Greibach Normal Form (GNF) Sheila Greibach s normal form (GNF) for a CFG is one where EVERY production

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

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

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

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

Models of Computation II: Grammars and Pushdown Automata

Models of Computation II: Grammars and Pushdown Automata Models of Computation II: Grammars and Pushdown Automata COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Catch Up / Drop in Lab Session 1 Monday 1100-1200 at Room 2.41

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

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

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

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

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

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

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

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK III SEMESTER CS8391-Data Structures Regulation 2017 Academic Year 2018 19(odd Semester)

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

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

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

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

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

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

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 0 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK III SEMESTER CS89- DATA STRUCTURES Regulation 07 Academic Year 08 9 Prepared by

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

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

3 rd Year - Computer Science and Engineering,

3 rd Year - Computer Science and Engineering, DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 3 rd Year - Computer Science and Engineering, 5th Semester Theory of Computation QUESTION BANK 2 Marks Question and Answer 1. Define set. A set is a collection

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

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

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

CMSC 330: Organization of Programming Languages. Context-Free Grammars Ambiguity

CMSC 330: Organization of Programming Languages. Context-Free Grammars Ambiguity CMSC 330: Organization of Programming Languages Context-Free Grammars Ambiguity Review Why should we study CFGs? What are the four parts of a CFG? How do we tell if a string is accepted by a CFG? What

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

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

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

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

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

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur Finite Automata Dr. Nadeem Akhtar Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur PhD Laboratory IRISA-UBS University of South Brittany European University

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

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

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

Definition 2.8: A CFG is in Chomsky normal form if every rule. only appear on the left-hand side, we allow the rule S ǫ.

Definition 2.8: A CFG is in Chomsky normal form if every rule. only appear on the left-hand side, we allow the rule S ǫ. CS533 Class 02b: 1 c P. Heeman, 2017 CNF Pushdown Automata Definition Equivalence Overview CS533 Class 02b: 2 c P. Heeman, 2017 Chomsky Normal Form Definition 2.8: A CFG is in Chomsky normal form if every

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

Normal Forms for CFG s. Eliminating Useless Variables Removing Epsilon Removing Unit Productions Chomsky Normal Form

Normal Forms for CFG s. Eliminating Useless Variables Removing Epsilon Removing Unit Productions Chomsky Normal Form Normal Forms for CFG s Eliminating Useless Variables Removing Epsilon Removing Unit Productions Chomsky Normal Form 1 Variables That Derive Nothing Consider: S -> AB, A -> aa a, B -> AB Although A derives

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

Chapter 14: Pushdown Automata

Chapter 14: Pushdown Automata Chapter 14: Pushdown Automata Peter Cappello Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 cappello@cs.ucsb.edu The corresponding textbook chapter should

More information

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur-603203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Academic Year: 2015-16 QUESTION BANK - EVEN SEMESTER Year & Semester : II year & IV sem Section

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

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

Where We Are. CMSC 330: Organization of Programming Languages. This Lecture. Programming Languages. Motivation for Grammars

Where We Are. CMSC 330: Organization of Programming Languages. This Lecture. Programming Languages. Motivation for Grammars CMSC 330: Organization of Programming Languages Context Free Grammars Where We Are Programming languages Ruby OCaml Implementing programming languages Scanner Uses regular expressions Finite automata Parser

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

Introduction to Computers & Programming

Introduction to Computers & Programming 16.070 Introduction to Computers & Programming Theory of computation 5: Reducibility, Turing machines Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT States and transition function State control A finite

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

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

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

Reflection in the Chomsky Hierarchy

Reflection in the Chomsky Hierarchy Reflection in the Chomsky Hierarchy Henk Barendregt Venanzio Capretta Dexter Kozen 1 Introduction We investigate which classes of formal languages in the Chomsky hierarchy are reflexive, that is, contain

More information

Introduction to Syntax Analysis

Introduction to Syntax Analysis Compiler Design 1 Introduction to Syntax Analysis Compiler Design 2 Syntax Analysis The syntactic or the structural correctness of a program is checked during the syntax analysis phase of compilation.

More information

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1}

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1} CSE 5 Homework 2 Due: Monday October 6, 27 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in

More information

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207 Name: 1 a 20 b 20 c 20 d 20 e 20 f 20 g 20 2 10 3 30 4 12 5 15 Total 207 CS 341 Practice Final Exam 1. Please write neatly. You will lose points if we cannot figure out what you are saying. 2. Whenever

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

Limits of Computation p.1/?? Limits of Computation p.2/??

Limits of Computation p.1/?? Limits of Computation p.2/?? Context-Free Grammars (CFG) There are languages, such as {0 n 1 n n 0} that cannot be described (specified) by finite automata or regular expressions. Context-free grammars provide a more powerful mechanism

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

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

Formal Languages. Grammar. Ryan Stansifer. Department of Computer Sciences Florida Institute of Technology Melbourne, Florida USA 32901

Formal Languages. Grammar. Ryan Stansifer. Department of Computer Sciences Florida Institute of Technology Melbourne, Florida USA 32901 Formal Languages Grammar Ryan Stansifer Department of Computer Sciences Florida Institute of Technology Melbourne, Florida USA 32901 http://www.cs.fit.edu/~ryan/ March 15, 2018 A formal language is a set

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

Question Bank. 10CS63:Compiler Design

Question Bank. 10CS63:Compiler Design Question Bank 10CS63:Compiler Design 1.Determine whether the following regular expressions define the same language? (ab)* and a*b* 2.List the properties of an operator grammar 3. Is macro processing a

More information

Assignment No.4 solution. Pumping Lemma Version I and II. Where m = n! (n-factorial) and n = 1, 2, 3

Assignment No.4 solution. Pumping Lemma Version I and II. Where m = n! (n-factorial) and n = 1, 2, 3 Assignment No.4 solution Question No.1 a. Suppose we have a language defined below, Pumping Lemma Version I and II a n b m Where m = n! (n-factorial) and n = 1, 2, 3 Some strings belonging to this language

More information

Lecture 18: Turing Machines

Lecture 18: Turing Machines Lecture 18: Turing Machines Some Languages are not Context-Free At the end of the last section, we used the Pumping Lemma for Context Free Languages to prove that there are languages that are not context

More information