Let L = L1∩L2, where L1 and L2 are languages as defined below: L1 = {am bm can…

2009

Let L = L1∩L2, where L1 and L2 are languages as defined below:

L1 = {am bm can bn | m, n >= 0}

L2 = {ai bj ck | i, j, k >= 0}

Then L is

  1. A.

    Not recursive

  2. B.

    Regular

  3. C.

    Context free but not regular

  4. D.

    Recursively enumerable but not context free.

Attempted by 14 students.

Show answer & explanation

Correct answer: C

L1 is context-free but not regular, and L2 is regular. The intersection of a context-free language with a regular language is context-free. Since L1 ∩ L2 results in strings of the form am bm c an bn, which requires matching two pairs of counts (m and n), this language is not regular. However, it can be generated by a context-free grammar (e.g., S → A C B where A generates am bm, C is 'c', and B generates an bn), so it is context-free. Therefore, L is context-free but not regular.

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

Explore the full course: Gate Guidance By Sanchit Sir