UNIT I PART A PART B

Similar documents

JNTUWORLD. Code No: R

Multiple Choice Questions

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

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

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

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

CT32 COMPUTER NETWORKS DEC 2015

(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

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

QUESTION BANK. Unit 1. Introduction to Finite Automata

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

AUTOMATA THEORY AND COMPUTABILITY

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

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

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

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

UNIT 1 SNS COLLEGE OF ENGINEERING

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

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

Compiler Construction

Decision Properties for Context-free Languages

QUESTION BANK CS2303 THEORY OF COMPUTATION

Learn Smart and Grow with world

Final Course Review. Reading: Chapters 1-9

Department of Computer Science and Engineering

Ambiguous Grammars and Compactification

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

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

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

Theory Bridge Exam Example Questions Version of June 6, 2008

Theory of Computations Spring 2016 Practice Final Exam Solutions

Computer Sciences Department

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

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

CS 44 Exam #2 February 14, 2001

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

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

Context-Free Grammars

Theory of Computation

Turing Machine Languages

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

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

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

VALLIAMMAI ENGINEERING COLLEGE

Formal Languages and Automata

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

3 rd Year - Computer Science and Engineering,

Theory of Computations Spring 2016 Practice Final

Outline. Language Hierarchy

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

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

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

Actually talking about Turing machines this time

ECS 120 Lesson 16 Turing Machines, Pt. 2

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

CS402 - Theory of Automata Glossary By

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

Reflection in the Chomsky Hierarchy

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

Languages and Compilers

CpSc 421 Final Solutions

Formal Grammars and Abstract Machines. Sahar Al Seesi

LECTURE NOTES THEORY OF COMPUTATION

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

Context Free Grammars. CS154 Chris Pollett Mar 1, 2006.

CS402 - Theory of Automata FAQs By

Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama

Glynda, the good witch of the North

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

CS525 Winter 2012 \ Class Assignment #2 Preparation

Automata Theory CS S-FR Final Review

Models of Computation II: Grammars and Pushdown Automata

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

LECTURE NOTES THEORY OF COMPUTATION

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

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

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

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

Theory of Computation, Homework 3 Sample Solution

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

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

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

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

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

Normal Forms and Parsing. CS154 Chris Pollett Mar 14, 2007.

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

Chapter 14: Pushdown Automata

Introduction to Syntax Analysis

Introduction to Computers & Programming

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

CSE 105 THEORY OF COMPUTATION

A Note on the Succinctness of Descriptions of Deterministic Languages

A Characterization of the Chomsky Hierarchy by String Turing Machines

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

Post's Correspondence Problem. An undecidable, but RE, problem that. appears not to have anything to do with. TM's.

Transcription:

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: Theory of Computation UNIT I PART A 1. Define proof by contra positive and induction principle 2. Define Pumping lemma for regular language. 3. State Arden s theorem. 4. Prove that L = { 0 n 1 2n / n>=1} is not regular.(apr/may 08) 5. Write RE which denotes the language L over the set = {a,b} such that all the strings do not contain the substring ab. 6. Write regular expressions for the following.(apr/may 10) (i)binary numbers that are multiple of 2. (ii)strings of a s and b s with no consecutive a s (iii)strings of a s and b s containing a s 7. How a Non deterministic finite state automaton (NFA) differs from a Deterministic finite state automaton (DFA). 8. Define the languages described by DFA and NFA. 9. Define extended transition function for a DFA. 10. Define extended transition function for a NFA. (nov/dec 06) 11. Define extended transition function for a ᶓ-NFA. 12. Define ᶓ - closure of a state. 13. Find the ᶓ - closure of states 1, 2 and 4 in the following transition diagram. 14. Define regular expression and give an example. 15. Construct a finite state machine that accepts exactly those input strings of 0 s and 1 s that ends with 11 (nov/dec 07) 16. Give a regular expression for the set of all strings having odd number of 1 s 17. Construct a DFA for the language L = {a n b, n 0}. 18. Construct a DFA which accepts all strings over Σ = {0,1} ending with 00. 19. Give the regular expression for the set of all strings ending in 00.(apr/may 08) 20. When two states are equivalent and distinguishable? 21. What are the applications of regular expression? 22. Is it true that the language accepted by any NFA is different from the regular language?.justify your answer. 23. Prove that Q+RP= QP*(nov/dec 08) 24. Differentiate Deductive proof and Inductive proof. 25. Define Finite Automata. PART B 1. State and prove the pumping lemma for regular languages 2. Using pumping lemma for regular sets. Prove that the language L = {a n b n /n>1} is not regular(nov/dec 10) 3. Prove that 1 2 +2 2 +3 2 + + n 2 = Σn 2 = (n(n+1)(2n+1))/6..(apr/may 06) 4. Prove that for every integer n 0 the number 4 2n+1 + 3 n+2 is multiple of 13. 5. Show that if L be a set accepted by an NFA then there exists a DFA that accepts L.

6. (a)design FA which accepts even number of 0 s and even no of 1 s. (b)convert an NFA to a DFA given NFA M = (Σ,Q,δ,q0, F) Σ={0,1}, Q = { q0, q1, q2,q3},f= { q0}(nov/dec 11) 0 1 q0 q0 q0, q1 q1 q2 q2 q2 q3 q3 q3 ⱷ ⱷ UNIT - II PART-A First half 1. Let G = {{s, c}, {a, b}, P, s} where P consists of S->aca, C ->aca / b,find L(G). 2. Find L(G),where G = {{s}, {0,1}, s-> s1, s->ᶓ, s}(nov/dec 13) 3. What is Chomsky Normal form? 4. Find L(G),where P consists of S->asb, s->ab. 5. What is substitution rule? 6. Convert the following grammar G in GNF form S ->ABb / a, A ->aaa / B, B ->bab (nov/dec 14) 7. Define a derivation tree for a CFG. 8. Define Grammar with an example. 9. Write the relationship between derivation and derivation tree. 10. Define Parse Tree. 11. What are the types of grammar. 12. What are the closure properties of context- free Language? PART A Second half 13. Is context free language is closed under complementation? Justify. 14. Find L(G) for CFG S->asb / aab, A->bAa, A->ba. 15. Find the derivation tree for the grammar, G = {{s, A, B }, {a, b}, P, s},where P = {S->bA/bB, A ->ab, B->aBb/a} 16. Define Parse diagram. 17. What are the two major normal forms for context free grammar? 18. Eliminate the ᶓ (null) production from the CFG given below A->0 B 1 1 B 1 B->0 B 1 B ᶓ (nov/dec 09) 19. If the CFG is as below S->0A 1B C A->0S 00 B->1 A C->01 then remove the unit productions. 20. Let G = {{s, c}, {a, b}, P, s},p=s->asb / a, A->SbA /ss/ba.find a derivation tree whose yield aabbaa. (nov/dec 10) 21. Show that id+id*id can be generated by two distinct leftmost derivation in the grammar E->E+E/ E*E/ (E)/id 22. Let G = (N,T,P,S), P ={S->A1B/a, A->0A/ᶓ, B->0 B/1B/ᶓ give a leftmost and rightmost derivation for the string 00101. 23. Write CFG for L(G) = {a m b n c p / m +n=p, p >=1}(nov/dec 12)

24. What is ambiguous grammar. (nov/dec 11) 25. What is a useful production? PART B First half 1. Show that the grammar S ->a / absb / aab, A->bs / aaab is ambiguous. 2. Show the context free language are closed under union operation but not under intersection.(nov/dec 06) 3. (i) Find a grammar in Chomsky normal form equivalent to S ->AB / ab, A->aab/ᶓ, B->bbA form. (ii) Obtain the Greibach Normal form A1->A2 A3, A2->A3 A1/ b, A3->A1A2/ a PART B Second half 4. Let G=(V,T,P,S) be a CFG. If the recursive inference procedure tells that the terminal W is in the language of variable A, then there is a parse tree with root A and yield W. And Prove the vice versa also. 5. Find a grammar in Chomsky normal form equivalent to CFG(nov/dec 12) S ->aabb, A->aA a, B->bB b 6. Begin with the grammar (nov/dec 07) S->0A0 1B1 BB A->C B ->S A C->S ᶓ and simplify using safe order UNIT III Part - A 1. Define pushdown Automaton. 2. What are the different ways of language accepted by a PDA and define them. 3. Define the instantaneous descriptions(id) of pushdown Automaton. 4. Define Acceptance of PDA by Final State. 5. Define Acceptance of PDA by Empty stack. (nov/dec 08) 6. Define equivalence of acceptance by final state and empty stack. 7. Define rules for the conversion of Grammars to PDA. 8. Convert the given expression to PDA (apr/may 06) I -> a b Ia Ib I0 I1 9. Define Deterministic PDA. 10. What is the additional feature a PDA has when compared with NFA? 11. State the pumping lemma for CFL s? 12. State the equivalence of PDA and CFG. 13. Construct a PDA for the context free grammar(apr/may 11) S -> asa a A -> bb B -> b 14. Define Non Deterministic PDA.

15. Is it true that Non deterministic PDA is more powerful than that of Deterministic PDA. Justify. 16. Define the rule for construction of CFG from given PDA. 17. What are the main applications of pumping lemma in CFL s? 18. Design a PDA for accepting a language {L= a n b n n >=1}(apr/may 06) 19. Design a PDA for accepting a language {L= a n b 2n n >=1} 20. Show that the language {0 n 1 n 2 n } is not a context free language. 21. Differentiate ambiguous and unambiguous Grammar. 22. State formal definition of PDA. (nov/dec 07) 23. Define the languages generated by a PDA using the two methods of accepting a language. 24. Construct a PDA for the CFG S ->AB / ab, A->aab/ᶓ, B->bbA 25. Construct a PDA for the CFG S ->a / absb / aab, A->bs / aaab (apr/may 10) UNIT III PART - B 1. (i) Construct a PDA accepting by empty stack the languages {a m b m c n /m,n>=1} (ii) Find PDA for the given grammar S ->0S1 / 00 / 11 2. Give the CFG generating the language accepted by the following PDA M=({q0,q1,},{0,1},{z0,x},,q0, z0, ᶓ),with transactions ( q0, 1,z0 ) = {( q0, xz0 )}, ( q0, 1,x ) = {( q0, xx )}, ( q0, 0, x ) = {( q1,x)}, ( q0, ᶓ, z0 ) = {( q0, ᶓ)}, ( q1, 1, x ) = {( q1, ᶓ}, ( q1, 0,z0 ) = {( q0, z0)} (nov/dec 11) 3. Show that if a language L is accepted by a PDA then there exists a CFG generating L. 4. If L= N(P N) for some PDA P N =( Q,,, N,q0, Z0 ) then there is a PDA P F such that L= L(P F) [From empty stack to final state P F] (nov/dec 12) 5. Let L be L(P F) for some PDA P F = (Q,,, N,q0, Z0,F). Then there is a PDA P N such that L = N(P N) [From final state to empty stack] 6. (i)construct a PDA for set of palindrome over the alphabet{ a, b} L(M) = {WcW R } 7. (ii)if L is a context free language then prove that there exists a PDA M such that L = N(M) (nov/dec 12) UNIT IV Part A 1. What is a Turing machine? 2. What are the required fields of an ID or configuration of a TM. 3. Define Instantaneous description of Turing machine 4. Represent the ID for the transition function (q, Xi) = (p, Y, L). 5. Define the language of Turing machine. (nov/dec 09) 6. When a recursively enumerable language is said to be recursive? Is it true that the language accepted by a non deterministic TM is different from recursively enumerable language? 7. What is a multiple track Turing machine? 8. When a function f is is said to be Turing Computable? 9. List out different types of TMs. 10. Define Multi tape Turing machine. 11. Differentiate Multi head and Multi tape Turing machine..(apr/may 10) 12. What does Multi tape Turing machine contain?

13. Define Subroutines in Turing machine. 14. Define Non Deterministic Turing machine. 15. Define Halting Problem. (apr/may 08) 16. Is Halting problem decidable or undecidable problem. 17. Define Chomsky Hierarchy. 18. Is it possible that a Turing machine could be considered as a computer of functions from integers to integers? If yes justify.(nov/dec 11) 19. Define Rules of Context sensitive languages. 20. Compare FM, PDA and TM. 21. Define LBA. 22. Draw a transition diagram for a turning machine to compute n mod 2. (nov/dec 14) 23. What are applications of Turing Machine. 24. What is the role of checking off symbols in a Turing machine. 25. Mention any two problems that can be solved by Turing machine. PART - B 1. Construct a Turing machine for the language L={a n b n c n /n 0}.(nov/dec 12) 2. Explain the programming techniques of Turing machine. 3. Design a Turing machine which recognizes palindrome over alphabet {0,1}.(apr/may 10) 4. Construct a Turing machine which computes multiplication with subroutine copy. 5. Construct a Turing machine for language L={a n, b n, n 1} (nov/dec 10) 6. Construct a Turing machine to compute a function f(w)= W R where W ε {a,b} + (nov/dec 13) UNIT V Part - A 1. What do you mean by Universal TM. 2. What are the Features of Universal TM.(apr/may 11) 3. When a problem is said to be decidable and give an example of undecidable problem? (nov/dec 10) 4. When a language is said to be recursively enumerable? 5. When a language is said to be recursive? 6. State two languages, which are not recursively enumerable. 7. Define problem solvable in polynomial time. 8. Define the classes P and NP. 9. Define NP complete problem. (nov/dec 10) 10. What are tractable problems? 11. What are the properties of recursive and recursively enumerable languages?. 12. When do you say a problem is NP - hard? 13. Define Primitive Recursive function. 14. Is it true that the language accepted by a NDTM is different from recursively enumerable languages. 15. Define intractable problems. 16. Define Bounded quantification. 17. Define Polynomial Time reduction. 18. Show that union of recursive language is recursive. (nov/dec 11) 19. Define posts correspondence problem. 20. Define modified posts correspondence problem. 21. Define the classes P and NP.

22. Show that the following problem is undecidable. Given two CFG s G1 and G2 is L(G1) L(G2)=ⱷ 23. Differentiate between Initial and composition function. 24. Show that the union of recursive language is recursive. 25. Mention the difference between P and NP problems UNIT V Part - B 1. Show that for two recursive language L1 and L2 each of the following is recursive (i) L1UL2 (ii) L1 L2(iii) L1 2. Explain Universal Turing machine and Show that the universal language is recursively enumerable but not recursive. (nov/dec 12) 3. (i)show that the complement of recursive language is recursive. (ii)if language L and its complement L' are both recursively enumerable then show that L and L' is recursive. 4. Explain polynomial time reductions with relevant findings. 5. Write short notes on tractable and intractable problems.(apr/may 10) 6. Write a brief note on Primitive recursive function.