-
Let G = ({S}, {a, b}, R, S) be a context-free grammar where the rule set R is S → aSb | SS | ∈
Which of the following statements is true?
-
- G is not ambiguous
- There exist X, Y ∈ L(G) such that XY ∈ L(G)
- There is a deterministic push-down automata that accepts L(G)
- We can find a deterministic finite state automata that accepts L(G)
- G is not ambiguous
Correct Option: C
The grammar is S → aSb | SS | ∈
(a) G is not ambiguous is false, since ∈ which belongs to L(G), has infinite number of derivation trees, which makes G ambiguous. Some derivation trees are
(b) There exists x, y ∈ L(G) such that xy ∉ L(G) is false, since S → SS, can be used derive xy, whenever x ∈ L(G) and y ∈ L(G).
(c) It is true, since this language is L(G) = { W | na (W) = nb (W) and na (v) ≥ nb (V) where V is any prefix of W }
This language happens to be deterministic context-free language.
∴ There exists a dpda that accepts it.
(d) It is false, as the given language is not regular.
∴ number of DFA exists to accept it.