Skip to content
Official PYQ · 2013

GATE CS 2013 Q32 — Regular and Context-free Languages

Explain with AI

Consider the following languages.

L1={0p1q0r∣p,q,r≥0}L_1 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0 \right \}

L2={0p1q0r∣p,q,r≥0,p≠r}L_2 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0, p\neq r \right \}

Which one of the following statements is FALSE?

Choose one option
View worked solution

Answer: D

To find the FALSE statement, let us analyze the properties of the languages L1L_1 and L2L_2:

1. Analysis of L1L_1:

L1={0p1q0r∣p,q,r≥0}L_1 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0 \right \}

  • There are no constraints or dependencies between the powers pp, qq, and rr.
  • Thus, L1L_1 can be represented by the regular expression 0∗1∗0∗0^*1^*0^*.
  • Since L1L_1 is a regular language, its complement L1‾\overline{L_1} must also be regular (as regular languages are closed under complementation).
  • Therefore, the statement "Complement of L1L_1 is context-free but not regular" is FALSE.

2. Verification of other options:

  • Option A: L2={0p1q0r∣p≠r}L_2 = \left \{ 0^p1^q0^r \mid p \neq r \right \} requires comparing the count of 00s before and after the 11s. This single comparison (p<rp < r or p>rp > r) can be easily performed using a Pushdown Automaton (PDA). Thus, L2L_2 is a context-free language (CFL). This statement is TRUE.
  • Option B: Since L2⊆L1L_2 \subseteq L_1, we have L1∩L2=L2L_1 \cap L_2 = L_2. Since L2L_2 is a CFL, their intersection is also a CFL. (Alternatively, the intersection of a regular language L1L_1 and a CFL L2L_2 is always a CFL). This statement is TRUE.
  • Option C: Every context-free language is recursive. Since L2L_2 is a CFL, it is recursive. Since recursive languages are closed under complementation, the complement of L2L_2 is also recursive. This statement is TRUE.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular and Context-free Languages questions