Let be the -state with -transitions shown in the diagram below.

Which one of the following regular expressions represents the language accepted by ?
View worked solution
Answer: B
By analyzing the paths from the start state in the given , we can identify three distinct branches of accepted strings:
- Only s: The automaton can transition to a loop that accepts any number of s, including the empty string . This corresponds to the regular expression .
- Odd number of s followed by an even number of s: This path accepts strings of the form .
- Odd number of s: This path accepts strings consisting of an odd number of s, represented by .
Combining these three independent paths, the complete language accepted by the is represented by the union of their regular expressions:
By factoring out from the last two terms, we get:
This matches Option B.
Free practice · Your answers on this page are not saved.
