How to find a regular expression t over the alphabet $\{0,1\}$?

96 Views Asked by At

How to find a regular expression $t$ over the alphabet $\{0,1\}$ such that the language defined by $t$ is :

a) All words that begin with $0$ or end with $1$

b) All words that contain at least one $0$ and at least one $1$

c) All words that have length at least $2$ and whose last but one symbol is $0$

I just wrote down some expressions following the text:

a) $t= (0|1)1^*$ we have that the word will begin with $0$ or $1$ and will finish with $1$s

b) $t= 010^*$ we have a word that contain at least one $0$ and at least one $1$, but I don't know if it is correct because it asks for all the words

c) $t= 11^*0$ so we have atleast two symbols that end with $0$.

I was thinking that for the all of the above expressions there are a lot of ways to write them down for example I could have written:

b) $01010$

c) $000110$

Am I right?