Question

Consider the following languages.

L1={0p1q0r∣p,q,r≥0}L_1 = \{0^p 1^q 0^r \mid p, q, r \ge 0\}
L2={0p1q0r∣p,q,r≥0,p≠r}L_2 = \{0^p 1^q 0^r \mid p, q, r \ge 0, p \ne r\}

Which one of the following statements is FALSE?

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2013 answer key

Solution

Classify the given languages in the Chomsky hierarchy and test closure properties.

Let us examine the two languages:

  • L1={0p1q0r∣p,q,r≥0}L_1 = \{0^p 1^q 0^r \mid p, q, r \ge 0\}. This is simply the language denoted by the regular expression 0∗1∗0∗0^* 1^* 0^*. Thus, L1L_1 is regular.
  • L2={0p1q0r∣p,q,r≥0,p≠r}L_2 = \{0^p 1^q 0^r \mid p, q, r \ge 0, p \ne r\}. This requires comparing pp and rr (p<rp < r or p>rp > r). A non-deterministic pushdown automaton can push zeros, ignore ones, and verify whether the number of trailing zeros differs from the leading zeros. Thus, L2L_2 is a deterministic context-free language (DCFL), hence context-free.

Now evaluate each statement:

  • (A) L2L_2 is context-free: TRUE, as shown above.
  • (B) L1∩L2L_1 \cap L_2 is context-free: Since L2⊆L1L_2 \subseteq L_1, L1∩L2=L2L_1 \cap L_2 = L_2, which is context-free. Even generally, the intersection of a regular language (L1L_1) and a CFL (L2L_2) is always a CFL. Thus, TRUE.
  • (C) Complement of L2L_2 is recursive: Every CFL is recursive (decidable). The class of recursive languages is closed under complementation. Therefore, the complement of L2L_2 is recursive. Thus, TRUE.
  • (D) Complement of L1L_1 is context-free but not regular: Since L1L_1 is regular, and regular languages are closed under complementation, the complement of L1L_1 is regular! Saying it is "not regular" is false.

Hence, statement (D) is FALSE.

Final answer

D

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2013 Computer Science and Information Technology (CS)
Question
32 of 65, printed as CS Q.32
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.