Skip to content
Official PYQ · 2011

GATE CS 2011 Q26 — Regular and Context-free Languages

Explain with AI

Consider the languages L1, L2 and L3L1, \:L2 \:and \: L3 as given below.

L1={0p1q∣p,q∈N},L2={0p1q∣p,q∈N and p=q} and,L3={0p1q0r∣p,q,r∈N and p=q=r}.L1=\{0^p 1^q \mid p, q \in N\}, \\ L2 = \{0^p 1^q \mid p, q \in N \:and \:p=q\} \: and, \\ L3 = \{0^p 1^q 0^r \mid p, q, r \in N\: and \: p=q=r\}. 

Which of the following statements is NOT TRUE?

Choose one option
View worked solution

Answer: C

Let us analyze the classification of each language given in the problem:

  1. Language L1={0p1q∣p,q∈N}L_1 = \{0^p 1^q \mid p, q \in N\}:
    This language represents any sequence of 00s followed by any sequence of 11s. It can be represented by the regular expression 0+1+0^+1^+ (or 0∗1∗0^*1^* depending on whether NN includes 00). Since it can be defined by a regular expression, L1L_1 is a Regular Language.
  2. Language L2={0p1q∣p,q∈N and p=q}L_2 = \{0^p 1^q \mid p, q \in N \text{ and } p=q\}:
    This is the language {0n1n∣n∈N}\{0^n 1^n \mid n \in N\}. It requires matching the number of 00s with the number of 11s, which requires a single stack memory. Thus, L2L_2 is a Context-Free Language (CFL), but not regular.
  3. Language L3={0p1q0r∣p,q,r∈N and p=q=r}L_3 = \{0^p 1^q 0^r \mid p, q, r \in N \text{ and } p=q=r\}:
    This is the language {0n1n0n∣n∈N}\{0^n 1^n 0^n \mid n \in N\}. It requires comparing three quantities simultaneously (p=qp=q and q=rq=r), which cannot be done using a single stack. Thus, L3L_3 is Context-Sensitive (CSL) but NOT Context-Free.

Now, let's evaluate each option:

  • Option A: Push Down Automata (PDA) can be used to recognize L1L_1 and L2L_2.
    Since L1L_1 is regular and L2L_2 is context-free, both can be recognized by a PDA. (True)
  • Option B: L1L_1 is a regular language.
    As shown above, L1L_1 is regular. (True)
  • Option C: All the three languages are context free.
    Since L3L_3 is not context-free, this statement is NOT TRUE. (False)
  • Option D: Turing machines can be used to recognize all the languages.
    All three languages are recursive (and thus recursively enumerable), meaning they can all be recognized by a Turing machine. (True)

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

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