Which of the following option is correct regarding dependability?
(A) Given a regular language R and context-free C. Is every string in R also in C, i.e., Is L(R)⊆L(C) decidable?
(B) Given a regular language R and context-free C. Is every string in C also in R, i.e., Is L(C)⊆L(R) decidable?
(C) Both (A) and (B)
(D) None of these


Answer: (B)

Explanation: (A) Whether a context-free grammar generates all possible strings over the alphabet is undecidable but it is easy to write down a regular grammar for all strings. So, option (A) is false.

(B) It is decidable. We have C⊆R iff C∩R\’=∅. Here R\’ is the complement of R is regular, and thus the intersection C∩R\’ is context-free. Emptiness of context-free languages is decidable. So, option (B) is correct.

Quiz of this Question


  • Last Updated : 12 Dec, 2018

Share your thoughts in the comments