CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let L1= {0n+m1n0m|n,m0},
L2= {0n+m1n+m0m|n,m0}, and
L3= {0n+m1n+m0n+m|n,m0}.
Which of these languages are NOT context-free?

Open in App
Solution

L1 ={0n+m1n0m|n,m0} is context free (first n+m 0's are pushed into the stack, then for each of the 1s and 0s following, we will pop the 0's in the stack one by until at the end of the word if the stack is empty then the word is accepted).
L2 ={0n+m1n+m0m|n,m0} is not context free, since two comparisons have to be made here to determine if w L2.
1.0's and 1's are equal.
2.Since m < (n+m). we have to ensure that, 0's which come after 0n+m1n+m, are less in number, compared to n+m.
L3= {0n+m1n+m0n+m|n,m0} is clearly context sensitive since have also 2 comparisons have to be made. Infact this language is same as
L3={0x1x0x|x0, which is context sensitive.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Summation by Sigma Method
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon