Search code examples
uniontheoryautomata

Strings that {b U a}* Accepts (Kleene Star)


So I understand that something like b* accepts epsilon, b, bb, bbb, etc.

However, when I take the union of these two characters, what types of strings are accepted by the language? Is babababa accepted?


Solution

  • (b U a)* means "any string of any length containing either a or b". It is all strings of as and bs. Yes, the string you suggest is matched. Any string with only as and bs (or no symbols at all) is matched.