B.E./B.Tech. DEGREE MODEL EXAMINATION, SEPTEMBER.2015
Fifth Semester
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CS6503 – THEORY OF COMPUTATION
(Regulation 2013)
Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
1. Construct the regular expression for a*b*.
2. Construct a DFA that accepts
i)All strings that contain exactly four 0’s
ii)All string that do not contain 110 as substring.
3. What is an ambiguous grammar with example?
4. Write down the context free grammar for L={an
bn
;n>=1}.
5. Is it true that the language accepted by a PDA by empty stack and final states are different languages.
6. What are the different types of languages accepted by PDA and define them.
7. Define Instantaneous description of TM
8. Design TM that accept odd integers in binary.
9. What is recursively enumerable languages?
10. What is a Diagonalization language Ld?
PART B — (5 × 16 = 80 marks)
11. (a)(i)Construct a NFA for the string starts with11. (6)
(ii)State and prove the theorem for equivalence of €-NFA and without €-NFA. (10)
(OR)
(b)(i)Convert the following NFA to DFA. (10)
a b
p {p} {p,q}
q {r} {r}
* r {Ø} {Ø}
(ii) Which of the following languages is regular? (6)
1)L={an
bm
/n,m>=1} 2)L={an
bn
/n,m>=1}
12. (a)(i)Explain about parse trees for the following grammar (10)
S->aB/bA ; A->a/aS/bAA ; B->b/bS/aBB For the string aaabbabbba,Find
i)Left most derivation ii)Right most derivation iii)Parse tree
(ii)Construct the following grammar in CNF. (6)
A->BCD/b
B->Yc/d
C->gA/c
D->Db/a
Y->f
(OR)
(b)(i)Obtain a Greibach normal form grammar equivalent to the context free grammar (8)
S->AA/0 A->SS/1
(ii)Determine the CFL for the grammar i)S->aSbS /bSaS/€ ii)S->aSb/ab (8)
13. (a)(i)Construct PDA for the language L=(ab)n
/n>=1}by empty stack. (8)
(ii) Find the PDA equivalent to the CFG S->A,A->BC,B->ba,C->ac. (8)
(OR)
(b)(i)Construct a PDA accepting by empty stack the languages {ambmcn/m,n≥1}. (6)
(ii)Give the CFG generating the language accepted by the following PDA (10)
M==({q0,q1,},{0,1},{z0,x},δ,q0,z0,ε), With transitions
δ( q0,1,z0) = {( q0,xz0)} ,
δ( q0,1,x ) = {( q0,xx )},
δ( q0,0, x ) {( q1,x)},
δ( q0,ε, z0) = {( q0,ε)},
δ( q1,1, x ) = {( q1,ε)},
δ( q1,0 ,z0) = {( q0,z0)}
14. (a)(i)Explain Programming techniques for Turing machine. (8)
(ii) Construct a TM M for language L={an, bn, n ≥ 1} (8)
(OR)
(b)(i) Construct a Turing machine compute multiplication with subroutine “copy” (8)
(ii)Construct the turing machine for reverse the string abb. (8)
15. (a)(i)State and prove the Post correspondence problem with example. (8)
(ii)Write short notes on undecidable problems with example (8)
(OR)
(b)(i)State the halting problem of TMs.Prove that the halting problem of Turing machine over {0,1} is
undecidable.
(ii)Explain the primitive recursive function with example. (8+8)
STAFF IN CHARGE HOD

Model toc

  • 1.
    B.E./B.Tech. DEGREE MODELEXAMINATION, SEPTEMBER.2015 Fifth Semester DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6503 – THEORY OF COMPUTATION (Regulation 2013) Time : Three hours Maximum : 100 marks Answer ALL questions. PART A — (10 × 2 = 20 marks) 1. Construct the regular expression for a*b*. 2. Construct a DFA that accepts i)All strings that contain exactly four 0’s ii)All string that do not contain 110 as substring. 3. What is an ambiguous grammar with example? 4. Write down the context free grammar for L={an bn ;n>=1}. 5. Is it true that the language accepted by a PDA by empty stack and final states are different languages. 6. What are the different types of languages accepted by PDA and define them. 7. Define Instantaneous description of TM 8. Design TM that accept odd integers in binary. 9. What is recursively enumerable languages? 10. What is a Diagonalization language Ld? PART B — (5 × 16 = 80 marks) 11. (a)(i)Construct a NFA for the string starts with11. (6) (ii)State and prove the theorem for equivalence of €-NFA and without €-NFA. (10) (OR) (b)(i)Convert the following NFA to DFA. (10) a b p {p} {p,q} q {r} {r} * r {Ø} {Ø} (ii) Which of the following languages is regular? (6) 1)L={an bm /n,m>=1} 2)L={an bn /n,m>=1} 12. (a)(i)Explain about parse trees for the following grammar (10) S->aB/bA ; A->a/aS/bAA ; B->b/bS/aBB For the string aaabbabbba,Find i)Left most derivation ii)Right most derivation iii)Parse tree (ii)Construct the following grammar in CNF. (6) A->BCD/b B->Yc/d C->gA/c D->Db/a Y->f (OR) (b)(i)Obtain a Greibach normal form grammar equivalent to the context free grammar (8) S->AA/0 A->SS/1
  • 2.
    (ii)Determine the CFLfor the grammar i)S->aSbS /bSaS/€ ii)S->aSb/ab (8) 13. (a)(i)Construct PDA for the language L=(ab)n /n>=1}by empty stack. (8) (ii) Find the PDA equivalent to the CFG S->A,A->BC,B->ba,C->ac. (8) (OR) (b)(i)Construct a PDA accepting by empty stack the languages {ambmcn/m,n≥1}. (6) (ii)Give the CFG generating the language accepted by the following PDA (10) M==({q0,q1,},{0,1},{z0,x},δ,q0,z0,ε), With transitions δ( q0,1,z0) = {( q0,xz0)} , δ( q0,1,x ) = {( q0,xx )}, δ( q0,0, x ) {( q1,x)}, δ( q0,ε, z0) = {( q0,ε)}, δ( q1,1, x ) = {( q1,ε)}, δ( q1,0 ,z0) = {( q0,z0)} 14. (a)(i)Explain Programming techniques for Turing machine. (8) (ii) Construct a TM M for language L={an, bn, n ≥ 1} (8) (OR) (b)(i) Construct a Turing machine compute multiplication with subroutine “copy” (8) (ii)Construct the turing machine for reverse the string abb. (8) 15. (a)(i)State and prove the Post correspondence problem with example. (8) (ii)Write short notes on undecidable problems with example (8) (OR) (b)(i)State the halting problem of TMs.Prove that the halting problem of Turing machine over {0,1} is undecidable. (ii)Explain the primitive recursive function with example. (8+8) STAFF IN CHARGE HOD