Hcoe Toc Assgmt3
Hcoe Toc Assgmt3
Assignment 3
(last date of submission Feb 15)
1. Define Context free grammar (CFG) for:
a. Language L={aa,ab,ba,bb}
b. L=1n
c. L=(0+1)*
2. Define right linear and left linear grammar.
3. Obtain the language generated by each of the following production rules
Obtain the leftmost derivation and rightmost derivation and parse tree for w=aaabbabbba
9. Let G=(V,T,P,S) where productions in G denoted by P are
a. E→T|E+T
T→F|T*F
F→a | (E)
Define equivalent PDA to this grammar.
10. Construct a Turing machine to accept 0n1n.
11. Construct a Turing machine to accept string ab
12. Construct a Turing machine to accept anb2n.
13. Design a TM that performs f(x)=x+2.
14. Simply the grammar in QN 9.
15. Explain Class P, NP problems.