GATE 2013
April 5, 2025GATE 2007-IT
April 5, 2025GATE 2013
Question 33 |
Consider the following languages.
- L1 = {0p1q0r|p,q,r≥0}
L2 = {0p1q0r|p,q,r≥0, p≠r}
Which one of the following statements is FALSE?
L2 is context-free. | |
L1∩ L2 is context-free. | |
Complement of L2 is recursive. | |
Complement of L1 is context-free but not regular. |
Question 33 Explanation:
L1 = 0*1*0* which is regular language and in L2 we have one comparison (i.e. p ≠ r) so it is CFL.
Intersection of a regular language with a context free language is context free language (by closure properties of regular language) So L1∩ L2 is context-free.
L2 is CFL and CFL is not closed under complementation so we have to assume L2 as CSL (since every CFL is CSL) and CSL is closed under complement so Complement of L2 must be CSL and every CSL is recursive so Complement of L2 is recursive.
Since L1 is regular and regular language is closed under complement so complement of L1 must be regular and hence the statement Complement of L1 is context-free but not regular is a false statement.
Intersection of a regular language with a context free language is context free language (by closure properties of regular language) So L1∩ L2 is context-free.
L2 is CFL and CFL is not closed under complementation so we have to assume L2 as CSL (since every CFL is CSL) and CSL is closed under complement so Complement of L2 must be CSL and every CSL is recursive so Complement of L2 is recursive.
Since L1 is regular and regular language is closed under complement so complement of L1 must be regular and hence the statement Complement of L1 is context-free but not regular is a false statement.
Correct Answer: D
Question 33 Explanation:
L1 = 0*1*0* which is regular language and in L2 we have one comparison (i.e. p ≠ r) so it is CFL.
Intersection of a regular language with a context free language is context free language (by closure properties of regular language) So L1∩ L2 is context-free.
L2 is CFL and CFL is not closed under complementation so we have to assume L2 as CSL (since every CFL is CSL) and CSL is closed under complement so Complement of L2 must be CSL and every CSL is recursive so Complement of L2 is recursive.
Since L1 is regular and regular language is closed under complement so complement of L1 must be regular and hence the statement Complement of L1 is context-free but not regular is a false statement.
Intersection of a regular language with a context free language is context free language (by closure properties of regular language) So L1∩ L2 is context-free.
L2 is CFL and CFL is not closed under complementation so we have to assume L2 as CSL (since every CFL is CSL) and CSL is closed under complement so Complement of L2 must be CSL and every CSL is recursive so Complement of L2 is recursive.
Since L1 is regular and regular language is closed under complement so complement of L1 must be regular and hence the statement Complement of L1 is context-free but not regular is a false statement.