Three regular expressions

106 Views Asked by At

1) {w|w w does not end in 01} Give a regular expression:

$$ 1^*0^* $$

2) {w|w w does not contain the substring 110} Give a regular expression:

$$ ((0∪10)^*1)^* $$

3) {w|w contains at least two 0s and at most one 1} Give a regular expression:

$$ 0^*10^* or \ 10^* or\ 010 \ or\ 000^*1 \ or\ 100\ or\ 0^*∪100^* $$

Do you agree? Thanks.

1

There are 1 best solutions below

2
On

Some errors:

1) $\mathtt{010} \in L_1$ but is not represented by your regular expression.

2) $\mathtt{1101} \notin L_2$, but can be produced by your expression.

3) $\mathtt{1} \notin L_3$, but can be produced by your expression.

I hope this helps $\ddot\smile$