wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following languages:
L1={ap | p is a prime number}
L2={anbmc2m | n0,m0}
L3={anbnc2n | n0}
L4={anbn | n1}
Which of the following are CORRECT?
I. L1 is context-free but not regular.
II L2 is context-free.
III. L3 is not context-free but recursive.
IV. L4 is deterministic context-free.

Open in App
Solution

L1={ap | p prime} is a CSL but not CFL (prime number checking involve division)
L2={anbmc2m | n0,m0} is CFL (one comparision)
L3={anbnc2n | n0} is CSL (two comparision)
L4={anbn | n1} is a DCFL
So,
I. L1 is CFL but not regular is false.
II. L2 is not CFL is false.
III. L3 is not CFL but recursive is true since every CSL is recursive.
IV. L4 is DCFL is true.
So, only III and IV are true and correct.

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