(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},

Similar documents
1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

Question Bank UNIT I

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

VTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a.

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

INSTITUTE OF AERONAUTICAL ENGINEERING

AC68 FINITE AUTOMATA & FORMULA LANGUAGES JUNE 2014

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

Foundations of Informatics: a Bridging Course

Theory of Computation (II) Yijia Chen Fudan University

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

TAFL 1 (ECS-403) Unit- III. 3.1 Definition of CFG (Context Free Grammar) and problems. 3.2 Derivation. 3.3 Ambiguity in Grammar

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Theory of Computation (Classroom Practice Booklet Solutions)

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

Theory of Computation Turing Machine and Pushdown Automata

Automata Theory CS F-08 Context-Free Grammars

Theory of Computation (IV) Yijia Chen Fudan University

Theory of Computation - Module 3

Context Free Languages and Grammars

Pushdown Automata. Reading: Chapter 6

Section 1 (closed-book) Total points 30

An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State Machine (FSM).

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Computational Models - Lecture 4

SFWR ENG 2FA3. Solution to the Assignment #4

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Author: Vivek Kulkarni ( )

5 Context-Free Languages

Einführung in die Computerlinguistik

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where

Introduction to Theory of Computing

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a

MA/CSSE 474 Theory of Computation

CISC4090: Theory of Computation

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

Computational Models - Lecture 5 1

SCHEME FOR INTERNAL ASSESSMENT TEST 3

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10

Theory of Computation (IX) Yijia Chen Fudan University

CPS 220 Theory of Computation

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Computability and Complexity

Finite Automata. Finite Automata

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

Theory of Computation

Introduction to Formal Languages, Automata and Computability p.1/42

CS375: Logic and Theory of Computing

Einführung in die Computerlinguistik

Chapter 6. Properties of Regular Languages

Undecidable Problems and Reducibility

Automata Theory - Quiz II (Solutions)

The View Over The Horizon

CISC 4090 Theory of Computation

Theory of Computation (I) Yijia Chen Fudan University

Automata and Computability. Solutions to Exercises

Fundamentele Informatica II

CA320 - Computability & Complexity

Lecture 17: Language Recognition

Sri vidya college of engineering and technology

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

Automata and Computability. Solutions to Exercises

Closure under the Regular Operations

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Part 3 out of 5. Automata & languages. A primer on the Theory of Computation. Last week, we learned about closure and equivalence of regular languages

MTH401A Theory of Computation. Lecture 17

Context Free Languages (CFL) Language Recognizer A device that accepts valid strings. The FA are formalized types of language recognizer.

Pushdown Automata (2015/11/23)

Sheet 1-8 Dr. Mostafa Aref Format By : Mostafa Sayed

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Nondeterministic Finite Automata

Theory Bridge Exam Example Questions

Grammars and Context Free Languages

V Honors Theory of Computation

Computational Models - Lecture 4 1

Harvard CS 121 and CSCI E-207 Lecture 10: Ambiguity, Pushdown Automata

download instant at Assume that (w R ) R = w for all strings w Σ of length n or less.

Decidability (What, stuff is unsolvable?)

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 10 : Context-Free Grammars

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules).

CS500 Homework #2 Solutions

CMSC 330: Organization of Programming Languages

CSE 468, Fall 2006 Homework solutions 1

DM17. Beregnelighed. Jacob Aae Mikkelsen

Theory of Languages and Automata

Transcription:

Code No: 07A50501 R07 Set No. 2 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) If G=({S}, {0, 1}, {S 0S1, S ε}, S), find L(G). (b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3}, {a,b},p,a) Where P consists of the following A1 A2 A3 A2 A3 A1 b A3 A1 A2 a [16] 3. (a) Design Push Down Automata for L={0 n 1 2n n 1}by final state method. (b) Draw the transaction diagram for above language L. [12+4] 4. (a) Show that there exist no finite automaton accepting all palindromes over {a, b}. (b) Show that {a n b n n > 0} is not a regular set without using the pumping lemma. [8+8] 5. (a) Construct a NFA accepting {ab, ba} and use it to find a deterministic automaton accepting the same set. (b) M = ({q1, q2, q3}, {0, 1}, δ, q1, {q3}) is a NFA where δ is given by δ (q1, 0) = {q2, q3}, δ (q1, 1) = q1 δ (q2, 0) = {q1, q2 δ(q2, 1) = δ(q3, 0) = {q2}, δ(q3, 1) = {q1, q2} construct an equivalent DFA. [8+8] 6. Design Turing Machine for L = { 0 n 1 n 0 n n 1 }. [16] 7. Construct LR(0) items for the grammar given find it s equivalent DFA S asa b A Ab a [16] 8. (a) Construct a Deterministic acceptor equivalent to M=({q 0, q 1,q 2 },{a,b},δ,q 0,{q 2 }) and δ is given in table (figure 1). (b) Construct a Moore machine equivalent to the Mealy machine M given in table. [8+8] 1

Code No: 07A50501 R07 Set No. 2 figure - 1 *******

Code No: 07A50501 R07 Set No. 4 Figure 1: III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. Explain the following (a) Multi - tape Turing Machine (b) Multi - dimensional Turing Machine (c) Multi - head Turing Machine. [6+5+5] 2. State and explain about closure properties of Context Free Languages. [16] 3. (a) Differentiate Moore and Mealy machines (b) Define NFA with ε - moves. (c) Construct a Mealy machine which can output EVEN, ODD according as the total number of 1 s encountered is even or odd. The input symbols are 0 and 1. [5+4+7] 4. (a) Let G be the grammar. S as asbs ε. Prove that L(G) = {x such that each prefix of x has atleast as many a s as b s} (b) Show that {abc, bca, cab} can be generated by a regular grammar whose terminal set is {a, b, c} [8+8] 5. (a) Give NFA accepting the set of all strings of 0 s and 1 s such that the 10th symbol from the right is a 1. (b) Give DFA accepting the set of all strings with 3 consecutive 0 s over the alphabet {0, 1}. (c) Define Finite Automata. Give an example. [6+5+5] 6. Convert the following grammar to Chomsky Normal Form S ABA A aa ε B bb ε and simplify the grammar [16] 2

Code No: 07A50501 R07 Set No. 4 7. Construct LR(0) items for the grammar given find it s equivalent DFA. S S S AS a A aa b [16] 8. Using pumping lemma show that the following sets are not regular: (a) {a n b 2n n > 0} (b) {a n b m 0<n<m} [8+8] 3

Code No: 07A50501 R07 Set No. 1 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. Find regular expressions representing the following sets (a) the set of all stings over {0, 1} having at most one pair of 0 s or atmost of one pair of 1 s (b) the set of all strings over {a, b} in which the number of occurrences of a is devisible by 3 (c) the set of all strings over {a, b} in which there are at least two occurrences of b between any two occurrences of a. (d) the set of all strings over {a, b} with three consecutive b s. 2. Explain halting problem of Turing Machine. [16] 3. What are type 0, 1, 2, 3 grammars? Compare them in different aspects. [16] 4. (a) Construct NFA accepting the set of all strings over an alphabet {0, 1} of 0 s and 1 s such that the 10th symbol from the right end is a 1. Construct DFA equivalent to this NFA. (b) Construct NFA accepting the set of all strings over an alphabet {0, 1} such that every block of 5 consecutive symbols contains at least two 0 s. Construct DFA equivalent to this NFA. [8+8] 5. (a) Convert the following grammar to Greibach Normal Form S SS S 0S1 01 (b) Show that grammar is ambiguous S asbs bsas ε [8+8] 6. State and explain the properties of DCFL. [16] 7. (a) Consider the Finite State Machine whose Transition function δ is given in the form of a transition table (figure 2). Here, Q = {q 0,q 1,q 2,q 3 }, Σ ={0,1},F={q 0 }. Give the entire sequence of states for the inputstring 110001. Transition Table: (b) Let M = (Q,Σ,δ, q0, F) be a finite automaton. Let R be a relation in Q defined by q 1 R q 2 if δ (q 1,a)=δ(q 2,a) for some a Σ. Is R an equivalence relation? [8+8] [16] 4

Code No: 07A50501 R07 Set No. 1 Figure 2: 8. (a) Find the language generated by the grammar. S 0A 1S 0 1, A 1A 1S 1 (b) Construct context-free grammars to generate the set {a l b m c n one of l, m, n equals 1 and the remaining two are equal}. [8+8] 5

Code No: 07A50501 R07 Set No. 3 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. What is meant by Chomsky hierarchy of languages. Explain the relations between different types of languages. [16] 2. Explain about various types of Turing Machine. [16] 3. (a) State and explain pumping lemma for CFL. (b) Show that L ={a n b n c n n 1} is not CFL. [8+8] 4. (a) Draw the transition diagram of a FA which accepts all strings of 1 s and 0 s in which both the number of 0 s and 1 s are even. (b) Construct NFA which accepts the set of all strings over {0, 1} in which there are at least two occurrences of 1 between any two occurrences of 0. Construct DFA for the same set. [8+8] 5. (a) Construct a NFA accepting {ab, ba} and use it to find a deterministic automaton accepting the same set. (b) M = ({q1, q2, q3}, {0, 1}, δ, q1, {q3}) is a NFA where δ is given by δ (q1, 0) = {q2, q3}, δ (q1, 1) = {q1} δ (q2, 0) = {q1, q2}, δ (q2, 1) = δ (q3, 0) = {q2}, δ (q3, 1) = {q1, q2} construct an equivalent DFA. [8+8] 6. (a) Construct a grammar generating L = {wcw R w ε {a, b}* }. (b) Find a CFG with no useless symbols equivalent to S AB CA, A a, B BC AB, C ab b [8+8] 7. Let value (x) be the result when the symbols of x are multiplied from left to right according to the table given. (a) Is L= {xy x = y and valule(x)=value(y)} regular? (b) Is L = {xy valule(x)=value(y)} regular? [8+8] a a c a a a c b c a b c b c a 8. Construct Push Down Automata which can accept the language L={X, axa, bxb, aaxaa, abxab, bbxbb, aaaxaaa,...}. [16] 6

Code No: 07A50501 R07 Set No. 3 7