Language of Regular Expression

57 Views Asked by At

I'm trying to teach myself Regular expressions for Automata,

I'm struggling to work out what the output of

$L((1+01)^*)$ would be

Would it be the star closure of $\{1,01\}$ or star closure of $\{1,0,1\}$?

Thanks.

3

There are 3 best solutions below

5
On BEST ANSWER

$L(1+01)=\{1,01\}$, so it’s the star closure of $\{1,01\}$, which consists of all strings over the alphabet $\{0,1\}$ in which every $0$ (if there is one) is immediately followed by a $1$.

0
On

Think of it this way - let $\alpha = 1 + 01$. Therefore, $L = \alpha^\star$. That is, $L$ consists of $\lambda$, the empty string, and one or more $\alpha$. But $\alpha$, in turn, is either $1$ or $01$. This is exactly the language that the previous reply describes.

0
On

The star closure of $\{1,0,1\}$ is the star closure of $\{0,1\}$, because $\{1,0,1\} = \{0,1\}$. Clearly that language is not $L((1+01)^*)$, which is all strings over $\{0,1\}$ with no two consecutive $0$s.