in Theory of Computation
535 views
0 votes
0 votes
Is the following language CFL :
{ ww | w in (a+b)* and |w| <1000 }
in Theory of Computation
535 views

2 Comments

since the given language is havinga restriction on length of strings , i.e |w | < 1000 so maximum length of the string generated by this grammar is  1998 since there is limit to length the language generated by this grammar will be regular, but according to Chomsky Hierarchy all Regular languages are Context Free also therefore given Language is Context Free Language.
0
0
Use Pumping Lemma for context free language to deduce your answer
0
0

1 Answer

1 vote
1 vote

Answer is Yes. If we don’t have the condition |w| < 1000 it is not a CFL. And we are adding a restriction of length to it it will make the language finite and hence regular and CFL. 

https://stackoverflow.com/questions/42611602/is-ww-where-w-belongs-to-a-b-a-context-free-language

edited by

1 comment

That’s wrong. Because the restriction is actually making the number of possible strings to be finite and hence the language bcomes finite, hence regular and hence CFL too.
3
3

Related questions