Professional Documents
Culture Documents
Define whether the following statements are true or false based on the given CFG.
If true then show the derivation.
i) 1001
ii) 0110
iii) 0000
iv) 1111
[CO3] 2 a) Consider the following CFG 5
E E T T
T T F F
F E a
Draw the parse trees for the following expressions:
i) axa+a
ii) (a+a)x(axa)
Page 1 of 2
CO3 b) Construct the CFG for the following DFA: 5
[CO3] 3 a) Construct the Push down automata (PDA) for the following language. 5
L= {anbn | n ≥ 0}
Show all the stack conditions for each transition for the following
strings and verify if they are accepted or not:
i) aabb
ii) {aabbab}
b) Design the PDA for the following CFG and show the stack status for the 5
input –aababb and verify if it is accepted or not.
S ASB |
A aAS | a
B SbS | A | bb
[CO4] 4 a) Convert the following CFG in to Chomsky Normal form 5
S AAAB | B
A aA | B
B b|
b) Design the state diagram of a Turing machine that recognizes the following 5
language:
{bn a 2n | n 1}
Page 2 of 2