Correct option is D
(a) Given a CFG G and a string x, an algorithm can decide whether x ∈ L(G) in polynomial time. — True
The membership problem for Context-Free Languages (CFLs) is decidable in polynomial time.
For example, the CYK (Cocke–Younger–Kasami) algorithm can determine whether a string belongs to the language generated by a CFG in time for a grammar in Chomsky Normal Form.
(b) Given a context-free language L, its complement is also context free. — False
Context-Free Languages are not closed under complementation.
That is:
For example, consider:
The language
is not context-free. Using closure properties, one can construct examples demonstrating that CFLs are not closed under complement.
(c) is not deterministic context-free. — True
Let:
Within the regular language:
the complement of L is:
Now, suppose L were a deterministic context-free language (DCFL).
DCFLs are closed under complement, and regular languages are also DCFLs. Therefore, R – L would also be a DCFL and hence a CFL.
But, is not context-free.
This gives a contradiction.
(d) Class of deterministic context-free languages is closed under intersection. — False
DCFLs are not closed under intersection.
That is:
does not necessarily imply:
is a DCFL.
However, DCFLs are closed under complement.
