0

Let A={a,b}. So the question is to write regular expression such that L(r) which consists of all words.

My answer is this:

L(r)= (a+b)* a* b* (a+b)*

Is this correct?

Also another solution is:

L(r)=(a+b)*

Is this correct?

Is (a+b)* same as (a,b)* ?

1 Answers1

1

Is (a+b)* same as (a,b)* ?

Close, but try not to mix domains. If the regular expression $r$ is the string $(a{+}b)*$, then the language of $r$ is the set of all strings over $\{a,b\}$, or $L(r) = \{a,b\}^*$.

So, $(a{+}b)*$ and $\{a,b\}^*$ denote the same set of strings. The first one as regular expression, the second one in set notation.

Hendrik Jan
  • 31,459
  • 1
  • 54
  • 109