Consider the following two statements:
is a regular language
is a regular language
Which of the following statement is correct?
View worked solution
Answer: A
To determine the correctness of the statements, let us analyze each language individually:
- Statement :
This language contains strings of s of even length (excluding the empty string): . We can easily represent this language using the regular expression
(00)+. Since a regular expression exists, is a regular language. Thus, is correct. - Statement :
In this language, the number of trailing s must equal the sum of the leading s and the middle s. This requires matching and counting across non-adjacent blocks, which cannot be done with a finite automaton (finite memory). Using the pumping lemma, we can easily show that is not regular (it is a context-free language). Thus, is incorrect.
Therefore, only statement is correct.
Free practice · Your answers on this page are not saved.
