Back to the 2021 paper

Module 3: Context-Sensitive Languages

20212m

The language:

L={ambncm+n∣m,n≥1} L = \{ a^m b^n c^{m+n} \mid m,n \ge 1 \}

is:

(i) regular
(ii) context-free but not regular
(iii) context-sensitive but not context-free
(iv) type-0 but not context-sensitive

Worked SolutionAI Assisted

Answer

Correct Option: (ii) Context-free but not regular

Explanation

L={ambncm+n∣m,n≥1}L = \{ a^m b^n c^{m+n} \mid m,n \ge 1 \}.

Not Regular

Use Pumping Lemma. Let pp be pumping length, w=apbpc2p∈Lw = a^p b^p c^{2p} \in L. Pumping yy in aa segment breaks m+nm+n balance.

Context-Free

PDA construction:

  1. Push aa’s (m times) → stack =Am= A^m.
  2. Push bb’s (n times) → stack =AmBn= A^m B^n (or same symbol).
  3. For each cc, pop one symbol. Accept if empty after m+nm+n cc’s and no extra input.

Alternatively grammar:
S→aSc∣aTcS \rightarrow a S c \mid a T c
T→bTc∣bcT \rightarrow b T c \mid b c

This generates ambncm+na^m b^n c^{m+n}.

Not context-sensitive requirement beyond; CFL suffices, but not regular. Not Type-0/1 only.

Final Answer

Context-free but not regular → Option (ii).

Similar questions

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.