VALLIAMMAI ENGINEERING COLLEGE

Similar documents

UNIT I PART A PART B

JNTUWORLD. Code No: R

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

Multiple Choice Questions

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

CT32 COMPUTER NETWORKS DEC 2015

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

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

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

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

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

QUESTION BANK CS2303 THEORY OF COMPUTATION

QUESTION BANK. Unit 1. Introduction to Finite Automata

(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

Department of Computer Science and Engineering

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

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

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

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

AUTOMATA THEORY AND COMPUTABILITY

VALLIAMMAI ENGINEERING COLLEGE

Decision Properties for Context-free Languages

Outline. Language Hierarchy

Learn Smart and Grow with world

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

CS 44 Exam #2 February 14, 2001

Computer Sciences Department

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

Compiler Construction

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

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

Final Course Review. Reading: Chapters 1-9

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

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

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

Ambiguous Grammars and Compactification

Actually talking about Turing machines this time

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Models of Computation II: Grammars and Pushdown Automata

UNIT 1 SNS COLLEGE OF ENGINEERING

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

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

CS402 - Theory of Automata Glossary By

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

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

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

VALLIAMMAI ENGINEERING COLLEGE

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

CSE 105 THEORY OF COMPUTATION

ECS 120 Lesson 16 Turing Machines, Pt. 2

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

Theory Bridge Exam Example Questions Version of June 6, 2008

Theory of Computation, Homework 3 Sample Solution

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

Theory of Computation

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

3 rd Year - Computer Science and Engineering,

Theory of Computations Spring 2016 Practice Final Exam Solutions

Context-Free Grammars

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

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

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

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

CS402 - Theory of Automata FAQs By

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

LECTURE NOTES THEORY OF COMPUTATION

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

Context Free Languages and Pushdown Automata

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Recursively Enumerable Languages, Turing Machines, and Decidability

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

Automata Theory CS S-FR Final Review

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

LECTURE NOTES THEORY OF COMPUTATION

Chapter 14: Pushdown Automata


Turing Machine Languages

Formal Grammars and Abstract Machines. Sahar Al Seesi

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

Formal Languages and Automata

Introduction to Computers & Programming

Lec-5-HW-1, TM basics

Languages and Compilers

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

Reflection in the Chomsky Hierarchy

Introduction to Syntax Analysis

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

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

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

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

CpSc 421 Final Solutions

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

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

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

CSE 105 THEORY OF COMPUTATION

Question Bank. 10CS63:Compiler Design

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

Lecture 18: Turing Machines

Transcription:

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

SUBJECT SEM / YEAR: V/III VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203. 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-6 18. 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

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

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-6 0 1 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

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

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 1 2 3 4 7 1 8 9 13. (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

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

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

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 0 1 2 9 (6) the BTL-5 Evaluate

(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 00110101, 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

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

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)

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 1 10. Design equivalence of PDA and CFG BTL 6 11. Point out the languages generated by a PDA using final state of the PDA and empty stack of that PDA BTL 4

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 1 15. 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 4 17. 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 1 18. 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

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

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

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

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

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 1 13. 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 4 19. What is the role of checking off symbols in a Turing Machine BTL 4 20. 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 0100. (6) BTL 3 Apply

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

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

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 4 11. What are (a) recursively enumerable languages (b) recursive sets? BTL 6 12. Define the classes of P and NP. BTL 1 13. Is it true that complement of a recursive language is recursive? Justify your answer 14. Give an example for an undecidable problem BTL 1 15. Compare the three ways to improve MTTF. BTL 4

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 1 1 111 2 10111 10 3 10 0 (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

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

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