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

Similar documents

JNTUWORLD. Code No: R

(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

UNIT I PART A PART B

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?

Multiple Choice Questions

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

Theory of Computation, Homework 3 Sample Solution

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

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

3 rd Year - Computer Science and Engineering,

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

Decision Properties for Context-free Languages

UNIT 1 SNS COLLEGE OF ENGINEERING

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

Outline. Language Hierarchy

AUTOMATA THEORY AND COMPUTABILITY

Department of Computer Science and Engineering

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

CS 44 Exam #2 February 14, 2001

Computer Sciences Department

Final Course Review. Reading: Chapters 1-9

CS402 - Theory of Automata Glossary By

QUESTION BANK. Unit 1. Introduction to Finite Automata

AUBER (Models of Computation, Languages and Automata) EXERCISES

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

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

Learn Smart and Grow with world

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

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

CSE 105 THEORY OF COMPUTATION

Ambiguous Grammars and Compactification

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

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

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

Introduction to Automata Theory

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

CSCI 340: Computational Models. Turing Machines. Department of Computer Science

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

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

ECS 120 Lesson 16 Turing Machines, Pt. 2

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

Actually talking about Turing machines this time

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

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6503 / THEORY OF COMPUTATION III YEAR / V SEM QUESTION BANK UNIT I AUTOMATA

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

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

Theory Bridge Exam Example Questions Version of June 6, 2008

Chapter 14: Pushdown Automata

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

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

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

Formal Languages and Automata

CS21 Decidability and Tractability

CpSc 421 Final Solutions

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

Introduction to Computers & Programming

A Note on the Succinctness of Descriptions of Deterministic Languages

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

Theory of Computation

Homework. Announcements. Before We Start. Languages. Plan for today. Chomsky Normal Form. Final Exam Dates have been announced

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

VALLIAMMAI ENGINEERING COLLEGE

Enumerations and Turing Machines

Lecture 18: Turing Machines

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Turing Machine Languages

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

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

Automata Theory CS S-FR Final Review

Formal Grammars and Abstract Machines. Sahar Al Seesi

CS402 - Theory of Automata FAQs By

Theory of Computations Spring 2016 Practice Final

Formal languages and computation models

Recursively Enumerable Languages, Turing Machines, and Decidability

Specifying Syntax COMP360

CSE 105 THEORY OF COMPUTATION

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

Theory of Computations Spring 2016 Practice Final Exam Solutions

Universal Turing Machine Chomsky Hierarchy Decidability Reducibility Uncomputable Functions Rice s Theorem Decidability Continued

LECTURE NOTES THEORY OF COMPUTATION

An Interactive Approach to Formal Languages and Automata with JFLAP

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

LECTURE NOTES THEORY OF COMPUTATION

CSC-461 Exam #2 April 16, 2014

We can create PDAs with multiple stacks. At each step we look at the current state, the current input symbol, and the top of each stack.

Rice s Theorem and Enumeration

Context Free Languages and Pushdown Automata

Models of Computation II: Grammars and Pushdown Automata

Context-Free Languages and Parse Trees

The Big Picture. Chapter 3

THEORY OF COMPUTATION

Theory of Programming Languages COMP360

Transcription:

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 by regular expression: (a) L1=the set of all strings of 0 s and 1 s ending in 00. (b)l2=the set of all strings of 0 s and 1 s beginning with 0 and ending with 1. 3)Describe Transition system. 4)Define Deterministic automata with example. 5)Define Non-Deterministic automata with example. 6)Define NDFA with e-transition.give example. 7)Define e-closure with example. 8)What is the difference between DFA and NDFA. 9)Define acceptance of a string and language. 10)Give the regular set or language for the regular expression: (a)1(01)*(10)*1 (b)(1+10)*001. 11)Define regular expression with example. 12)Construct DFA for the set of strings{ } ending with 00. 13)Obtain the DFA equivalent to the following NDFA. F={q2},initial state={q0} States\inputs 0 1 q0 {q0,q1} {q0} q1 - {q2} q2 - - 14)Obtain an NDFA without e-transition to the following NDFA with E-transition: F={q2},initial state={q0} States\inputs 0 1 2 e q0 {q0} - - {q1} q1 - {q1} - {q2} q2 - - {q2} - 15)Define Moore Machine with example. 16)Define Mealy machine with example. 17)Prove that for every Moore machine M1 there is a Mealy machine M2.

18)State the pumping lemma for regular sets or regular language. 19)What is the use of the pumping lemma for regular sets? 20)State the application of the pumping lemma for regular sets. UNIT-II 1)Define a grammar with example. 2)Define CFG with example. 3)State the different types of grammar. 4)Find L(G) where G=({S},{0,1},{S->0S1,S->E},S) 5)Define derivation tree for a CFG. 6)Let G=({S,C},{a,b},P,S) where P consists of S->aCa, C->aCa/b.Find L(G). 7)Consider G whose productions are S->aAS/a, A->SbA/SS/ba.Show that S=>aabbaa and construct a derivation tree whose yield is aabbaa. 8)Define Ambiquous grammar with example. 9)Define LMD and RMD.Give example. 10)Define sentinential form with example. 11)Define useless and useful symbols.give example. 12)When a variable is said to be nullable? 13)Define Unit production with example and Useless production. 14)Define E-production. 15)What are the kinds of Normal forms. 16)Define CNF with example. 17)Define GNF with example. 18)State the difference between CNF and GNF. 19)Define inherently ambiquous CFL. 20)Define A-derivable. 21)When CFG is said to be linear grammar? 22)Define an operator grammar. UNIT-III 1)Define Pushdown Automata. 2)Give an example of a PDA. 3)Define the acceptance of a PDA by empty stack.is it true that a language accepted by a PDA by empty stack or by that of final states are different languages? 4)What are the different types of language acceptances by a PDA and define them? 5)Give an eample of a language accepted by a PDA but not by DPDA.

6)Describe the two types of moves of PDA. 7)Describe the instantaneous Description of a PDA. 8)When is a PDA said to be deterministic?are the deterministic and non-deterministic models of PDA equivalent with respect to the language accepted? 9)State the pumping lemma for CFL. 10)What is the use of pumping lemma for CFL?(Applicatons.) UNIT- IV 1)Define Turing machine. 2)Define ID and Move of a Turing machine. 3)Define the language accepted by a TM. 4)Is it possible that a TM could be considered as computer of functions from integers to integer?if yes,justify your answer. 5)Define total recursive and partial recursive functions. 6)When a language is said to be recursively enumerable? 7)When is the technique of checking of symbols useful? 8)Define Multiple Turing machine. 9)When is the technique of shifting over useful? 10)List some of the modified versions of of the basic model of a TM. 11)Define Multidimensional TM. 12)Define Multihead TM. 13)What is an off-line TM. 14)When is a function f said to be Turing computable? 15)Construct a TM to compute the function f(x)=x+2. 16)Construct a TM that accepts strings over{1} containing even number of 1 s. 17)Explain how a TM with multiple tracks of the tape can be used to determine the given number is prime or not? UNIT V 1) When a problem is said to be decidable and give an example of an undecidable problem? 2) What is undecidability? 3) Explain the modified Part s Correspondance Problem(MPCP). 4) Differentiate recursive and recursively enumerable language. 5) Give the properties of recursively enumerable sets which are undecidable. 6)Show that the union of recursive languages is recursive. 7)Explain the Halting problem.is it decicable or undecidable problem? 8)Define universal language Lu. 9)Obtain the code for,where

M=({q1,q2,q3},{0,1},{0,1,B},d,q1,B,{q2}) have moves; 10)Define the language Ld. PART-B UNIT -I 1) If L is a set accepted by an NDFA, then show that L is accepted by a DFA. 2) If L is a set accepted by an NDFA with e - transition,then show that L is accepted by an NDFA without e- transition. 3) Let r; be a regular expression. Then,show that there exists an NDFA with e- transitions that accepts L(r). 4) If L is accepted by a DFA, then show that L is denoted by a regular expression. 5) Construct an NDFA equivalent to (0+1)*(00+11). 6) Construct a regular expression corresponding to the transition diagram in the following figure. F={q1},initial state={q1} States\inputs 0 1 q1 q1 q2 q2 q3 q2 q3 q1 q2 7) If M1 is a meanly machine, then show that there is a Moore machine M2 equivalent to M1. 8) Constuct Moore machine from the given meanly machine. Initial state={q0} States\inputs 0 1 x y q0 {p0} {p1} {p0,p1} - p0 {p0} {p1} {p1} {p0} p1 {p0} {p1} {p0} {p1} 9) Show that the set L = { 0i 1i / i =1} is not regular 10)Show that the set L = { oi2 / i is an integer, i =1 } is not regular 11)Show that L={0m 1n 0 m+n}is not regular. 12)Construct minimized DFA from the given NDFA. States\inputs 0 1 q0 {q0,q1} {q0,q3} q1 {q2} - q2 - - q3 - {q4} q4 - - 13)Construct an NDFA without transitions from the given NDFA with e transition.

F={q2},initial state={q0} States\inputs 0 1 2 e q0 q0 - - q1 q1 - q1 - q2 q2 - - q2 - UNIT-II 1) Let a be CFG and let A? w in a., then S.t that there is a LMD of w. 2) Let G=(V,T,P,S)be a CFG. Then prove that s? a iff there is a destination tree in grammar G with yield a. 3) If G is the grammar s >sbs/a,show that G is ambiguous. 4) Explain in detail the ambiguity in CFG. 5) Prove that every non empty CFL is generated by a CFG with no useless symbols. 6) Let G=(V,T,P,S) be a CFG with L=L(G).Then show that there exists a CFG G¹ with L(G¹)=L-{e}has no useless symbols or e-productions. 7) Prove that for any CFL without e is defined by a grammar with no useless symbols, - productions or unit production. 8) Prove that for any CFL without e is generated by a grammar in which every production is of the form A >BC OR A >a(cnf). 9) Prove that for every CFL without e can be generated by a grammar for which every production is of the form A >aa, where A is a variable, a is a terminal & a is eternize of variables (possible empty)(gnf). 10)Find a grammar in CNF equivalent to S >aad;a >ab/bab; B >b;d >d. 11)Find a grammar in CNF equivalent to S->aAbB;A >aa/a; B >bb/b. 12)Construct a grammar in GNF equivalent to the grammar S >AA/a;A >SS/b. 13)Convert to GNF the grammar G-C{A1,A2,A3},{a,b},{P,A1},where P consists of the following : A1 >A2A3;A2 >A3A1/b;A3 >A1A2/a; UNIT -III 1) If L is L(M2) for some PDA M2,then show that L is N(M1)has same PDA M1. 2) If L is N(M1) for some PDA M1,then show that L is L(M2)for some PDA M2. 3) If L is CFL, then prove that there exists a PDA M such that L=N(M). 4) If L is N(M) for some PDA M,then show that L is CFL.

5) Construct when CFG G which accepts N(M),when M=C{q0,q1},{0,1}, {z0,z1},?,q,?)and? is given by:? (q0, 0,z0)=(q0,zz0);?(q1,1,Z)=(q1,e)? (q0, 0,z)=(q0,ZZ);?(q1, e,z)=(q1, e)? (q0,1,z)=(q1, e);?(q1, e,z0)=(q1, e) 6) Construct a PDA for the language L={wwR/w in (0+1)*} 7) Construct a PDA for the language L={wcwR/w in (0+1)*} 8) Show that L={ aibjcidj/i=1, j=1}is not a CFL 9) Show that L={on1n 2 n/n=1}is not a CFL. 10)Show that L={ aibjck/i?j,j?k& i?k} is not a CFL. Unit IV 1) Design a turing machine M to implement the function multiplication using the subroutine copy. 2) Design a TM to compute proper subtraction m-n. 3) Design a TM to accept the language L={0n1 n/n=1} 4) Construct a TM to recognize the language L={ 02n/n=0} 5) Enumerate the various techniques adopted for the construction of a TM. 6) Explain finite control can be treated as storage for a finite amount of information. 7) Illustrate with an example the techniques of creating the tape to have multiple tracks. 8) Illustrate with example the techniques of checking off symbols. 9) Construct a part of TM to shift non blank symbol two cells to the right end. support that tape does not contain blanks between non blanks. 10) Prove that if L is recognized by a TM with a two way infinite tape iff it is recognized by a TM with a one way infinite tape UNIT V 1)Discuss in detail about universal TM. 2)Show that the complement of a recursive language is recursive. 3)Show that Lu is recursively enumerable but not recursive. 4)Show that Ld is not recursively enumerable. 5)If a language L and its complement L are both recursively enumerable, then show that L and hence L are recursive. 6)Prove that there exists a recursively enumerable language whose complement is not recursively enumerable. 7)Prove that any non-trivial property of the recursively enumerable languages is undecidable.(rice s theorem). 8)Prove that Halting problem is undecidable.