Find a regular expression corresponding to the set of all strings com-posed of a and b that contain an even number of as.
The expression b∗ defines the set of all strings without a; the expression (b∗ab∗ ab∗) defines the set of all words with exactly two as. It remains to take the union of these two sets and then to apply iteration:
((b∗ab∗ab∗) \mid b*)∗
Another possible answer:
( (b∗ ab∗a)∗ b∗)