Which of the following are regular sets?
View worked solution
Answer: A
To determine which of the given sets are regular, we analyze each language individually:
-
In this language, the number of 's () and the number of 's () are completely independent.
- for can be generated by the regular expression .
- for represents an even number of 's, which can be generated by .
Since the two parts are independent, we can concatenate them to get the regular expression: . Thus, is regular.
-
This language requires the number of 's to be exactly twice the number of 's. Since a finite automaton has finite memory, it cannot keep track of an arbitrary count to enforce this dependency. Thus, is not regular (it is deterministic context-free).
-
This language requires comparing the count of 's and 's to ensure they are unequal. Since a finite automaton cannot perform arbitrary counting and comparison, is not regular (it is context-free).
-
Here, and can be any arbitrary strings over the alphabet , separated by a single character . This can be directly represented by the regular expression: Since it can be described by a regular expression, is regular.
Therefore, only I and IV are regular sets.
Free practice · Your answers on this page are not saved.
