You are on page 1of 2

Theory of Automata and Formal Languages(KCS-402)

Online Assessment-II
B.Tech CS-4th Semester

Attempt Questions in all Sections

Part A: (3*5=15)
1. What set is generated by the following grammar? [CO2]
S  bS | Sa | aSb |ԑ
Give proof.
2. Give dfa’s for the languages: [CO1]
5 4
a. L={ab wb : wԑ{a,b}*}
b. L={w1abw2:w1ԑ{a,b}*,w2ԑ{a,,b}*}
3. Give an example of a deterministic context free language whose reverse is not
deterministic. [CO2]

Part B (3*10=30)
1. Show that the language L=anbjanbj: n>=0,j>=0} is not context free grammar. [CO2]
2. Construct the NPDA corresponding to the grammar [CO2]
SaABB|aAA
AaBB|a
BbBB|A
3. “Finite automata is also suited for real world problem.” Justify your answer with suitable
example. [CO4]

Part C (3*10=30)
1. How we can eliminate the nondeterminism of a finite automata using the subset
construction, illustrate it for given NFA M=(Q,{a,b},0,δ,F) as below [CO1]

2. If G is a context-free grammar, then for every x ∈ L(G), these three statements are
equivalent:
1. x has more than one derivation tree.
2. x has more than one leftmost derivation.
3. x has more than one rightmost derivation.
On the basis of above statement how we define ambiguity of a grammar. Are the given
productions Sa|S+S|S*S|(S) having similarity or difference from dangling else
problem. Justify it. [CO4]
3. Consider the CFG with productions [CO3]
SS1$
S1S1+T|T
TT*F|F
F[S1]|a
a) Write the CFG obtained from this one by eliminating left recursion
b) Give a transition table for a DPDA that acts as a top down parser for this language.

You might also like