retagged by
350 views
0 votes
0 votes

Determine whether or not the following language is context-free.

MY ANSWER : The given language is equivalent to L1 = { wwR : where w $\in$ {a,b}* } . And so the given language is Non-deterministic CFL.

Please verify ...

retagged by

1 Answer

Best answer
2 votes
2 votes

Actually for such languages what we do is : 

By appropriate substitution ( in this case n = 0 ) , if we are able to cover higher strings (like n = 1 , 2 etc here ) , then we can do such substitution.

For example to verify here , we can see that here we have any no of a's in the beginning and in the end also ..So the starting 'n' a's can be made part of 'w' part of string and trailing 'n' a's can be made part of 'wR'  part of string..

Hence the given language reduces to L = { w wR  |  w belongs to {a , b}* } which is an NCFL..Hence the given language is NCFL. 

selected by

Related questions

0 votes
0 votes
0 answers
1
RahulVerma3 asked Apr 2
48 views
Is this the correct Turing machine for the language $0^n 1^n0^n$?assuming $ at the end and begining of the input tape
0 votes
0 votes
0 answers
2
baofbuiafbi asked Nov 14, 2023
158 views
Prove the language L={(G,H)|G is a CFG, H is a DFA, and L(G)∩L(H)=∅} is undecidable.