# Kanpur Institute Of Technology Kanpur SUBJECT: THEORY OF AUTAMATA & FORMAL LANGUAGES B.

TECH(CS) SMESTER: IV SEM QUESTION BANK UNIT-1
Q.1 Define finite automata and specify its application. Q.2 What is mean by optimization of DFA? Explain each step in optimization of DFA. Q.3 Construct finite automata for all strings over { 0, 1} that do not contain 101 as substring. Q.4 Construct finite automata for language L = { w | w ∈ {a,b}* and n(a) w MOD 3 > n(b) w MOD 3 } Where n(a) w represents number of a’s in w and n(b) w represents number of b’s in w Q.5 Construct a finite automata for strings over decimal digits that represents decimal number divisible by 3. Q.6 Given that L1 = { w | w ∈ {a,b}* and w ends with aa } L2 = { w | w ∈ {a,b}* and w contains ‘ab’ as substring } Construct finite automata for language L = L1 – L2. Q.7 Construct finite automata for accepting strings over {a, b} that contains at most one pair of consecutive a’s and at most one pair of consecutive b’s. Q.8 Give the deterministic finite automata accepting the following languages over the alphabet { a, b} i) The set of all string ending in 00 ii) The set of all strings such that every block of five consecutive symbols contains at least two 0’s. Q.9 Differentiate between DFA, NFA and ε -NFA. Q.10 Find Langauage for the finite automata shown in Fig. 0 q0 1 1 q1 0 0 q2 1

Fig:1 Q.11 Test whether 110011 and 110110 are accepted by Transition system described by Fig.1 Q.12 Construct a DFA equivalent to the NDFA defined by following table: State 0 1 2 →q0 q1 q4 q4 q2 q3 q1 q4 q2 q2 q3 q4 q3 q4

b q3 b a q5 a q6 b q7 a. b a. b .Q.13 Minimize the finite automata shown in Fig . q0 b q4 b a q1 b b q2 a.

14. Differentiate L* and L+. 12. What is a regular expression? 2. Write a regular expression to denote a language L which accepts all the strings which begin or end with either 00 or 11.Kanpur Institute Of Technology Kanpur SUBJECT: THEORY OF AUTAMATA & FORMAL LANGUAGES B. a set L= {0. 15.What is L+ and L*? 7. (a)Simplify following regular expression: (1+01*)+(1+01*)(10*+1)(11*+0) (b) 5.1}. What are the applications of Regular expressions. Describe in English the language represented by following regular expression i) (0 +1)* ii) (a +b)*(ab + ba)(a + b)* iii) a + b + ε + (a + b)(a + b)(a + b)(a + b)* iv) (0 + 1)* ( 00 + 11) v) (0*10*10*10*)* 6. Write a regular expression: (i) All strings over {0.1} with the substring ‘0101’ (ii) All strings beginning with ’11 ‘ and ending with ‘ab’ (iii) Set of all strings over {a.TECH(CS) SMESTER: IV SEM QUESTION BANK UNIT II 1. Define Moore and Mealy machine with Example. 11. Write a regular expression denoting a language over ∑ ={1} having (i) even length of string (ii) odd length of a string. What is idempotence law of union? 4.b}with 3 consecutive b’s. (iv) Set of all strings that end with ‘1’and has no substring ‘00’. 3. 13. What is Arden’s Theorem? 8.b} in which total number of a’s are divisible by 3 10. Write a regular expression for the language over the set _={a. Construct the NFA for the following regular expressions: (i) aba*+ bcb* (ii) (a +b)* abb (a+b)*. Give statement of pumping lemma for regular sets and its proof. 9. .

18.Kanpur Institute Of Technology Kanpur SUBJECT: THEORY OF AUTAMATA & FORMAL LANGUAGES B.m>=0}. 14. 10. Construct the grammar for the language L={ an b an | n>=1}. 13. 11. Construct the grammar for the language L={ an bm c2m | n. What are the uses of Context free grammars? 17. 8. B →b | A. 15. Find the grammar for the language L={a 2n bc .A→a/Aa. What is :(a) derivation (b)derivation/parse tree (c) subtree 3. Define a context free grammar 2. S→a/b. Show that the following grammar is ambiguous S→AB/aaB. Construct the grammar for the language L={ an b2n | n>=0}.TECH(CS) SMESTER: IV SEM QUESTION BANK UNIT III 1. 6. 12. where G is given by : S→S +S/S * S. b}. 9. . Find the derivation tree of a * b + a * b given that a * b + a * b is in L(G).where n>1 }. What are the three ways to simplify a context free grammar? 7. 16. What is a ambiguous grammar? 4.B→b. Write a CFG for solving simple expression such + and *. Construct a grammar for the language L which has all the strings which are all palindrome over Σ={a. Write a CFG for regular expression r= (a+b)(a+b+0+1)*. Construct CFG without Є production from : S →a | Ab | aBa . What are the applications of Context free languages. 5. A →b | Є . Find CFG with no useless symbols equivalent to : S→AB | CA .

Is NPDA (Nondeterministic PDA) and DPDA (Deterministic PDA)equivalent? Explain with Example. 12. Define Pushdown Automata.Kanpur Institute Of Technology Kanpur SUBJECT: THEORY OF AUTAMATA & FORMAL LANGUAGES B. 4. 9. What are the different types of language acceptances by a PDA and define them. State the equivalence of acceptance by final state and empty stack. What is the significance of PDA? 5.TECH(CS) SMESTER: IV SEM QUESTION BANK UNIT IV 1. Design a PDA which accepts the language L={ anbm|n>m>=0}. 8.b}*}. . Design a PDA which accepts the language L={wcwr|w€ {a. Design a PDA for the regular Expression r= 0* 1+. 11. 7. of a’s and b’s. 2. Design a PDA which accepts the language L={ anbn+1|n>0}. 3. Specify the two types of moves in PDA. Design a PDA which accepts the language L={ anbn|n>0}. Design a PDA which accepts the language L={w € {a. 6. 10.b}*| w has equal no.

What is a multi-tape Turing machine? 17. Design a turing Machine to accept language L={anbncn|n. 9. Define a move in TM. What is a 2-way infinite tape TM? 15. 12. What is the basic difference between 2-way FA and TM? 6. of 1’s 11. where m and n are positive integers. Prove that arbitrary context free grammar G1 and G2 the problem “L(G1) and L (G2) is context free” is undecidable. 7. What is the language accepted by TM? 8.m>0}. Design a turing Machine which computes f(m. Design a turing Machine to recognize all strings consisting of even no. 2. 10. When is checking off symbols used in TM? 13.TECH(CS) SMESTER: IV SEM QUESTION BANK UNIT V 1. What is a turing machine? Define.=0}. examples of decidable and .n)=m*n.Kanpur Institute Of Technology Kanpur SUBJECT: THEORY OF AUTAMATA & FORMAL LANGUAGES B. When we say a problem is decidable? Give undecidable problem? 20. . What is a multihead TM? 14.What is a multidimensional TM? 18. What are the applications of TM? 5. What are the special features of TM? 4. What is Church’s Hypothesis? 19. How can a TM used as a transducer? 16. Design a turing Machine recognizes the Languages L={anbm|n>0. What are the various representation of TM? 3..