Could someone please guide me how to go about solving this problem?
$$ baa \in a^*b^*a^*b^* .$$
The question asks whether string $baa$ is an element of $a^*b^*a^*b^*$ (in other words a set of any combination of $a$'s or $b$'s).
Intuitively, I would say yes of course it's an element, but how can I show it more formally?
"*" denotes Kleene Star.
Be careful. a*b*a*b* is not the set of "all combinations of a's and b's". For instance, baba is not in this set.
Remember that * means "zero or more". So the elements of a*b*a*b* are of the form:
To show baa is of this form, it's enough to say how many of each letter you are using at each step. For instance, aba is in the set, because it consists of 1 a, 1 b, 1 a, 0 b. How would you do this for baa?