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

Similar documents
JNTUWORLD. Code No: R

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

(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

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

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

UNIT I PART A PART B


Multiple Choice Questions

QUESTION BANK. Unit 1. Introduction to Finite Automata

CT32 COMPUTER NETWORKS DEC 2015

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

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

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

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

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

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

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

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

AUTOMATA THEORY AND COMPUTABILITY

Theory of Computations Spring 2016 Practice Final

Ambiguous Grammars and Compactification

Theory of Computations Spring 2016 Practice Final Exam Solutions

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

Outline. Language Hierarchy

CS402 - Theory of Automata FAQs By

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

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

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

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

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

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

CS402 - Theory of Automata Glossary By

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

Computer Sciences Department

1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8]

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

Learn Smart and Grow with world

AUBER (Models of Computation, Languages and Automata) EXERCISES

Compiler Construction

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

Formal Languages and Compilers Lecture VI: Lexical Analysis

Final Course Review. Reading: Chapters 1-9

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

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

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

Actually talking about Turing machines this time

Theory of Computation, Homework 3 Sample Solution

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

UNIT -2 LEXICAL ANALYSIS

Dr. D.M. Akbar Hussain

UNIT 1 SNS COLLEGE OF ENGINEERING

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

Question Bank. 10CS63:Compiler Design

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Theory of Computation

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

CpSc 421 Final Solutions

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

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

Formal Languages and Automata

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram

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

ECS 120 Lesson 7 Regular Expressions, Pt. 1

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

KEY. A 1. The action of a grammar when a derivation can be found for a sentence. Y 2. program written in a High Level Language

Midterm I (Solutions) CS164, Spring 2002

Optimizing Finite Automata

QUESTION BANK CS2303 THEORY OF COMPUTATION

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

Chapter 14: Pushdown Automata

Regular Languages and Regular Expressions

CIT3130: Theory of Computation. Regular languages

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

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

Concepts Introduced in Chapter 3. Lexical Analysis. Lexical Analysis Terms. Attributes for Tokens

LECTURE NOTES THEORY OF COMPUTATION

CS 315 Programming Languages Syntax. Parser. (Alternatively hand-built) (Alternatively hand-built)

Lexical Scanning COMP360

Context-Free Grammars

CS 314 Principles of Programming Languages

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

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

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

CS 314 Principles of Programming Languages. Lecture 3

CSC-461 Exam #2 April 16, 2014

Enumerations and Turing Machines

CS 44 Exam #2 February 14, 2001

Decision Properties for Context-free Languages

CS 403 Compiler Construction Lecture 3 Lexical Analysis [Based on Chapter 1, 2, 3 of Aho2]

Context-Free Languages. Wen-Guey Tzeng Department of Computer Science National Chiao Tung University

MA513: Formal Languages and Automata Theory Topic: Context-free Grammars (CFG) Lecture Number 18 Date: September 12, 2011

Models of Computation II: Grammars and Pushdown Automata

Automata Theory CS S-FR Final Review

Department of Computer Science and Engineering

ECE251 Midterm practice questions, Fall 2010

Context-Free Languages. Wen-Guey Tzeng Department of Computer Science National Chiao Tung University

Context-Free Languages. Wen-Guey Tzeng Department of Computer Science National Chiao Tung University

Transcription:

R1 SET - 1 1. a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA? 2. a) Design a DFA that accepts the language over = {, 1} of all strings that contain neither the sub-string nor the sub-string 11. b) Construct a minimal state finite automaton to the following state diagram: 3. a) Find the regular expression for the following finite automaton: b) Show that the simplified regular expression recognized by the following DFA is the set of all strings of a s and b s that end with letter a. 1 of 2

R1 SET - 1 4. a) Consider the following context free grammar: Find the leftmost derivation, rightmost derivation, and parse tree for the string: a*(a+b). b) Write a context free grammar for the while statement in C language. 5. a) Consider the following context free grammar, G: Convert the G equivalent to G that has: no null productions, and no unit productions one after the other. b) Find the Greibach normal form of the following grammar: 6. Let M = ({q, q 1 }, {a, b}, {X, Z },, q, Z, ) be a push down automata (PDA) and is defined by: i) Find the language accepted by the PDA, M by empty store. ii) Construct a context free grammar (CFG), G that accepts null store, N(M) 7. a) Explain, briefly, about the different types of Turing Machines. b) Design a Turing Machine (TM) that accepts the language, L = { n 1 n n n 1 } 8. a) State and explain the undecidability of post correspondence problem b) What do you meant by decidable and undecidable problems? Explain, in detail, P and NP problems with examples. (8M+7M) 2 of 2

R1 SET - 2 1. a) Give a finite state diagram that accepts all the floating-point numbers. b) Design NFA to accept strings with a s and b s such that the string end with ab 2. a) Construct a minimal state Finite Automaton to the following state diagram: b) Design a Moore machine and Mealy machine that accepts strings over = {, 1} where, if the input ends in 1, output a A; if the input ends in 1, output a B; else output a C. 3. a) Construct an NFA and DFA for the Regular Expression: ( + 1)*( + 11) 11. b) Find the regular expression for the following finite automaton: 4. a) Give the context free grammar that generates the set { n 1 n n 1} b) Consider the following context free grammar: E +EE *EE EE x y Find the leftmost derivation, rightmost derivation, and parse tree for the string: + * x y x y (8M+7M) 1 of 2

R1 SET - 2 5. a) Convert and reduce the following grammar such that there are no UNIT productions. S AA A B BB B abb b bb b) Find the Greibach normal form of the following grammar: 6. a) Construct the equivalent grammar for the PDA M = q q,,1, R, Z, δ, q,, Φ and is given by ({, 1} { } { } Z ) δ( q,, Z ) = ( q, RZ ) δ( q,, R) = ( q, RR) δ( q,1, R) = ( q1, R ) δ( q1,1, R) = ( q1, R ) δ( q1,, R) = ( q1, ) δ( q1,, Z ) = ( q1, ) b) Design a PDA for a language = w w ( + 1) { and number of 's < number of 1's} L by final state. 7. a) Consider following transition table (States versus Tape symbols) of a Turing Machine, M: Find the computation sequence of the input string: B b) Design a Turing Machine, M that accepts e set of strings with an equal number of s and 1 s 8. a) What is a universal Turing machine? Explain Turing reducibility. b) Construct the LR() parser for the following grammar: 2 of 2

R1 SET - 3 1. a) Construct NFA in which double 1 s followed by double s b) Design FA that accepts set of all string with three consecutive s over = {, 1}. 2. a) Design a DFA over = {, 1} accepting all strings of even number of decimal numbers in binary. b) Construct a DFA equivalent to the following NFA diagram: 3. a) When are two regular expressions said to be equivalent? Obtain the regular expression represented by the regular set: {, 1,, 1,, 1,, 1, } b) Prove the following regular expression identities: i) ( + ) ( + )* = * ii) 1 + ( + ) ( + )* 1 = *1 iii) + 1* (11)* (1* (11)*)* = (1 + 11)* 4. a) For the following grammar give the leftmost and rightmost derivation for the string 11. S A B A A B B 1B b) Construct the right linear grammar and left linear grammar for the language (+1)*(+1)* 1 of 2

R1 SET - 3 5. a) Consider the following grammar G: Find an equivalent grammar that has: no null productions, and no unit productions one after the other. b) Convert the given CFG into GNF S CA A a C ab b 6. a) Design a PDA that accepts a string of a well formed parenthesis. Consider parenthesis is as ( ), [ ], { }. b) Construct PDA equivalent to the following CFG S A A ABC 1B B 1 C 2 7. a) Consider the following transition table (States versus Tape symbols) of a Turing Machine, M: If the initial Instantaneous Description (ID) is: q 1 ( ( ) B, then what is the final ID? b) Design Turing Machine over ={1} to accept the language L={1 m /m is odd} 8. a) What is a modified PCP? Explain with some suitable example. b) Explain, in detail, NP Complete and NP hard problems with examples. 2 of 2

R1 SET - 4 1. a) Give a finite state diagram that accepts all the floating-point numbers. b) Design NFA which accepts the language containing either 1 or 1 over ={,1}. 2. a) Design a DFA that accepts the language over the alphabet, = {, 1, 2} where the decimal equivalent of the language is divisible by 3. b) Design a Moore machine and Mealy machine that accepts strings over = {, 1} where, if the input ends in 1, output a A; if the input ends in 1, output a B; else output a C. 3. a) Show that L={ i 1 j gcd(i,j) =1} is not regular b) Show that the following regular expression identities are equivalent: i) r + = r * r + ii) (r + s ) * = ( r + s * ) * 4. a) Construct a context free grammar for generating the balanced parentheses, like ( ), [ ], [( ) ( ) ], ( [ ] ), etc. and find the moves of the grammar to derive the string: ( [ ( ) ] ( ) ) b) Draw the parse tree for the production grammar: S (S) S S ~S i j, generating the symbolic formula: (~ ~ i ( i ~ ~ j ) ). 5. a) State and prove the pumping lemma for context free languages. b) Give CFG for generating odd palindromes over the string {a,b} 6. a) Design a PDA that accepts a string of a well formed parenthesis. Consider parenthesis is as ( ), [ ], { }. b) Construct PDA equivalent to the following CFG S A A ABC 1B B 1 C 2 7. a) State and prove the Turing Machine (TM) halting problem. b) Design a Turing Machine, M that accepts a palindrome consisting of s and 1 s of any length. 8. a) Describe in detail about halting problem of a Turing machine b) Describe about modified Post s correspondence problem. 1 of 1