3.3k views

Let $L = L_1 \cap L_2$, where $L_1$ and $L_2$ are languages as defined below:

$L_1= \left \{ a^m b^mca^nb^n \mid m,n \geq 0 \right \}$

$L_2=\left \{ a^i b^j c^k \mid i,j,k \geq 0 \right \}$

Then $L$ is

1. Not recursive
2. Regular
3. Context free but not regular
4. Recursively enumerable but not context free.

edited | 3.3k views
+1

here L1 is CFL  but not regular, L2 is regular so  CFL  now

CFL are closed under intersection with regular languages so L =  L2∩L1 is CFL  what is wrong in his approach , L can be regular only when  L2 and L1 both are regular so why to  consider option (b) . It is simply option C

0
how is it C?
0
Yes ,they given option C is the answer.
+1
L = $a^m b^m c \ | \ m \geq 0$ so CFL right?
0
L1={$a^m$$b^mc a^n$$b^n$|m,n>=0}-CFL

L2={$a^i$$b^j$$c^k$|I,j, k>=0}-regular

$L1\cap L2$  - CFL
0
Why you ignore a^ n b^ n?
0
Cfl is not close under intersection.
+3
Cfl is closed under intersection with regular language.
0
Option C : cfl but not regular.

Main doubt is here.

L1 is cfl but regular also. Isn't it?

L2 is regular.

Given option statement I think is doubtful.
+1
@dhoomketu

L1 is CFL But not reguler.
0
Why not L1 is regular?

From definition of L1 it seems there is no relation between the power of exponent i.e. m and n. and c can be act as mid symbol.

Correct me if I am wrong.
+1
Can you tell me this language is regular or cfl???

L={a^nb^n /n>o}
+3
Please consider any language as set of strings and see which all strings come in it. If one tried to deduce from just the language description negative mark is sure for GATE.
0
Then what approach we consider? Make fsa within limited period of time to solve for 2 or 1 mark question. why language definition is given?
0
+2
Simillary L1 is CFL .

there is one comparision between a and b we so we need one stack(pda).
0
Yes, now I can understand my mistake. thanks.
0

It will be CFl because

L1 is generating equal number of a's and b's

L2 is generating random number of a's b's and c's

so it is evident that set of strings generated by L1 are subset of string generated by L2 .( we wont consider anbn part of L1 as it wont be a part of intersection).

and so intersetion will produce CFL

0
DCFL are closed under intersection with regular languages.

$L_1= \left \{ a^m b^mca^nb^n \mid m,n \geq 0 \right \}$

It is a CFL. It will generate strings which start with a's followed by equal number of b's and single c followed by a's followed by equal number of b's

i.e., ${abcab, aabbcab, aaabbbcaabaabb, \ldots}$

$L_2=\left \{ a^i b^j c^k \mid i,j,k \geq 0 \right \}$

It is a Regular (and of course CFL). It will generate strings which begin with a's followed by any number of b's followed by any number of c's

So, $L_1 \cap L_2$ will be all strings which are common in both languages

So, those will be the strings which begin with a's followed by equal number of b's and ending with c

They would be of the form $a^mb^mc$

Such a language is not regular as it requires equal number of a's and b's. But it is Context Free language as we can make a PDA for it. Also, CFLs are closed under intersection with regular set. So, any CFL intersection a regular set gives a CFL (may or may not be a regular set).

by Loyal (5.5k points)
edited
0

@Arunav Khare Thank you!

+1
regular intersection with any language X is X only ...

$L_1 \cap L_2 = \{a^mb^mc | m \geq 0\}$, which is context free but not regular.

Option C.

by Veteran (431k points)
edited by
+2

L1 ∩ L2={ambmc}

Not regular

0
:O ?
+1
Correction in que.. L1={a^mb^mc a^nb^n|m,n>=0}
0

why is intersection {c} and not L1 ∩ L2={ambmc} ?? @Arjun

0

When we intersect two sets, we get the COMMON elements in both.

+1
Yes...saw my mistake I did not notice that the second b is b^m and not n. Thanks :)
0

I found that too by expanding the language and only c is common and i ticked regular but answer given is CFG. Donno y.

0
Arjun sir, what is the method to generate L1∩L2? That is how are you saying the language of  L1∩L2?
+1
@ Arjun Sir,

Please point out what is wrong in this process.

L1 is DCFL and L2 is regular. This means both are CFL and $L=L1\cap L2$  is not CFL since CFL is not closed under intersection. So L is recursive but not context free.
+8

is not CFL since CFL is not closed under intersection

I do not know who is spreading such a meaning for "not closed". Does some coaching institute teach so? Doeas some book has such a statement? See if it rains, we get wet- > does not mean that if it does not rain we won't get wet.

+5
Not closed $\equiv$ We can't say.

CFL is not closed under intersection means we can't say what we get when we intersect two CFLs.
0
Thanks @Arjun Sir and @Sachin for the update.
0
sir please tell me whats wrong in this approach!

L1 contains all the strings that end with b's

L2 contains all the strings that end with c.

now ,

L=L1∩L2 = phi

since phi is regular. therefore option b

Option c is right.

by Boss (36.7k points)
0
This answer is quite similar with Gradup given explanation in their answer.But my doubt is still same.
0
Any doubt in this solution??
0
Yes, i have doubt in this solution as same as Gradup answer logic.

L1 intersection L2={a^ m b^ m c|m>=0}

Why?
+1

Here L1 gives like string

{abc,aabbc,aaabbbc, abcab.......}

L2 gives like string

{abc,aabbc,aabbcc,.............}

try to understand both language in

• L1 it gives only one c . So comman string must be only one c.

So comman string like abc,aabbc... So on

The language L1 accept strings {c, abc, abcab, aabbcab, aabbcaabb, …} and L2 accept strings {a, b, c, ab, abc, aabc, aabbc, … }. Intersection of these two languages is L1 ⋂ L2 = {a{k}b{k}c | k >= 0} which is context free, but not regular.

by Active (1.1k points)
Intersection of CFL and regular is always CFL. so option C
by Loyal (7.3k points)
+1 vote

option c

by Boss (36.7k points)

Here, L1 is CFL and L2 is RL.

L=L1L2=(CFLRL)=CFL but not RL.

Because, CFL is closed under intersection with RL.

Hence, correct option is C.

by Junior (519 points)