Which one of the following is TRUE?
View worked solution
Answer: C
To determine which language is regular, we analyze each option:
- Option A: is a classic non-regular language. It requires infinite memory (a stack) to ensure the number of 's matches the number of 's.
- Option B: is not regular. The gap between consecutive prime numbers grows arbitrarily large, which violates the pumping lemma for regular languages.
- Option C: is regular. We only need to count the number of 's modulo 3. This can be recognized by a Deterministic Finite Automaton (DFA) with 3 states, where the transitions on symbol remain in the same state, and transitions on cycle through the states.
- Option D: is not regular. It requires remembering the entire first half of the string to match it with the second half, which cannot be done with finite states.
Thus, only Option C is regular.
Free practice · Your answers on this page are not saved.
