• edited by
21,091 views
47 47 votes

Which one of the following languages over the alphabet $\{0,1\}$ is described by the regular expression: $(0+1)^*0(0+1)^*0(0+1)^*$?

  1. The set of all strings containing the substring $\text{00}$
  2. The set of all strings containing at most two $\text{0}$'s
  3. The set of all strings containing at least two $\text{0}$'s
  4. The set of all strings that begin and end with either $\text{0}$ or $\text{1}$

7 Answers

Best answer
51 51 votes

Correct Option: C

Counter example for other choices:

  1. $1010$ is accepted which doesn't contain $00$
  2. $000$ is accepted
  3. is the answer.
  4. $01$ is not accepted
• edited by
17 17 votes

a) all string contain substring 00

regular expression = Anything 00 Anything  = (0+1)*00(0+1)*  

b)all string contain atmost two 0's

regular expression = only 2 zeros  + only 1 zero  + No zero = Anthing 0 Anything 0 Anything + Anything 0 Anything  + Anything = 1*01*01* + 1*01* + 1* 

here anything means that is made of only 1's bcoz we have to restrict 0 (only two or less) so anything cannot include 0.

c) all string contain atleast two 0's

regular expression = Anything 0 Anything 0 Anything = (0+1)*0(0+1)*0(0+1)*

d) all strings that begin and end with either 0 or 1

regular expression = either 0 or 1  Anything either 0 or 1 = (0+1)(0+1)*(0+1)

1 1 vote
​​​​​​C. As the regular expression will have atleast 2 0’s.
0 0 votes
The regular expression has two 0′s surrounded by (0+1)* which means accepted strings must have at least 2 0′s.

So, C is the answer
0 0 votes

Option A is false, as the regular expression generates string “010” which doesn’t have “00” as substring.

Option B is false, as we can have the string “000” from the given regular expression, which has more than two 0’s.

Option D is false, as we cannot generate the string “01” from the given regular expression and according to option D, string “01” must be generated by regular expression, which clearly shows option D is not correct language as per regular expression.

0 0 votes
Loos at the expression it is telling you that You can take anything but you have to take that Two zeroes which are already in the expression rather than that you can go for another zeroes also but two 0s are mandatory so C is the ans
Answer:
Position:
Show:

Related questions

62 62 votes
11 answers 11 answers
31.1k
31.1k views
Kathleen asked Sep 22, 2014
31,066 views
The above DFA accepts the set of all strings over $\{0,1\}$ that begin either with $0$ or $1$.end with $0$.end with $00$.contain the substring $00$.
63 63 votes
7 answers 7 answers
23.2k
23.2k views
Kathleen asked Sep 22, 2014
23,204 views
Let $L = L_1 \cap L_2 $, where $L_1$ and $L_2$ are languages as defined below:$L_1= \left \{ a^m b^mca^nb^n \mid m,n \geq 0 \right \}$$L_2=\left \{ a^i b^j c^k \mid i,j,k...
60 60 votes
8 answers 8 answers
24.2k
24.2k views
Kathleen asked Sep 22, 2014
24,178 views
Which one of the following is FALSE?There is a unique minimal DFA for every regular languageEvery NFA can be converted to an equivalent PDA.Complement of every context-fr...
50 50 votes
11 answers 11 answers
31.6k
31.6k views
Kathleen asked Sep 22, 2014
31,609 views
$$S \to aSa \mid bSb\mid a\mid b$$The language generated by the above grammar over the alphabet $\{a,b\}$ is the set of:all palindromesall odd length palindromesstrings t...