in Theory of Computation edited by
1,303 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

11 Comments

For $L_4$, b is not accepted.
1
1
sir $L_{4}=(b^{*}ab^{*}ab^{*}ab^{*})^{+}?$
0
0

can we write L1 as (110* + 0*110*+ 0*10*1+10*10*) ? 

I know L1=0*10*10*  covers it , but still is above is also correct?

0
0
No, that also won't accept b rt? We should allow no a's because 0 is divisible by 3.
0
0
Sir , i am not getting you .

If you are saying that my $L_{4}$ should accept $b$,then my $L_{4}$ is actually accepting $b$

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

 

Actually i too though that $n(a)=0$ should be accpeted as 0 is divisible by 3
0
0
yes, sorry I missed that. But you can avoid b* at end.
0
0
okk sir , thank you :)
0
0
thank you Sir
0
0
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