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

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

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


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

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

Multiple Choice Questions

QUESTION BANK. Unit 1. Introduction to Finite Automata

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

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

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

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

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

R10 SET a) Explain the Architecture of 8085 Microprocessor? b) Explain instruction set Architecture Design?

Final Course Review. Reading: Chapters 1-9

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

Theory of Computation, Homework 3 Sample Solution

Theory of Computation

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

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

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

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

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

UNIT 1 SNS COLLEGE OF ENGINEERING

Ambiguous Grammars and Compactification

Outline. Language Hierarchy

ECS 120 Lesson 16 Turing Machines, Pt. 2

CS402 - Theory of Automata Glossary By

Formal Grammars and Abstract Machines. Sahar Al Seesi

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

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

Pushdown Automata. A PDA is an FA together with a stack.

Computer Sciences Department

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

1.0 Languages, Expressions, Automata

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

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

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

CSE 105 THEORY OF COMPUTATION

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

Actually talking about Turing machines this time

3 rd Year - Computer Science and Engineering,

CSC-461 Exam #2 April 16, 2014

Parsing. source code. while (k<=n) {sum = sum+k; k=k+1;}

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

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

AUTOMATA THEORY AND COMPUTABILITY

Introduction to Computers & Programming

AUBER (Models of Computation, Languages and Automata) EXERCISES

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

Bottom Up Parsing. Shift and Reduce. Sentential Form. Handle. Parse Tree. Bottom Up Parsing 9/26/2012. Also known as Shift-Reduce parsing

CSCI312 Principles of Programming Languages!

PS3 - Comments. Describe precisely the language accepted by this nondeterministic PDA.

CS402 - Theory of Automata FAQs By

CS 44 Exam #2 February 14, 2001

Languages and Compilers

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

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

Theory of Programming Languages COMP360

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

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

Formal Languages and Automata

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

TENTAMEN / EXAM. General instructions

(DMTCS 01) Answer Question No.1 is compulsory (15) Answer One question from each unit (4 15=60) 1) a) State whether the following is True/False:

Lexical Scanning COMP360

Regular Languages. MACM 300 Formal Languages and Automata. Formal Languages: Recap. Regular Languages

Decision Properties for Context-free Languages

Theory Bridge Exam Example Questions Version of June 6, 2008

Languages and Finite Automata

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

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

QUESTION BANK CS2303 THEORY OF COMPUTATION

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

8 ε. Figure 1: An NFA-ǫ

Learn Smart and Grow with world

INSTITUTE OF AERONAUTICAL ENGINEERING

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

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

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

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

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

2. Lexical Analysis! Prof. O. Nierstrasz!

HKN CS 374 Midterm 1 Review. Tim Klem Noah Mathes Mahir Morshed

Models of Computation II: Grammars and Pushdown Automata

Context Free Languages and Pushdown Automata

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

CMPT 755 Compilers. Anoop Sarkar.

Introduction to Syntax Analysis

Formal Languages and Compilers Lecture IV: Regular Languages and Finite. Finite Automata

6 NFA and Regular Expressions

BSCS Fall Mid Term Examination December 2012

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

Languages and Automata

Formal Languages and Compilers Lecture VI: Lexical Analysis

Total No. of Questions : 18] [Total No. of Pages : 02. M.Sc. DEGREE EXAMINATION, DEC First Year COMPUTER SCIENCE.

Context-Free Grammars

Transcription:

*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 should e written in separate ooks. 2) Assume suitale data, if necessary. SECTION A 1. a) Give formal definitions of following with suitale examples :Epsilon closure, Non-Deterministic Finite Automata and Deterministic Finite Automata. 5 ) Define Mealy Machine. Construct a Mealy Machine which can output EVEN/ ODD if the total numer of 1 s in the input is even or odd. The input symols are 0 and 1. 5 c) Construct taular minimum state automata for following automata. State/ a q 0 q 0 q 7 q 7 P.T.O.

[4459] 255-2- *4459255* 2. a) Construct Moore machine equivalent to Mealy machine M given in the following tale : Next State Present State a State Output State Output a a ) Convert given non-deterministic finite automata (NFA) to deterministic finite automata (DFA). Informally descrie the language it accepts. δ 0 1 p {p,q} {p} q {r} *r {p,r} {q} c) Give non-deterministic finite automata to accept the following language over {0, 1}* The set of all strings containing either 101 or 110 as a sustring. 4 3. a) Construct minimized DFA accepting language represented y regular expression 0*1*2*. Convert given regular expression to NFA with ε moves and then covert NFA with ε moves to DFA using direct method. 8 ) Explain the application of regular expression to lexical analysis phase of compiler with suitale example. c) Give formal definition of regular expression and regular set. 2

*4459255* -3- [4459] 255 4. a) Using Arden s theorem, find the regular expression for the automata shown in the diagram. ) i) Write regular expression for following languages over {0, 1}* : The set of strings that egin with 110 The set of all strings not containing 101 as a sustring. ii) Give English description of the language of the following regular expression ( 1+ ε) (00 * 1)* 0 *. c) Prove or disprove each of the following aout regular expression : 1) (RS + R)*RS = (RR*S)* 2) (R + S)* = R* + S*. 4 5. a) Find a grammar in Chomsky Normal Form equivalent to the grammar S ~ S [S S] p q where S is the only variale. ) If the grammar G is given y production S asa S aa ε, show that any string in L(G) is of length 2n, n >= 0 the numer of strings of length 2n is 2 n. 2 c) State Pumping Lemma and use it to prove that language L = {a wherem is prime} is not regular language and not context free language. 10. a) Reduce the following grammar to Chomsky Normal Form : m S 1A 0B A 1AA 0S 0 B 0BB 1S 1

[4459] 255-4- *4459255* ) Derive (a101 + 1)*(a1 + ) using leftmost and rightmost derivation where grammar is given as E I, E E + E, E E*E, E (E), I a, I, I Ia, I I, I I0, I I1. Test whether the grammar is amiguous. c) Explain the application of context free grammar to syntax analysis phase of compiler with suitale example. SECTION B 7. a) Give formal definition of : Pushdown automata (PDA) Acceptance y PDA in terms of final state Acceptance y PDA in terms of null store Instantaneous description of PDA. ) Construct a context free grammar which accepts N(A), where A = ({q 0, }, {0, 1}, {Z 0, Z}, δ, q 0, Z 0, φ where δ is given y, 1, Z 0, Z Z 0 )}, ε, Z 0, ε )}, 1, Z, Z Z)}, 0, Z) = {(, Z)} δ (, 1, Z) = {(, ε )} δ (, 0, Z 0, Z 0 )} 12 n m n 8. a) Construct a pushdown automata A accepting L { 0 1 0 m, n >= 1} =. 7 ) Convert the grammar to PDA that accepts the same language y empty stack S S0S1S0S S0S0S1S S1S0S0 S ε c) Define deterministic PDA, compare deterministic PDA with non deterministic PDA. 5

*4459255* -5- [4459] 255 9. a) Design using transition tale a Turing machine that can accept the set of all even palindromes over {a, }. ) Explain in detail concept of Universal Turing Machine and extensions to asic Turing Machine. c) Give formal definition of : i) Post machine ii) Move relation of Turing Machine. 4 10. a) Design taular post machine to accept a language L = {(01) n 0 n, n >= 0} and test the design for two different inputs. 8 n n n ) Design a Turing Machine M to recognize the language { 1 2 3 n 1} >=. c) Justify whether PM = TM, where PM is Post Machine and TM is Turing Machine. 2 11. a) Justify Halting Prolem of Turing machine is undecidale. 5 ) Explain in detail Chomsky Hierarchy stating the types of grammars, types of machines and types of languages. c) Prove If L is recursive language so is its complement L c. 5 12. a) Define recursive and recursively enumerale language along with example. 4 ) Explain in detail Post Correspondence Prolem and Modified Post Correspondence Prolem with suitale example. c) Prove It is undecidale whether a CFG is amiguous. B/II/13/