Let . i.e., is the set of all the bit strings with even numbers of s. Which one of the regular expressions below represents ?
View worked solution
Answer: B
The language contains all binary strings with an even number of s (including zero s, i.e., ).
- Option A: cannot generate the string , which belongs to because it has zero s (an even number).
- Option C: cannot generate the string (which has four s). In , any two consecutive iterations result in , meaning the second and third s must be adjacent with no between them.
- Option D: requires at least two s, so it cannot generate .
- Option B: correctly generates all strings with an even number of s. Any string with ones can be partitioned as , which perfectly matches this regular expression.
Free practice · Your answers on this page are not saved.
