edited by
454 views
2 votes
2 votes

a) Only L1 is correct

b)Only L2 is correct

c)Both L1 and L2 are correct

d)None of L1 and L2 is correct

My question is: What is meant by prefix of string? And how is L1 regular?

edited by

1 Answer

0 votes
0 votes
DFA can be drawn for the first  Language L1 and so the language is regular.

L1 will have finite no. of strings in the language .

L1= { € ,a ,aa, b, bb , ab , aab , aabb , aabbb,  aabbbb }

Language second is clearly a cfl language .

L2 can be written as -

L2= (€ + a + aa)(a^n b^n)  

(Second part is the standard example of cfl language)

[   ' € '   represents null string   ]

Related questions

2 votes
2 votes
5 answers
4