retagged by
2,312 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 ________.
retagged by

3 Answers

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

2.2k
views
2 answers
1 votes
Arjun asked Feb 16
2,190 views
Let $A$ and $B$ be non-empty finite sets such that there exist one-to-one and onto functions $\text{(i)}$ from $A$ to $B$ and $\text{(ii)}$ from $A \times A$ to $A \cup B...
3.2k
views
1 answers
3 votes
Arjun asked Feb 16
3,166 views
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.Operator PrecedenceAssociativity+Highest Left-HighR...
2.4k
views
2 answers
2 votes
Arjun asked Feb 16
2,392 views
The number of spanning trees in a complete graph of $4$ vertices labelled $\text{A, B, C,}$ and $\text{D}$ is _________.
2.0k
views
1 answers
2 votes
Arjun asked Feb 16
2,022 views
Consider the following two relations, $R(A, B)$ and $S(A, C)$:$R$$A$$B$$10$$20$$20$$30$$30$$40$$30$$50$$50$$95$$S$$A$$C$$10$$90$$30$$45$$40$$80$The total number of tuples...