Regular Expressions & Languages

Answer & solution
Official answer: A
1. Set up the reasoning. Count overlapping occurrences. For L1, examine maximal runs of at least two 1s: an entering 0 produces one 011 and a leaving 0 produces one 110. Every internal run contributes one of each.
2. Derive the result. For each maximal run of at least two 1s, an entering 0 contributes one 011 and a leaving 0 contributes one 110. Internal runs cancel; hence #110−#011 equals the indicator that the string starts 11 minus the indicator that it ends 11. A finite automaton can track these boundary facts, so L1 is regular. Intersect L2 with 0³0*1³1*: the resulting language is{0m1n: m≥n≥3}, because occurrences number m−2 and n−2. This is not regular: pumping down a zero in 0p1p violates m≥n. Thus L2 is not regular, A.
3. Check the interpretation. Only boundary runs can leave an imbalance, requiring finite memory. For L2, intersect with the regular pattern 0m1n, m,n≥3; counts become m-2 and n-2, demanding the unbounded comparison m≥n. Pumping zeros down from 0p1p contradicts regularity.