28 views
Identify from the list below the regular expression that generates all and only the strings over alphabet {0,1} that end in 1.

(0*1*)+1

(0+1)*1+1

(0*+1)+

(0*1)
| 28 views
0
$(0+1)^*1+1$
0

Are the options right ?

1. (0*1*)+1 - is this $(0^*1^*)+1$ or $(0^*1^*)^+1$ ?
2. (0+1)*1+1 - is this $(0+1)^*1+1$ or $(0+1)^*1^+1$

In any case, I think the answer will be the 2nd one.

0

@ But (2) is not generating ε. Right?

0

That's the whole point - it should not generate $\epsilon$ !

Question says

generates all and only the strings over alphabet {0,1} that end in 1

0

@shashin yes you are right sry missed it