cs1303 theory of computation question alone

9
THEORY OF COMPUTATION A.R ENGINEERING COLLEGE, VILLUPURAM DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB.CODE : CS2402 YEAR/SEM : IV/VII SUB.NAME : THEORY OF COMPUTATION ACADEMIC YEAR : 2012-2013 UNIT I AUTOMATA PART-A 1. What is deductive proof? 2. Give the examples/applications designed as finite state system. 3. Define: (i) Finite Automaton(FA) (ii)Transition diagram 4. What are the applications of automata theory? 5. Define proof by contrapositive. 6. What are the components of Finite automaton model? 7. Differentiate NFA and DFA 8. What is Є-closure of a state q0? 9. What is a : (a) String (b) Regular language 10. Define Induction principle. PART-B 1.a)If L is accepted by an NFA with ε- transition then show that L is accepted by an NFA without ε- transition. b)Construct a DFA equivalent to the NFA. M=({p,q,r},{0,1}, δ,p,{q,s}) A.R ENGINEERING COLLEGE,VILLUPURAM Page 1

Upload: sridharanchandran

Post on 24-Oct-2014

56 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

A.R ENGINEERING COLLEGE, VILLUPURAM DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

SUB.CODE : CS2402 YEAR/SEM : IV/VIISUB.NAME : THEORY OF COMPUTATION ACADEMIC YEAR : 2012-2013

UNIT I

AUTOMATA

PART-A

1. What is deductive proof?2. Give the examples/applications designed as finite state system.3. Define: (i) Finite Automaton(FA) (ii)Transition diagram4. What are the applications of automata theory?5. Define proof by contrapositive.6. What are the components of Finite automaton model? 7. Differentiate NFA and DFA8. What is Є-closure of a state q0?9. What is a : (a) String (b) Regular language10. Define Induction principle.

PART-B

1.a)If L is accepted by an NFA with ε-transition then show that L isaccepted by an NFA without ε-transition.

b)Construct a DFA equivalent to the NFA.M=({p,q,r},{0,1}, δ,p,{q,s})Where δ is defined in the following table.

δ 0 1p {q,s} {q}q {r} {q,r}r {s} {p}s - {p}

2. a)Show that the set L={an bn/n>=1} is not a regular.

b)Construct a DFA equivalent to the NFA given below:

A.R ENGINEERING COLLEGE,VILLUPURAM Page 1

Page 2: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

0 1p {p,q} Pq r Rr s -s s S

3.a)Check whether the language L=(0n 1n /n>=1) is regular or not?Justify your answer.

b)Let L be a set accepted by a NFA then show that there exists aDFA that accepts L.

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.

5.a)Construct a NDFA accepting all string in {a,b}+ with either two consecutive a’s or two consecutive b’s.

b)Give the DFA accepting the following language:set of all strings beginning with a 1 that when interpreted as a binary integer is a multiple of 5.

UNIT II

REGULAR EXPRESSIONS AND LANGUAGES

PART-A

1.What is a regular expression?

2. Differentiate L* and L+

3.What is Arden’s Theorem?4.Write a r.e to denote a language L which accepts all the strings which begin or end with either 00 or 11.5.Construct a r.e for the language which accepts all strings with atleast two c’s over the set Σ={c,b}6.Construct a r.e for the language over the set Σ={a,b} in which total number of a’s are divisible by 3

7.what is: (i) (0+1)* (ii)(01)* (iii)(0+1) (iv)(0+1)+

8.Reg exp denoting a language over Σ ={1} having(i)even length of string (ii)odd length of a string9.Reg exp for: (i)All strings over {0,1} with the substring ‘0101’ (ii)All strings beginning with ’11 ‘ and ending with ‘ab’ (iii)Set of all strings over {a,b}with 3 consecutive b’s. (iv)Set of all strings that end with ‘1’and has no substring ‘00’10. What are the applications of Regular expressions and Finite automata

A.R ENGINEERING COLLEGE,VILLUPURAM Page 2

Page 3: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

11.Reg exp for the language that accepts all strings in which ‘a’ appears tripled over the set Σ ={a}

12.What are the applications of pumping lemma?13. What is the closure property of regular sets?14.Reg exp for the language such that every string will have atleast one ‘a’ followed by atleast one ‘b’.15.Write the exp for the language starting with and has no consecutive b’s16.What is the relationship between FA and regular expression.

PART-B

1.a)Show that every set accepted by a DFA is denoted by

regular Expression (8)

b)Construct an NFA equivalent to the following regular expression

01*+1. (8)

2.a)Define a Regular set using pumping lemma Show that the language

L={0i2 / i is an integer,i>=1} is not regular (8)

b)Construct an NFA equivalent to the regular expression

10+(0+11)0*1 (8)

3.a) Show that the set L={On2/n is an integer,n>=1} is not regular. (6)

b)Construct an NFA equivalent to the following regular expression

((10)+(0+1)* 01. (10)

4.a)Prove that if L=L(A) for some DFA A,then there is a regular expression

R such that L=L(R). (10)

b) Show that the language {0p,p is prime} is not regular. (6)

5.Find whether the following languages are regular or not.

(i) L={w {a,b}|w=wε R}. (4)

(ii) L={0n 1m 2n+m,n,m>=1} (4)

A.R ENGINEERING COLLEGE,VILLUPURAM Page 3

Page 4: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

(iii) L={1k|k=n2,n>=1} . (4)

UNIT III

CONTEXT FREE GRAMMAR AND LANGUAGES

PART-A

1. What are the applications of Context free languages?2. What are the uses of Context free grammars? 3.Define a context free grammar4.What is the language generated by CFG or G?5.What is : (a) CFL (b) Sentential form6. What is the language generated by the grammar G=(V,T,P,S) whereP={S->aSb, S->ab}?7. What is :(a) derivation (b)derivation/parse tree (c) subtree8. If S->aSb | aAb , A->bAa , A->ba .Find out the CFL9. What is a ambiguous grammar?10.Consider the grammarP={S->aS | aSbS | Є } is ambiguous by constructing: (a) two parse trees (b) two leftmost derivation (c) rightmost derivation11. Find CFG with no useless symbols equivalent to : S→AB | CA , B→BC | AB, A→a , C→aB | b. 12. Construct CFG without Є production from : S →a | Ab | aBa , A →b | Є , B →b | A. 13. What are the three ways to simplify a context free grammar?14. What are the properties of the CFL generated by a CFG?

15. Find the grammar for the language L={a2n

bc ,where n>1 }16.Find the language generated by :S->0S1 | 0A | 0 |1B | 1A->0A | 0 , B->1B | 1

17.Construct the grammar for the language L={ an

b an

| n>=1}.18. Construct a grammar for the language L which has all the strings which are all palindrome over Σ={a, b}.19. Differentiate sentences Vs sentential forms20. What is a formal language?21.What is Backus-Naur Form(BNF)?22. Let G= ( {S,C} ,{a,b},P,S) where P consists of S->aCa , C->aCa |b. Find L(G).23.Find L(G) where G= ( {S} ,{0,1}, {S->0S1 ,S->Є },S ) 24.What is a parser?25.Define Pushdown Automata.26.Compare NFA and PDA.27.Specify the two types of moves in PDA.28.What are the different types of language acceptances by a PDA and define them. 29.Is it true that the language accepted by a PDA by empty stack and final states are different languages.

A.R ENGINEERING COLLEGE,VILLUPURAM Page 4

Page 5: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

30. Define Deterministic PDA.31.Define Instantaneous description(ID) in PDA.32.What is the significance of PDA?33.When is a string accepted by a PDA?34. Give examples of languages handled by PDA. 35.Is NPDA (Nondeterministic PDA) and DPDA (Deterministic PDA)equivalent? 36. State the equivalence of acceptance by final state and empty stack.

PART-B1. Conversion of CFL in GNF.

2. Design a PDA that accepts the language {wwR

| w in (0+1)*}.3. Prove that if L is L(M2) for some PDA M2,then L is N(M1) for some PDA M1.4.If L is a context-free language, then prove that there exists a PDA M such that

L=N(M).5.Conversion of PDA into CFL.

UNIT IV

PROPERTIES OF CONTEXT FREE LANGUAGES

PART-A1. State the equivalence of PDA and CFL.2. What are the closure properties of CFL?3. State the pumping lemma for CFLs.4. What is the main application of pumping lemma in CFLs?5. Give an example of Deterministic CFL.6. What are the properties of CFL? 7. Compare NPDA and DPDA.8. What are the components of PDA ?9. What is the informal definition of PDA?10. Give an example of NonDeterministic CFL11.What is a turing machine?12.What are the special features of TM?13. Define Turing machine.14.Define Instantaneous description of TM.15. What are the applications of TM?16.What is the basic difference between 2-way FA and TM?17.Define a move in TM.18. What is the language accepted by TM?19. What are the various representation of TM?20. What are the possibilities of a TM when processing an input string? 21. What are the techniques for Turing machine construction?22. What is the storage in FC?23. What is a multihead TM?24.What is a 2-way infinite tape TM?25.Differentiate PDA and TM.

A.R ENGINEERING COLLEGE,VILLUPURAM Page 5

Page 6: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

26. What is a multi-tape Turing machine?27.What is a multidimensional TM?

PART-B1.Explain the various techniques for Turing machine construction.

- storage in finite control- multiple tracks- checking off symbols- shifting over- subroutines.

2.Briefly explain the different types of Turing machines.- two way finite tape TM- multi tape TM- nondeterministic TM- multi dimensional TM- multihead TM

3. Design a TM to perform proper subtraction.

4. Design a TM to accept the language L={0n

1n

| n>=1} 5. Explain how a TM can be used to determine the given number is prime or not.

UNIT V

Undecidability

PART-A

1.When we say a problem is decidable? Give an example of undecidable problem?2.Give examples of decidable problems.3. Give examples of recursive languages?4. Differentiate recursive and recursively enumerable languages.5. What are UTMs or Universal Turing machines?6. What is the crucial assumptions for encoding a TM?7. What properties of recursive enumerable seta are not decidable?8. Define Lℓ .When is ℓ a trivial property?9. What is a universal language Lu?10.What is a Diagonalization language Ld?11. What properties of r.e sets are recursively enumerable?12. What properties of r.e sets are not r.e?13.What are the conditions for Lℓ to be r.e?14. What is canonical ordering?

A.R ENGINEERING COLLEGE,VILLUPURAM Page 6

Page 7: CS1303 Theory of Computation Question Alone

THEORY OF COMPUTATION

15. How can a TM acts as a generating device?16. What are the different types of grammars/languages?17. What is a PS or Unrestricted grammar?18. State a single tape TM started on blank tape scans any cell four or more times is decidable?19.Does the problem of “ Given a TM M ,does M make more than 50 moves on input B “?20. Show that AMBIGUITY problem is un-decidable.21.State the halting problem of TMs.22.Define PCP or Post Correspondence Problem.23.Define MPCP or Modified PCP.24 . What is the difference between PCP and MPCP?25. What are the concepts used in UTMs?26.What are(a) recursively enumerable languages (b) recursive sets?27. When a recursively enumerable language is said to be recursive ? Is it true that the language accepted by a non-deterministic Turing machine is different from recursively enumerable language?

PART-B1.Define Lu and prove that Lu is recursive enumerable.2. Define Ld and prove that Ld is undecidable.3.Prove that if a language L and its complement are both recursively enumerable, then L

is recursive.4.Prove that the halting problem is undecidable.

A.R ENGINEERING COLLEGE,VILLUPURAM Page 7