Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
179 views
in General by (78.8k points)
closed by

Consider the following languages over the alphabet ∑ = {a, b, c}

Let L1 = {an bn cm | m, n ≥ 0} and L2 = {am bn cn | m, n ≥ 0}

Which of the following are context-free languages?

I. L1 ∪ L2

II. L1 ∩ L2


1. I only
2. II only
3. I and II
4. Neither I nor II

1 Answer

0 votes
by (79.1k points)
selected by
 
Best answer
Correct Answer - Option 1 : I only

CFL Properties:

1) Union of two context free languages is context free.

2) Intersection of two context free languages may or may not be context free.

L1 = {an bn cm | m, n ≥ 0}

This language is DCFL and hence CFL.  As number of a’s are equal to number of b’s in this. Hence, only one stack is needed.

L2 = { am bn cn | m, n ≥ 0}

This language is also DCFL and hence CFL also. In this, number of b’s are equal to number of c’s, so, one stack is needed for this.

Now, from properties of CFL it is clear that union of two CFL is CFL.

So, statement 1 is correct

Statement 2 is correct.

 intersection of two CFL may or may not be CFL.

For, L1 ∩ L2, we require two stacks, which becomes the case of context sensitive language. L1 ∩ L2 is not a CFL. So, option 2) is incorrect.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...