AMC ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
THEORY OF COMPUTATION BCS503 Question Bank
1. Define CFG. Construct CFG for the Languages given Below:
i.L={w| na (w)=nb(w)} ii. L={an+1 bm cm cn |n,m>=0}
iii. L={0m 1m 2n /m,n>=0} iv. L={ai bj | i=j+1}
2. Define CFG. Design CFG for the languages:
i. L={02n 1m | n>=0,m>=0 } ii.L=L={0i 1j 2k |i=j or j=k}
iii.L={anbmcmd2n |n,m>=0} iv.L={wwR| w {a,b}*}
3. Consider the Grammar:
EE+T| T
TT*F|F
F( E) |0|1
Write the Leftmost derivation, Rightmost derivation and a Parse fo r the string 0+1*1
4. Consider the Grammar:
EE+E | E*E | E-E | (E) | I
I0| 1| a| b|Ia|Ib|I0|I1
And compute the following for input String (a1+b0-00)
i. LMD ii. RMD iii. Parse Tree iv. Is this ambiguous? Justify your answer.
5. Define PDA. Obtain a PDA to accept the Language
L={ wwR| w {a,b}*}
ii. Convert the following grammar into equivalent PDA:
SaSb| bSa | a|b
6. Define Grammar. Prove whether the given grammars ambiguous grammar or not:
SABC
AaC|D
BbB|A| ϵ
CAc| ϵ|Cc
Daa
7. List the Closure Properties of CFLs and Prove that language L ={a n bncn |n>-0} is not
context free language.
8. Define CNF. Convert the following CFG into CNF.
SASB/
AaAS|a
BSbS|A|bb
9. Define TM. Design a Turing Machine to accept L ={0n 1n| n>=1}. Show the moves made for the string
000111.
10. List the Closure Properties of CFLs and Prove that language L ={WW | w {0,1}*} is
not context free language by Pumping Lemma Theorem.
11. Define TM. Design a Turing Machine to accept L ={a n bn cn| n>=1}. Show the moves made for the
string aabbcc.
12. Define CNF. Convert the following CFG into GNF.
S->aACa
A->B/a
B->C/c
C->cC/ϵ.
13. Define Push Down Automata. Obtain a PDA to accept the Language
L={ ai bj ck| i=j+k}
ii. Convert the following grammar into equivalent PDA:
EE+T, ET, TT*F, TF, F(E), Fid
14. Eliminate productions, unit productions, and useless productions:
SABC|BaB
AaA |BaC|aaa
BbBb|a|D
CCA|AC
D
15. Illustrate Programming Techniques for Turing Machines with a suitable example.
16. Define Turing Machine. With a neat Block diagram, explain the the working of basic Turing Machine.
17. Explain The Techniques for Turing Machine construction. Also write applications of Turing Machine.
18. Explain Undecidability. Illustrate a Language That Is Not Recursively Enumerable with example.
19. .Design a PDA for the language L= {WCWR |W £ (a,b)* where WR is reverse of W } and
show the moves made by PDA for the string “aabcbaa”. [ Practice more problems in PDA]
20. Design a Turing machine to accept L={1n2n3n |n>=1}. Show the move made for the string
0011 and 00111.