Given two languages : L1 = {(ab)n ak | n > k, k ≥ 0} L2 = {an bm | n ≠ m}…
2014
Given two languages :
L1 = {(ab)n ak | n > k, k ≥ 0}
L2 = {an bm | n ≠ m} Using pumping lemma for regular language, it can be shown that
- A.
L1 is regular and L2 is not regular.
- B.
L1 is not regular and L2 is regular.
- C.
L1 is regular and L2 is regular.
- D.
L1 is not regular and L2 is not regular.
Attempted by 28 students.
Show answer & explanation
Correct answer: D
Answer: Both languages are not regular.
L1 is not regular. Consider the regular language a* b*. Intersection of L1 with a* b* gives exactly {a^n b^n | n>0} (those strings in L1 with no a after the b's). Since {a^n b^n | n>0} is a known nonregular language, L1 cannot be regular because intersection of a regular language with a regular language must be regular.
L2 is not regular. Note that a* b* is regular and L2 = {a^n b^m | n ≠ m} is a subset of a* b*. If L2 were regular, then the difference a* b* \ L2 would be {a^n b^n}, which would be regular (difference of regular languages). This contradicts the known fact that {a^n b^n} is not regular. Therefore L2 is not regular.
A video solution is available for this question — log in and enroll to watch it.