Let \(L_1 = \{ 0^n 1^n 0^m | n>=1, m>=1 \} \\L_2 = \{ 0^n 1^m 0^m | n>=1, m>=1…

2021

Let
\(L_1 = \{ 0^n 1^n 0^m | n>=1, m>=1 \} \\L_2 = \{ 0^n 1^m 0^m | n>=1, m>=1 \} \\L_3 = \{ 0^n 1^n 0^n | n>=1\} \)

Which of the following are correct statements?

A. \( L_3 =L_1 \cap L_2\)

B. \(L_1\) and \(L_2\) are context free languages but L is not a context free language

C. \(L_1\) and \(L_2\) are not context free languages but L is a context free language

D. \(L_1\) is a subset of \(L_3\)

Choose the correct answer from the options given below:

  1. A.

    A and B only

  2. B.

    A and C only

  3. C.

    A and D only

  4. D.

    A only

Attempted by 24 students.

Show answer & explanation

Correct answer: A

Final answer: A and B only

Reasoning summary:

  • Equality of sets: The intersection of L1 and L2 forces all three block lengths to match. Any string in the intersection has form 0^a 1^b 0^c with a=b (from L1) and b=c (from L2), hence a=b=c. Thus the intersection is exactly {0^n 1^n 0^n}, which is L3.

  • Context-freeness of L1 and L2, and non-context-freeness of L3:

    • L1 is context-free because it is the concatenation of {0^n1^n | n>=1} (a standard CFL) with {0^m | m>=1} (a regular language). For example, a grammar: S -> A B, A -> 0 A 1 | 0 1, B -> 0 B | 0, generates L1.

    • L2 is context-free because it is the concatenation of {0^n | n>=1} (regular) with {1^m 0^m | m>=1} (a standard CFL). Thus L2 is CFL by closure under concatenation with a regular language.

    • L3 = {0^n 1^n 0^n | n>=1} is a standard example of a non-context-free language (can be shown using the pumping lemma for context-free languages or Ogden's lemma).

  • Why the other combined statements are false:

    • The claim that L1 and L2 are not context-free but L3 is context-free is false because the truth values are the opposite: L1 and L2 are context-free, L3 is not.

    • The claim that L1 is a subset of L3 is false. Counterexample: the string 0^1 1^1 0^2 (i.e., 0 1 0 0) belongs to L1 (take n=1, m=2) but not to L3 because the three block lengths are not all equal.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor