JNTUWORLD. Code No: R

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

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

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

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

UNIT I PART A PART B


Multiple Choice Questions

(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

CT32 COMPUTER NETWORKS DEC 2015

QUESTION BANK. Unit 1. Introduction to Finite Automata

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

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

AUTOMATA THEORY AND COMPUTABILITY

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

Ambiguous Grammars and Compactification

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

Compiler Construction

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

Decision Properties for Context-free Languages

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

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

QUESTION BANK CS2303 THEORY OF COMPUTATION

Final Course Review. Reading: Chapters 1-9

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

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

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

CS402 - Theory of Automata FAQs By

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

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

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

Department of Computer Science and Engineering

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

UNIT 1 SNS COLLEGE OF ENGINEERING

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

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

Learn Smart and Grow with world

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

Models of Computation II: Grammars and Pushdown Automata

Actually talking about Turing machines this time

KHALID PERVEZ (MBA+MCS) CHICHAWATNI

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

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

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

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

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 Glossary By

Theory of Computation

Theory Bridge Exam Example Questions Version of June 6, 2008

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

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

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

QUESTION BANK ADVANCED DATA STRUCTURES Class II B.Tech (CSE-A&B) II Sem Name of the Faculty- K. Nuka Raju

ITEC2620 Introduction to Data Structures

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

Formal Grammars and Abstract Machines. Sahar Al Seesi

3 rd Year - Computer Science and Engineering,

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

General Overview of Compiler

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

Context-Free Grammars

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

CMSC 330: Organization of Programming Languages. Architecture of Compilers, Interpreters

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

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

Introduction to Syntax Analysis

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Glynda, the good witch of the North

Regular Expressions. Lecture 10 Sections Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2016

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

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

CMSC 330: Organization of Programming Languages

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

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

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

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

An Interactive Approach to Formal Languages and Automata with JFLAP

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

CS143 Midterm Fall 2008

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

Chapter 14: Pushdown Automata

VALLIAMMAI ENGINEERING COLLEGE

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

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

Formal Languages and Automata

CMSC 330: Organization of Programming Languages. Context Free Grammars

CS103 Handout 16 Winter February 15, 2013 Problem Set 6

Introduction to Computers & Programming

Automata Theory CS S-FR Final Review

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

Introduction to Syntax Analysis. The Second Phase of Front-End

3. Syntax Analysis. Andrea Polini. Formal Languages and Compilers Master in Computer Science University of Camerino

CS375: Logic and Theory of Computing

Chapter Seven: Regular Expressions

CS 44 Exam #2 February 14, 2001

Languages and Compilers

Yet More CFLs; Turing Machines. CS154 Chris Pollett Mar 8, 2006.

Transcription:

Code No: R09220504 R09 SET-1 B.Tech II Year - II Semester Examinations, April-May, 2012 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks: 75 Answer any five questions All questions carry equal marks - - - 1.a) What is Automata? Discuss why study automata. b) Define DFA and Design the DFA for the following languages on Σ = {a, b} i) The set of all strings that either begins or ends or both with substring ab. ii) The set of all strings that ends with substring abb. [15] 2.a) Design an NFA that accepts the language (aa*(a+b)*). b) Consider the following NFA ε ε a b c p Φ {p} {q} {r} q {p} {q} {r} Φ r {q} {r} Φ {p} i) Compute the ε-closure of each state. ii) Give all the strings of length 3 or less accepted by the automation. iii) Convert the automation to DFA. [15] 3.a) Prove that every language defined by a Regular expression is also defined by Finite automata. b) State and prove pumping lemma for regular languages. Apply pumping lemma for following language and prove that it is not regular L={a n / n is prime}. c) If L 1 and L 2 are regular languages then prove that family of regular language is closed under L 1 -L 2. [15] 4.a) Define CFG. Obtain CFG for the following languages i) L={ R WW W is in (a,b)*, R W is the reversal of W} ii) L=(W W has a substring} b) What is an ambiguous grammar? Show that the following grammar is ambiguous E E+E E-E E*E E/E (E) a where E is the start symbol. Find the unambiguous grammar. [15] 5.a) Define PDA and construct a PDA that accepts the following languages L={W W is in (a+b)* and number of a s equal to number of b s} write the instantaneous description for the string aababb. b) For the following grammar construct a PDA S aabb aaa A abb a B bbb A C a. [15] 6.a) State and prove pumping lemma for context free languages. b) What are CNF and GNF for context free grammar? Give examples. c) Using CFL pumping lemma show that the following language is not context free L={a i b j c k i<j<k}. [15]

7.a) What is Turing Machine and Multi tape Turing Machine? Show that the language accepted by these machines are same. b) Design Turing Machine for the language to accept the set of strings with equal number of 0 s and 1 s and also give the instantaneous description for the input 110100. [15] 8. Write short notes on a) Homomorphism b) Recursive Languages c) Post s correspondence problem. [15] ********

Code No: R09220504 R09 SET-2 B.Tech II Year - II Semester Examinations, April-May, 2012 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks: 75 Answer any five questions All questions carry equal marks - - - 1.a) Define the following terms. i) Alphabets ii) Strings iii) Power of an alphabet iv) Language. b) Define DFA. Design a DFA to accept the binary numbers which are divisible by 5. [15] 2.a) Consider the transition table of DFA given below: 0 1 A B A B A C C D B D D A E D F F G E G F G H G D i) Draw the table of distinguish abilities of this automaton. ii) Construct the minimum state equivalent DFA. b) Design an NFA that accepts the language (0+1)*1(0+1)*. [15] 3.a) Define a regular expression. Find the regular expression for the Language L={a 2n b 2m n 0, m 0}. b) State pumping lemma for regular languages. Prove that the following language {a n b n n 1} is not regular. c) Convert the regular expression (01+1)* to an NFA ε. [15] 4.a) Define Context free grammar and write context free grammar for the languages i) L={a i b j c k i+j=k,i 0,j 0} ii) L={a n b m c k n+2m=k}. b) Consider the Grammar E +EE *EE -EE x y. Find the leftmost and rightmost derivation for the string +*-xyxy and write parse tree. c) What is ambiguous grammar? Prove that the following grammar is ambiguous on the string aab S as asbs ε. [15] 5.a) Define PDA. Discuss about the languages accepted by a PDA. Design a Non Deterministic PDA for the language L={0 n 1 n n 1}. b) Convert the following grammar to a PDA that accepts the same language by empty stack. S 0S1 A A 1A0 S ε [15]

6.a) What are useless Symbols? Remove all useless Symbols and all ε productions from the grammar S aa ab A aaa B ε B b bb D B b) Define CNF. Convert the following CFG to CNF S ASB ε A aas a B SbS A bb. [15] 7.a) With a neat diagram, explain the working of a basic Turing Machine. Design a Turing Machine to accept L={1 n 2 n 3 n n 1} b) Explain the differences between PDA and T M. [15] 8. Write short notes on a) Multi tape Turing Machine b) Post s correspondence problem c) Chomsky hierarchy. [15] ********

Code No: R09220504 R09 SET-3 B.Tech II Year - II Semester Examinations, April-May, 2012 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks: 75 Answer any five questions All questions carry equal marks - - - 1.a) Define the following i) Power of an alphabet ii) NFA b) Design a DFA to accept the following language over the alphabet {0,1} i) L={w / w is an even number} ii) L={(01) i 1 2j / i 1, j 1} iii) The set of strings either start with 01 or end with 01. [15] 2.a) Define distinguishable and indistinguishable states. Minimize the following DFA. 0 1 A B F B G C C A C D C G E H F F C G G G E H G C b) Explain in detail with an example the conversion of NDFA to DFA. [15] 3.a) Write the regular expressions for the following languages i) The set of all strings over Σ={a,b,c} containing atleast one a and atleast one b ii) The set of strings of 0 s and 1 s whose 10 th symbol from the right end is 1. b) Convert the regular expression (0+1)*1(0+1)* to an NFA ε. c) State and prove the pumping lemma for regular languages. [15] 4.a) Define CFG. Write CFG for the language L={0 n 1 n n 1} i.e. the set of all strings of one or more 0 s followed by an equal number of 1 s. b) Consider the grammar S as/asbs/ε Is the above grammar ambiguous? Show in particular that the string aab has no: i) Parse tree ii) Leftmost derivation iii) Rightmost derivation. [15] 5.a) Discuss the languages accepted by a PDA. Design a PDA for the language that accepts the strings with number of a s less than number of b s where w is in (a+b)* and show the instantaneous description of the PDA on input abbab. b) Convert the following grammar to a PDA that accepts the same language by empty stack S 0S1 A A 1A0 S ε [15]

6.a) What are useless symbols? Eliminate Null, unit and useless production from the following grammar S AaA CA BaB A aaba CDA aa DC B bb bab bb as C Ca bc D D bd ε b. What is CNF and GNF? Obtain the following grammar in CNF S aba abba A ab AA B ab a [15] 7.a) Explain with neat diagram, the working of a Turing Machine model. b) Design a Turing machine to accept all set of palindromes over {0,1}*. Also write its transition diagram all Instantaneous description on the string 10101. [15] 8. Write short notes on the following a) post s Correspondence problem b) Recursive languages c) Universal Turing Machine. [15] ********

Code No: R09220504 R09 SET-4 B.Tech II Year - II Semester Examinations, April-May, 2012 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science and Engineering) Time: 3 hours Max. Marks: 75 Answer any five questions All questions carry equal marks - - - 1.a) Define the following terms with an example for each i) Transition Table ii) Transition Diagram iii) Power set iv) Language. b) Mention the differences between DFA, NFA and NFA ε. [15] 2.a) Prove the equivalence of NFA and DFA. b) Define Moore and Mealy machines with examples. [15] 3.a) Define a regular expression. Find regular expression for the following languages on {a,b} i) Language of all strings w such that w contains exactly one 1 and even number of 0 s. ii) Set of strings over {0,1,2} containing atleast one 0 and atleast one 1. b) Prove that if L is regular language over alphabet Σ then L is also regular language. c) Prove that the language L={0 n 1 n+1 n>0} is not regular. [15] 4.a) Construct the CFG for the following languages i) L={a 2n b m n 0,m 0} ii) L={0 i 1 j 2 k i=j or j=k} and generate leftmost derivation for the string 01122. b) Define ambiguous Grammar. Prove that the following grammar is Ambiguous. Find an unambiguous grammar. S as asbs ε [15] 5.a) Define PDA and Design PDA to accepts the following languages by final state L={W W is in (a+b)* and number of a s equal to number of b s}. Draw the graphical representation of PDA. Also show the moves made by the PDA for the string abbaba. b) Convert the following CFG to PDA S aabb aaa A abb a B bbb A C a [15] 6.a) Consider the grammar S ABC BaB A aa BaC aaa B bbb a D C CA AC d ε i) Eliminate NULL productions ii) Eliminate Unit Productions in the resulting grammar iii) Eliminate Useless Symbols in the resulting grammar. b) What is CNF? Convert the following grammar into CNF S ABa A aab B Ac [15]

7.a) With a neat diagram, explain the working of a basic Turing Machine. Design a Turing Machine to accept L={WW R W is in (a+b)*} b) Explain the general structure of multi-tape and deterministic Turing Machines and show that these are equivalent to basic Turing machine. [15] 8. Write short notes on a) Post Correspondence problem b) Chomsky hierarchy c) Homomorphism. [15] ********