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

Similar documents

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

QUESTION BANK CS2303 THEORY OF COMPUTATION

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

Department of Computer Science and Engineering

JNTUWORLD. Code No: R

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

Multiple Choice Questions

UNIT I PART A PART B

CT32 COMPUTER NETWORKS DEC 2015

QUESTION BANK. Unit 1. Introduction to Finite Automata

Computer Sciences Department

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

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

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

Final Course Review. Reading: Chapters 1-9

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Actually talking about Turing machines this time

Theory of Computation, Homework 3 Sample Solution

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

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

VALLIAMMAI ENGINEERING COLLEGE

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

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

AUTOMATA THEORY AND COMPUTABILITY

CS 44 Exam #2 February 14, 2001

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

Decision Properties for Context-free Languages

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

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

Theory Bridge Exam Example Questions Version of June 6, 2008

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

Learn Smart and Grow with world

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

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

14.1 Encoding for different models of computation

Languages and Compilers

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

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

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

CpSc 421 Final Solutions

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

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

Context-Free Grammars

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

Theory of Computation

UNIT 1 SNS COLLEGE OF ENGINEERING

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

Ambiguous Grammars and Compactification

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

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

PART-A. 1. What is Object Oriented Analysis and Design?

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

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

CSE 105 THEORY OF COMPUTATION

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

Theory of Computations Spring 2016 Practice Final Exam Solutions

ECS 120 Lesson 16 Turing Machines, Pt. 2

Specialized Grammars. Overview. Linear Grammars. Linear Grammars and Normal Forms. Yet Another Way to Specify Regular Languages

Theory of Computations Spring 2016 Practice Final

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Recursively Enumerable Languages, Turing Machines, and Decidability

Theory of Programming Languages COMP360

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

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

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

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

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

Languages and Automata

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

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

Enumerations and Turing Machines

Decision Properties of RLs & Automaton Minimization

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

CSE 105 THEORY OF COMPUTATION

3 rd Year - Computer Science and Engineering,

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

Formal Languages and Automata

Outline. Language Hierarchy

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

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

LECTURE NOTES THEORY OF COMPUTATION

DEV BHOOMI INSTITUTE OF TECHNOLOGY DEHRADUN

CSE 105 THEORY OF COMPUTATION

Lecture 18: Turing Machines

Computability Summary

Models of Computation II: Grammars and Pushdown Automata

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

A Characterization of the Chomsky Hierarchy by String Turing Machines


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

Turing Machine Languages

CISC 4090 Theory of Computation

t!1; R 0! 1; R q HALT

Reflection in the Chomsky Hierarchy

CS21 Decidability and Tractability

Transcription:

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR-621113 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Third Year CSE( Sem:V) CS2303- THEORY OF COMPUTATION PART B-16 MARKS UNIT-I AUTOMATA 1.If L is accepted by an NFA with ε-transition then show that L is accepted by an NFA without ε-transition. 1.Write the NFA regular expression. 2. Prove the Relation. 2. Construct a DFA equivalent to the NFA. M=({p,q,r},{0,1}, δ,p,{q,s}) Where δis defined in the following table. δ 0 1 p {q,s} {q} q {r} {q,r} r {s} {p} s - {p} 2.Write the tuples of NFA. 3.Find the States. 4.Draw the equivalent DFA diagram 3. Show that the set L={a n b n /n>=1} is not a regular. (6) b)construct a DFA equivalent to the NFA given below: (10) 0 1 p {p,q} P q r R r s - s s S 2.Write the tuples of NFA. 3.Find the States.

4.Draw the equivalent DFA diagram 4.Check whether the language L=(0 n 1 n /n>=1) is regular or not? Justify your answer. 1.Assume the regular function. 2.Find the value of W. 3.Prove the Condition. 4.Apply the value k=0,1,2. 5.By the values of xy k z it is identified the function is regular or not. 4. Define NFA with ε-transition. Prove that if L is accepted by an NFA with ε- transition then L is also accepted by a NFA without ε-transition. NFA- ε theorem. 5. Construct DFA equivalent to the NFA given below: 2.Write the tuples of NFA. 3.Find the States. 4.Draw the equivalent DFA diagram 6. Prove that a language L is accepted by some ε NFA if and only if L is accepted by some DFA. NFA Language theorem. 7. Consider the following ε NFA.Compute the ε closure of each state and find it s equivalent DFA. ε A b C p {q} {p} Ф Ф q {r} ф {q} Ф *r Ф ф ф {r}

2.Write the tuples of NFA. 3.Find the Existing or new States 4.Draw the equivalent DFA diagram 8. Convert the following NFA to it s equivalent DFA 0 1 p {p,q} {p} q {r} {r} r {s} ф *s {s} {s} 2.Write the tuples of NFA. 3.Find the Existing or new States 4.Draw the equivalent DFA diagram UNIT-II REGULAR EXPRESSIONS AND LANGUAGES 1.Construct an NFA equivalent to (0+1)*(00+11) 1.Find the function for each value. 2.Identify the cases. 3.Draw the diagram based on the function. 2.Construct a Regular expression corresponding to the state diagram given in the following figure. 1.Find the Appropriate Cases for the Given function. 2.Eliminate the states one by one. 3.Write the final R value.

3. Show that the set E={0 i 1 i i>=1} is not Regular. 1.Assume the regular function. 2.Find the value of W. 3.Prove the Condition. 4.Apply the value k=0,1,2. 5.By the values of xy k z it is identified the function is regular or not. 4. Construct an NFA equivalent to the regular expression (0+1)*(00+11)(0+1)*. 1.Find the function for each value. 2.Identify the cases. 3.Draw the diagram based on the function. 5.Obtain the regular expression denoting the language accepted by the following DFA by using the formula Rij k 1.Write the General formula for the conversion of Finite automata to regular expression. 2. Find the value of i,j,k. 3.Find the value by applying k=0,1 4.Apply the values in the formul and find the final regular expression R. 6. Define a Regular set using pumping lemma Show that the language L={0i 2 / i is an integer,i>=1} is not regular 1.Assume the regular function. 2.Find the value of Wand states as n=2. 3.Prove the Condition. 4.Apply the value k=0,1,2. 5.By the values of xy k z it is identified the function is regular or not 7.Find whether the following languages are regular or not. (i) L={w ε{a,b} w=w R }. (ii) L={0 n 1 m 2 n+m,n,m>=1} (iii) L={1 k k=n 2,n>=1}. (4) (iv) L1/L2={x for some y εl2,xy εl1},where L1 and L2 are any two languages and

L1/L2 is the quotient of L1 and L2. 1.Assume the regular function. 2.Find the value of Wand states as n=2. 3.Prove the Condition. 4.Apply the value k=0,1,2. 5.By the values of xy k z it is identified the function is regular or not UNIT-III CONTEXT FREE GRAMMARS AND LANGUAGES 1. Let G be a CFG and let a=>w in G. Then show that there is a leftmost derivation of w. Theorem of CFG. 2. Let G be a grammar s->ob/1a, A->O/OS/1AA, B->1/1S/OBB. For the string 00110101 find its leftmost derivation and derivation tree. 1.Find the left most derivations. 2.Write the Right most derivations for the tree. 3.Construct the accurate derivation tree. 3. If G is the grammar S->Sbs/a, Show that G is ambiguous. 1.Find the left most derivations. 2.Write the Right most derivations for the tree. 3.Construct the accurate derivation tree. 4.Show that E->E+E/E*E/(E)/id is ambiguous. 1.Find the First left most derivations. 2.Find the Second left most derivations. 3.Construct Parse tree for the left most derivations and Right most derivations. 5.Construct a Context free grammar G which accepts N(M), where M=({q0, q1},{a,b},{z0,z},δ,q0,z0,φ) and where δ is given by δ(q0,b,z0)={(q0,zz0)} δ(q0, ε,z0)={(q0, ε)} δ(q0,b,z)={(q0,zz)} δ(q0,a,z)={(q1,z)} δ(q1,b,z)={(q1, ε)} δ(q1,a,z0)={(q0,z0)}

1. Construct a Context free grammar. 2. Apply the formula. 6. If L is Context free language then prove that there exists PDA M such that L=N(M). Context free language Theorem and its steps. 7. Construct a PDA accepting {a n b m a n /m,n>=1} by empty stack. Also construct the corresponding context-free grammar accepting the same set. 1.Write the Appropriate CFG. 2.Find the Values. 8. Find the left most and right most derivation corresponding to the tree. 1.Find the First left most derivations. 2.Find the Second left most derivations.

UNIT-IV PROPERTIES OF CONTEXTFREE LANGUAGES 1.Convert to Greibach Normal Form the grammar G=({A1, A2, A3},{a,b},P,A1 ) where P consists of the following. A1 ->A2 A3, A2 - >A3 A1 /b,a3 ->A1 A2 /a. 1. Write the grammar definition. 2. Find the form of a grammar. 3. Replace the variables. 4. Construct the GNF. 2.Convert the grammar S->AB, A->BS/b, B->SA/a into Greibach NormalForm 1. Write the grammar definition. 2. Find the form of a grammar. 3. Replace the variables. 4. Construct the GNF.. 3.Construct a equivalent grammar G in CNF for the grammar G1 where G1 =({S,A,B},{a,b},{S->bA/aB,A->bAA/aS/a, B->aBB/bS/b},S). 1. Write the grammar definition. 2. Find the form of a grammar. 3. Replace the variables. 4. Construct the GNF. 4.Begin with the grammar S->0A0/1B1/BBA->CB->S/AC->S/ ε and simplify using the safe order Eliminate ε-productions Eliminate unit production Eliminate useless symbols Put the (resultant) grammar in Chomsky Normal Form. 1. write down the start variable 2. find a rule and replace 3.find a rule and replace 4.find a rule and replace 5.find a rule and replace. 5.Explain the Construction of an equivalent grammar in CNF for thegrammar G=({S,A,B}{a,b},P,S) where P={S->bA ab, A->bAA as a, B->aBB bs b} (10) 1. write down the start variable 2. find a rule and replace 3.find a rule and replace 4.find a rule and replace 5.find a rule and replace.

UNIT-V UNDECIDABILITY 1.Define the language Ld and show that Ld is not recursively enumerable language. Recursively enumerable Languages M is said to generate a string w if and only if at some point M writes w# on the output tape. G(M) = {w M generates w} Note: M need not generate strings in order. It is also possible that M generates some strings many times! Definition: L is recursively enumerable (r.e.) iff there is a TM M such that L = G(M). 2.Explain the Halting problem. Is it decidable or undecidable problem. In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever. Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist. A key part of the proof was a mathematical definition of a computer and program, which became known as a Turing machine; the halting problem is undecidable over Turing machines. It is one of the first examples of a decision problem. 3.Define Universal language Lu.Show that Lu is recursively enumerable but not recursive. The Universal Language Lu is a set of binary strings which can be modeled by a turning machine. 4.Obtain the code for the TM M=({q1,q2,q3},{0,1},{0,1,B}, δ,q1,b,{q2}) With the moves δ(q1,1)=(q3,0,r) δ(q3,0)=(q1,1,r) δ(q3,1)=(q2,0,r) δ(q3,b)=(q3,1,l) δ(q3,b)=(q3,1,l) 1. Identify the mapping Function. 2. Note the codes for function. 3. The code for Tm can be written.

5. Define Ld and show that Ld is not recursively enumerable. Recursively enumerable Languages M is said to generate a string w if and only if at some point M writes w# on the output tape. G(M) = {w M generates w} Note: M need not generate strings in order. It is also possible that M generates some strings many times! Definition: L is recursively enumerable (r.e.) iff there is a TM M such that L = G(M). 6.Define the universal language and show that it is recursively enumerable but not recursive. A language is recursively enumerable if some Turing machine accepts it Let be a L recursively enumerable language and the Turing Machine that accepts it M w L w if then halts in a final state M if w L then M halts in a non-final state or loops forever. 7.State and Prove Rice s Theorem for recursive index sets. It is more complicated to find out whether L is or is not recursively enumerable (rec. enum.) Rice has a theorem: L is rec. enum. if and only if satisfies 3 conditions.