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

Which of the following languages are context-free?
L1={ambnanbm|m,n1}
L2={ambnambn|m,n1}
L3={ambn| m=2n+1}

Open in App
Solution

L1={ambnanbm|m,n1} is CFL (push "a" and "b" and then first "a" pops "b" and then "b" pops "a").
L2={ambnambn|m,n1} is non-CFL (Alternate comparision not possible in a PDA)
L3={ambn| m=2n+1} is CFL (Single comparison is possible in a PDA)

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Theorems for Differentiability
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon