ToC -Sheet 5-
ToC -Sheet 5-
St. Name:
5. It could be proved by the pumping lemma that the language --- is not regular ?
a) L is a set of numbers divisible by 2
b) L is a set of binary complement
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
1
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
8. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned
2
(2)S->AAS
(3)A->SA
(4)A->aa
Which of the following productions denies the format of Chomsky Normal Form?
a) 2,4
b) 1,3
c) 1, 2, 3, 4
d) 2, 3, 4
16. With reference to the process of conversion of a context free grammar to CNF, the number of
variables to be introduced for the terminals are:
S->ABa
A->aab
B->Ac
a) 3
b) 4
c) 2
d) 5
17. In which of the following, does the CNF conversion find its use?
a) CYK Algorithm
b) Bottom up parsing
c) Preprocessing step in some algorithms
d) All of the mentioned
3
2- Let languages L1 and L2 be generated by context-free grammars G1 =(V1,Σ,P1,S1) and G2 =
(V2,Σ,P2,S2), respectively. Give a context-free grammar that generates the language L1 ∪ L2 in
terms of G1 and G2.
3- Let (w1w2 · · ·wn)R = wn · · ·w2w1 for string w1w2 · · ·wn of length n. Give a
context-free grammar that generates {w ∈ {a, b}∗ | w = wR}.
(4)∗ {aibj | 0 ≤ i ≤ j }
6- Answer the following questions for the context-free grammar G given by the
following rules: S→aSa | aSb | bSa | bSb | ε.
(1) Give informal English descriptions of the language L(G) which the grammar generates.
(2) The language L(G) turns out to be a regular language. Give a regular grammar that
generates L(G).
7- Answer the following questions for the context-free grammar G given by the following rules:
S→aS | Sb | a | b | .
(1) Give informal English descriptions of the language L(G) which the grammar generates.
4
8- Answer the following questions for the context-free grammar G given by the following rules:
S →aB | bA | ε,
A→aS | bAA,
B →bS | aBB.
(1) Give informal English descriptions of the language L(G).