Professional Documents
Culture Documents
UNIT-I
Finite Automata
Sem. : ODD
Subject Code
: CS6503
Branch
: CSE
Subject Name
: Theory of Computation
Year/Sem.
: III/V
PART-A
1. Any set A, B and C if AnB= and C B then AnC=. Prove by contra positive.
(Apr/May 2015)
2. Prove for every n>=1 by mathematical induction. (Apr/May 2015)
30. Construct a finite automaton for the regular expression 0*1* (May/June 2014)
31. Mention the closure properties of regular languages. (May/June 2014)
PART-B
1. Prove that for every integer n0 the number 42n+1 and 3n+2 is a multiple of 13.
(Nov/Dec 2014)
2. Let L be a set accepted by a NFA and then prove that there exists a DFA that
accepts L. (Nov/Dec 2014)
3. Construct a DFA equivalent to the NFA M=({a, b, c, d} ,{0,1}, , a,{b. d} ) where
is defined as(Nov/Dec2014)
0
1
a
{b, d}
{b}
b
C
{b, c}
c
d
a
d
a
4.
5.
6.
7.
20. Construct a DFA that accepts all strings on {0,1} except those containing the
substring 101.(April/May 2014)
21. Prove that if L is accepted by an NFA with - transitions then L is accepted by
an NFA without transitions.(Nov/Dec 2012)
22. Prove that if n is positive integer such that n mod 4 is 2 or 3 then n is not a
perfect square.(Nov/Dec 2012)
23. Discuss on the relation between DFA and minimal DFA. (Apr/May 2013)
24. Write a note on NFA and compare with DFA.(Apr/May 2013)
25. Convert the following NFA to DFA(Apr/May 2013)
26. Construct DFA to accept the language L={w| w is of even length and begins
with 11} ( Apr/May 2013)
27. Construct a DFA that accept the following language.
{x {a,b}|x|a = odd and |x|b =even. (Nov/Dec 2012)
28. Construct a non deterministic finite automaton for accepting the set of strings
over {a,b} ending in aba. Use it to construct a DFA accepting the same set of
strings. (Apr/May 2014)
29. Construct a NFA with moves which accepts a language consisting the strings
of any number of as, followed by any number of bs, followed by any number of
cs. (Apr/May 2014)
30. Explain the steps in conversion of NFA to DFA. Convert the following NFA to
DFA. (Nov/Dec 2013)
35. Give Deterministic finite automata accepting the following language over the
alphabet. (Nov/Dec 2013)
(1) Number of 1s is a multiples of 3
(2) Number of 1s is not a multiples of 3
36. Obtain minimized finite automaton for the regular expression (b/a)*baa.
(May/June 2012)
37. Prove that there exists an NFA with -transitions that accepts the regular
expression r. (May/June 2012)
38. Which of the following languages is regular? Justify.(May/June 2012)
L={anbm/n,m 1}
L={anbn/n1}
39. Obtain the regular expression for the finite automata.(May/June 2012)
40. Using pumping lemma for the regular sets, prove that the language
L={ambn|m>n} (Nov/Dec 2012)
41. Prove any two closure properties of regular languages. (Nov/Dec 2012)
42. Construct a minimized DFA that can be derived from the following
Year : 2014-15
UNIT-II
Grammars
Sem. : ODD
Subject Code
: CS6503
Branch
: CSE
Subject Name
: Theory of Computation
Year/Sem.
: III/V
PART-A
1. Give the general forms of CNF.(Nov/Dec 2014)
2. Show that CFLs are closed under substitutions. (Nov/Dec 2014)
3. Let G be the grammar S->aB/bA A->a/aS/bAA B->b/bS/aBB. For the string
aaabbabbba, find (a) LMD and (b) RMD (Nov/Dec 2014)
4. Generate CFG for (011+1)* (May/June 2015)
5. Construct a parse tree of (a+b)*c
for the grammar E->E+E/E*E/(E)/id
(May/June 2015)
PART-B
1. Given the CFG G, find CGF G in CNF generating the language.L(G)-{^)
s-> AACD, A-> aAb|^, C->aC|a, D-> aDa|bDb|^. (May/June 2015)
2. If G is the grammar S->SbS/a show that G is ambiguous. (May/June 2014)
3. Write a grammar G to recognize all prefix expressions involving all binary
arithmetic operators. Construct a parse tree for the sentence -*+abc/de using G?
(Nov/Dec2014)
4. Show that the following grammar G is ambiguous S->SbS/a. (Nov/Dec 2014)
5. Construct a context free grammar for {0m1n/1mn} (Nov/Dec 2014)
6. Find a grammar G in CNF form equivalent to G
S->aAD, A->aB/bAB, B->b, D->d. (Nov/Dec 2014)
7. Convert the grammar S->0S1/A;A->1A0/S/ into PDA that accepts the same
language by empty stack .Check whether 0101 belongs to N(M). (May/June 2014)
8. Convert to GNF the grammar G, G=({A1,A2,A3},{ab},P,A1} where P consists of the
following A1->A2A3 , A2->A3A1/b, A3->A1A2/a. (Nov/Dec 2014)
9. Explain about Parse trees. For the following grammar (May/June 2013)
S->aB/bA
A->a/aS/bAA
B->b/bS/aBB For the String aaabbabbba ,Find
(1)Leftmost derivation
(2)Rightmost derivation
(3)Parse tree
10. Convert the following grammar into GNF
S->XY1/0
X->00X/Y
Y->1X1
(Nov/Dec 2013)
11. Show that the following grammars are ambiguous.
{S->aSbS/bSaS/} and
{S->AB/aaB,A->a/Aa,B->b} (Nov/Dec 2013)
12. Consider the following grammar for list structures.
S->a// (T) T->T, S/S.
Find left most derivation, rightmost derivation and parse tree for (((a,a),(a)),a)
(Nov/Dec 2012)
13. Is the grammar E->E+E/E*E/id is ambiguous? Justify your answer.
(May/June 2012)
14. Find the context free languages for the following grammars.
(1)S->aSbS/bSaS/
(2) S->aSb/ab (May/June 2012)
15.
Convert the grammar S->aSb/A,A->bSa/S/ to a PDA that accepts the same
language by empty stack.(10)Nov/Dec 2011
16.
If S->aSb/aAb, A->bAa, A->ba is the context free grammar. Determine the
context free language.(6)Nov/Dec 2011
17.
Let G be the grammar S->aB/bA, A->a/aS/bAA, B->b/bS/aBB.
For the string baaabbabba Find leftmost derivation, rightmost derivation and
parse tree. (Nov/Dec 2010)
18.
Consider the grammar
S->iCtS, S->iCtSeS, S->a, C-> b
Where i, t and e stand for if, then, and else, and C and S for conditional and
statement respectively
Remove ambiguity if any and prove that both the grammar produces
the same language. (Apr/May 2010)
19. Construct the CFG for the following languages:
(1)L(G)={ambn/mn,n>0} and
(2)L(G)={anban/n1}
(3)Define Ambiguity, Leftmost derivation and with Rightmost derivation
an example. (May/June 2009)
20. Simplify the following grammar and find its equivalent in CNF. (Nov/Dec 2008)
S->AB/CA
B->BC/AB
A->a
C->aB/b (Nov/Dec 2008)
21. Find the GNF equivalent of the grammar S->AA/0,A->SS/1. (Nov/Dec 2008)
22. Construct a CFG accepting L={ambn/n<m} and construct a PDA accepting L by
empty store. (Apr/May 2008)
23. Convert the grammar with productions into CNF
A->bAB/, B->Baa/.
(Apr/May 2008)
24. Define Chomsky normal form. Find an equivalent grammar in CNF for the grammar G
= ({S, A, B}, {a, b}, P, S) with productions S->bA|aB; A->bAA|aS|a; B->aBB|bS|b. (MAY2014, NOV/DEC-2006)
25. Show that the language L= {aibici|i>=1} is not context free. (MAY-2014, MAY -2007)
26. Construct the following grammar in CNF: A->BCD|b; B->Yc|d; C->gA|c; D->dB|a; Y>f. (MAY -2013)
27. Explain about the closure properties of CFL. (MAY-2013, MAY-2012, DEC-2011, NOV2010)
28. Explain in detail about Pumping Lemma for CFL. (MAY/JUNE-2013, NOV/DEC-2012)
29. Convert the following grammar into CNF: S->cBA; S->A; A->cB; A->AbbS; B->aaa.
(NOV/DEC-2012)
30. Find Greibach normal form for the grammar: S->AA| ; A->SS| . (MAY/JUNE-2012)
31. State the pumping lemma for CFLs. What is its main application? Give two examples.
(NOV-2011)
32. Prove that every grammar with
productions can be converted to an equivalent
grammar without productions. (MAY/JUNE-2011)
33. Reduce the following grammar to CNF: S->a|AAB; A->ab|aB| ; B->aba| . (MAY/JUNE-
2011)
34. Convert the following to Greibach normal form: S->a|AB; A->ab|BC; B->b; C->b.
(MAY/JUNE-2011)
35. Obtain a GNF grammar equivalent to the context free grammar: S->AA|0; A->SS|1.
(NOV/DEC-2010)
36. Define Pumping Lemma for CFL. Show that L = {aibjck; i<j<k} is not context free.
(MAY/JUNE-2010)
37. Convert the following grammar into an equivalent one with no unit productions and no
useless symbols. Convert to Chomsky normal form (CNF): S->A|CB; A->C|D; B->1B|1; C>0C|0; D->2D|2. (MAY-2010)
38. Convert the grammar S->AB|aB; A->aab| ; B->bbA into CNF. (MAY/JUNE-2009)
39. Prove that the set of CFL is closed under union and kleen closure. (MAY/JUNE-2009)
40. Simplify the following grammar and find its equivalent in CNF: S->AB|CA; B->BC|AB;
A->a; C->aB|b. (NOV/DEC-2008, NOV/DEC-2007)
41. Find the GNF equivalent for the grammar: S->AA|0; A->SS|1. (NOV-2008, NOV-2007
NOV-2006)
42. Show that the context free languages are closed under union operation but not under
intersection. (NOV-2007)
43. Find a grammar in Chomsky normal form equivalent to S->aAbB; A->aA|a; B->bB|b.
(MAY-2007)
44. Convert the grammar S->AB; A->BS|b; B->SA|a into Greibach normal form.
(MAY/JUNE-2007)
UNIT-III
Push Down Automata
Year : 2014-15
Sem. : ODD
Subject Code
: CS6503
Branch
: CSE
Subject Name
: Theory of Computation
Year/Sem.
: III/V
PART-A
1. Define push down automata.
2. Differentiate PDA acceptance by empty stack method with acceptance by final
state method. (May/June 2015)
3. Compare NFA and PDA. (Nov/Dec 2013)
4. What are the different types of language accepted by a PDA and define
them?Nov/Dec 2012
5. State the definition for pushdown automata. (Apr/May 2010)
6. Construct a PDA to accept the language {(ab) n] n1} by empty
stack.(Nov/Dec2009)
7. For a PDA M=
, define the language accepted by final state.
(Nov/Dec 2009)
8. Define instantaneous description of push down automata. (May/June 2009)
9. What is meant by empty production removal in PDA? (Apr/May 2008)
10. Define the language recognized by the push down automata using empty stack.
(Nov/Dec 2007)
11. Define the languages generated by a PDA using the two methods of accepting a
language. (May/June 2007)
12. Define the languages generated by a PDA using final state of the PDA and
empty stack of that PDA. (Nov/Dec 2006)
13. State the definition of Push down Automata.
14. What are the different types of languages accepted by a pushdown automaton
and define them?
15. Give an example of PDA.
16. Define acceptance of a PDA by empty stack. Is it true that the language
accepted by a PDA empty stack or by that of final states is different languages?
17. What is the additional feature PDA has when compared with NFA? Is PDA
superior over NFA in the sense of language acceptance? Justify your answer.
18. Is it true that non-deterministic PDA is more powerful than that of
deterministic PDA? Justify your answer.
19. Is the language of DPDA and NPDA same?
20. Give the formal definition of a PDA.
PART-B
1. Construct a PDA for the given grammar S->aSa/bSb/c. (May/June 2015)
2. Construct a PDA for the language L={x {a,b}* |na (x)>nb(x)} (May/June 2015)
3. If L is context free language prove that there exists a PDA M, such that L=N(M)
(Nov/Dec 2014)
4. Prove that if L is N(M1)( the language accepted by empty stack) for some PDA
M1, then L is N(M2) (the language accepted by final state) for some PDA M2.
(Nov/Dec 2014)
5. Construct pushdown automata to accept the language L= {anbn/n1} by stack
and by final state. (May/June 2014)
6. Construct a CFG for the PDA M. (May/June 2014)
7. Convert the grammar S->0S1/A; A->1A0/S/ into PDA that accepts the same
language by empty stack. Check whether 0101 belongs to N(M).(May/June 2014)
8. Construct PDA for the language L= (wwR /W in (a+b)*). (8) May/June 2013
9. Explain in detail about equivalence of pushdown automata and CFG.
(May/June 2013)
10. Give formal pushdown automata that accepts {wcw R /w in (0+1)*} by empty
stack. (Nov/Dec 2013)
11. Prove the equivalence of PDA and CFL. (Nov/Dec 2013)
12. Construct a transition table for PDA which accepts the language L= {a2nbn/n
1}.Trace your PDA for the input with n=3. (Nov/Dec 2012)
13. Find the PDA equivalent to the given CFG with the following productions.
14. S->A, A->BC, B->ba,C->ac. (Nov/Dec 2012)
15. Construct the PDA accepting the language {(ab) n/n1} by empty stack.
(Nov/Dec 2012)
16. Construct the PDA for L={WWR/w is in (a+b)*} (May/June 2012)
17. Discuss the equivalence between PDA and CFG. (May/June 2012)
18. Is NPDA (Nondeterministic PDA) and DPDA (Deterministic PDA) equivalent?
Illustrate with an example.(Nov/Dec 2011)
19. What are the different types of language accepted by a PDA and define them. Is
it true that the language accepted by a PDA by these different types provides
different languages? (Nov/Dec 2011)
20. Convert the grammar S->aSb/A, A->bSa/S/ to a PDA that accepts the same
language by empty stack. (Nov/Dec 2011)
21. What is deterministic PDA? Explain with an example.(Nov/Dec 2010)
22. Construct the PDA for the language L={wcw R / w is in (0+1)*} )(Nov/Dec 2010)
23. Let L is context free language. Prove that there exists a PDA that accepts L.
(Nov/Dec 2010)
24. Construct a PDA equivalent to the following grammar.
25. S->aAA A->aS/bS/a. (Nov/Dec 2009)
26. Prove that every language recognized by a PDA is Context free.(Nov/Dec 2009)
27. Construct a PDA for the set of palindrome over the alphabet {a,b}. (Nov/Dec
2009)
28. Construct a Push Down Automata that will accept the language generated by
the grammar G=({S,A}.{a,b},S,P) with the productions S->AA/a,A->SA/b.
(May/June 2009)
29. Construct an NPDA that accept the language generated by the grammar
30. S->aSbb/abb. (May/June 2009)
31. Design a PDA for recognizing the language {ambncm,n,m 1} using empty stack.
32. Construct an unrestricted PDA equivalent to the grammar given below:
33. S->aAA, A->aS/bS/a.
34. Construct a PDA for the language {anb2n/n 0}. (Nov/Dec 2008)
35. Constrcut PDA for the grammar
36. S->aB/bA
A->a/aS/bAA
B-b/bS/aBB
Year : 2015-16
UNIT-IV
Turing Machines
Sem. : ODD
Subject Code
: CS6503
Branch
: CSE
Subject Name
: Theory of Computation
Year/Sem.
: III/V
PART-A
PART-B
18. Construct a Turing Machine to move an input string over the alphabet A = {a} to the
right one cell. Assume that the tape head starts somewhere on a blank cell to the left of
the input string. All other cells are blank, labeled by ^. The machine must move the entire
string to the right one cell, leaving all remaining cells blank. (MAY/JUNE-2010)
19. Design a Turing Machine to recognize each of the following languages. (NOV/DEC2009)
1. {0n1n|n>=1}
2. {wwR|w (0+1)*}
20. Prove that the TM with one-way infinite tape and two-way infinite tape are equivalent.
(NOV/DEC-2009)
21. Design a Turing Machine to compute n2. (NOV/DEC-2009)
22. Construct a Turing Machine M for a language L={a nbn|n>=1}. (MAY/JUNE-2009)
23. Design a deterministic Turing Machine to accept the language: L= {a ibici|i>=0}.
(MAY/JUNE-2008)
24. Design a Turing Machine that computes x + y where x and y are positive integers.
(MAY/JUNE-2007)
25. Design a Turing Machine M for f(x,y,z)=2(x+y)-z, z<2(x+y) and x,y,z are stored in the
tape in the form 0x10y10z1. (NOV/DEC-2006)
26. Show that if L is accepted by a multi tape Turing Machine, it is accepted by single
tape Turing Machine also. (NOV/DEC-2006)
UNIT-V
Unsolvable Problems and Computable
Functions
Year : 2015-16
Sem. : ODD
Subject Code
: CS6503
Branch
: CSE
Subject Name
: Theory of Computation
Year/Sem.
: III/V
PART-A
29. Mention any two undecidability properties for recursively enumerable languages.
(MAY/JUNE-2007)
30. Show that the following problem is undecidable. Given two CFGs G1 and G2, is
L (G1) L(G2) =
? (NOV/DEC-2006)
PART-B
1. Show that the union of two recursive language is recursive and union of two recursively
enumerable languages is recursive. (Nov/Dec 2014)
2. Define the language Lu and show that Lu is RE language. (Nov/Dec 2014)
3. State and prove Post Correspondence Problem and Give example. (Nov/Dec 2014)
4. Explain post-correspondence problems and decidable and undecidable problems with
examples. (May/June 2015)
5. Explain the class P and NP problems with suitable examples. (May/June 2015)
6. Define diagonalization language. S.T the language Ld is not a recursively enumerable
language. (MAY-14)
7. Prove that the universal language is recursively enumerable. (MAY-2014)
8. Define Post Correspondence problem. Let
List A List B
wi
xi
1
111
10111
10
10
0
(MAY-2014, MAY/JUNE-2007)
10. Prove that for two recursive languages L1 and L2 their union and intersection is
recursive. (NOV/DEC-2013, NOV/DEC-2012)
11. Prove that if a language is recursive if and only if it and its complement are both
recursively enumerable. (NOV/DEC-2013)
12. Explain about undecidability of PCP. (NOV/DEC-2013)
13. Explain about A language that is not Recursively Enumerable. (MAY/JUNE-2013)
14. Prove Lne is recursively enumerable. (MAY/JUNE-2013)
15. Discuss on undecidable problems about Turing Machine.
(MAY/JUNE-2013,
MAY/JUNE-2012)
16. Explain about the PCP. (MAY/JUNE-2013, NOV/DEC-2012, NOV/DEC-2010)
17. Explain undecidability with respect to Post Correspondence problem.
(MAY/JUNE-
2012)
18. Discuss the properties of recursive languages. (MAY/JUNE-2012)
19. Discuss the difference between NP-complete and NP-hard problems. (MAY/JUNE2012)
20. Let
= {a, b}*. Let A and B be lists of three strings as given below: A={b, bab 3, ba}; B=
{b3, ba, a}. Does this instance of PCP have a solution? Justify your answer. (NOV/DEC2011, MAY/JUNE-2007)
21. Write short notes on: (NOV/DEC-2011)
i. Recursive and recursively enumerable languages.
ii. NP hard and NP complete problems.
22. Prove that the universal language Lu is recursively enumerable but not recursive. Also
prove that Ld is not recursive or recursively enumerable.(MAY/JUNE-2011, NOV/DEC2009)
23. Prove that PCP problem is undecidable and explain with an example. (MAY/JUNE2011)
24. Explain the difference between tractable and intractable problems with examples.
(NOV/DEC-2010)
25. Explain any four NP-Complete problems. (8) (NOV/DEC-2010)
26. Consider the language of all TMs that given no input eventually write a nonblank
symbol on their tapes. Explain why this set is decidable. Why does this not conflict with
the halting problem? (8) (MAY-2010)
27. Prove that the Post Correspondence Problem is decidable for strings over the alphabet
(0). (8) (MAY/JUNE-2010)
28. Prove that the problem of determining if the languages generated by two CFGs are
equal is undecidable. (8) (MAY/JUNE-2010)
Prepared By
Verified By
Dr.U.V.Arivazhagu,
Professor and HOD/CSE.