in Theory of Computation edited by
1,296 views
7 votes
7 votes

Find regular expressions for:

  1. All binary strings with exactly two $1’s$

  2. The set $\{a^nb^m :n\geq3, m$ is even$\}$

  3. All binary strings with a double symbol (contains $00$ or $11$) somewhere.

  4. The language on $\Sigma=\{a,b\}, L=\{w:n_a(w) \mod 3=0\}$

in Theory of Computation edited by
1.3k views

3 Answers

8 votes
8 votes
Best answer

$1.L_{1}=0^{*}10^{*}10^{*}$


$2.L_{2}=aaaa^{*}\left ( bb \right )^{*}$


$3.L_{3}=\left ( 0+1 \right )^{*}00\left ( 0+1 \right )^{*}+\left ( 0+1 \right )^{*}11\left ( 0+1 \right )^{*}$


$4.L_{4}=b^{*}(ab^{*}ab^{*}ab^{*})^{*}$

edited by

4 Comments

for L4 why not   b*(ab*ab*ab*)*   ?
0
0
@diksha , yes you are correct.Thanks
0
0

L4 can also be expressed as (b + ab*ab*a)*

0
0
1 vote
1 vote
solution

Ans1.   0*10*10*
0 votes
0 votes

.........

edited by

Related questions