in Theory of Computation edited by
1,498 views
2 votes
2 votes
Consider the following two regular expressions over the alphabet $\{0,1\}$ :

$r= 0^{*}+1^{*}$

$s = 01^{*} + 10^{*}$

The total number of strings of length less than or equal to $5$, which are neither in $r$ nor in $s$, is ________.
in Theory of Computation edited by
by
1.5k views

3 Answers

0 votes
0 votes

Answer: 44

0 votes
0 votes

answer : 44

0 votes
0 votes
1. zero length string epselon can be formed using r.

2. all string with length 1 {a,b} can be formed using r.

3. in string with length 3, total 8 strings can be formed as there is three digit and for every digit we can select either 0 or 1, so 2x2x2 = 8.

Now As per RE r = {000, 111} and s = {011, 100} will be formed using RE r and s.

so strings of length 3 not present in both RE will be = 8 - 4 = 4.

4. For length 4, Similarly as 3rd steps

total string = 2x2x2x2 = 16

total strings not present in r and s = 16 - 4{0000, 1111, 0111, 1000} = 12.

5. For length 5, Similarly as 3rd steps

total string = 2x2x2x2x2 = 32

total strings not present in r and s = 32 - 4{00000, 11111, 01111, 10000} = 28.

So total string of length less than equal to 5 which are not present in both RE r and s will be 4 + 12 + 28 = 44(Option A).
Answer:

Related questions