• retagged by
3,409 views
0 0 votes

According to the given language, which among the following expressions does it correspond to ?

Language $L=\{x\in\{0,1\}\mid x\text{ is of length 4 or less}\}$.

  1. $(0+1+0+1+0+1+0+1)^4$
  2. $(0+1)^4$
  3. $(01)^4$
  4. $(0+1+\varepsilon)^4$

6 Answers

3 3 votes

Given that,  $L=\{x\in \{0,1\}|x\; \text{is length 4 or less}\}$

$\text{Expression (E)} =$ Length $4$ or less means, length $0$ or length $(1)$ or length $(2)$ or length $(3)$ or length $4$

$E = \varepsilon + (0+1)^{1} + (0+1)^{2}+(0+1)^{3} + (0+1)^{4} = (\varepsilon+0+1)^{4}$

So, the correct answer is $(D).$

References:

• edited by
1 1 vote
When length is less than or equal to n then regular expression is $(0+1+ epsilon)^n$

Why epsilon is needed? Else we will get only strings of length n.

So D is correct.
0 0 votes
$\text{option A, B, C does not generate minimal string of length 0 --- } \epsilon$

hence option D is correct answer
0 0 votes
The extended notation would be (0+1)4 but however, we may allow some or all the factors to be ε. Thus ε needs to be included in the given regular expression.

correct option -D
0 0 votes
It means length of string atmost 4 .

$\left ( \epsilon \right ) + \left (0+1 \right )+\left ( 0+1 \right )^{2} +\left ( 0+1 \right )^{3}+\left ( 0+1 \right )^{4} = \left ( \epsilon +0+1 \right )^{4}$
Answer:
Position:
Show:

Related questions

1 1 vote
3 3 answers
2.8k
2.8k views
admin asked Mar 30, 2020
2,766 views
A regular expression is $(a+b^{\ast}c)$ is equivalent toset of strings with either $a$ or one or more occurrence of $b$ followed by $c$.$(b^{\ast}c+a)$set of strings with...
1 1 vote
4 answers 4 answers
2.2k
2.2k views
admin asked Mar 30, 2020
2,229 views
What is the meaning of regular expression $\Sigma^*001\Sigma^*$?Any string containing ‘$1$’ as substringAny string containing ‘$01$’ as substringAny string containing ‘$0...
0 0 votes
2 2 answers
1.0k
1.0k views
admin asked Mar 30, 2020
1,019 views
Which of the following regular expression is equal to $(r_1+r_2)^*$?$r_1^*r_2^*$$(r_1r_2)^*$$r_1^*r_2^*+r_1r_2$$(r_1^*r_2^*)^*$
1 1 vote
3 3 answers
2.0k
2.0k views
admin asked Mar 30, 2020
1,989 views
Which of the following is equivalent regular expressions?$((01)^*(10)^*)^*$$(10+01)^*$$(01)^*+(11)^*$$(0^*+(11)^*+0^*)^*)$(i) and (ii)(ii) and (iii)(iii) and (iv)(iv) and...