retagged by
24,498 views
24 votes
24 votes

Which one of the following regular expressions represents the set of all binary strings with an odd number of $1’$s?

  1. $((0+1)^*1(0+1)^*1)^*10^*$
  2. $(0^*10^*10^*)^*0^*1$
  3. $10^*(0^*10^*10^*)^*$
  4. $(0^*10^*10^*)^*10^*$
retagged by

3 Answers

Best answer
42 votes
42 votes
Regular expression in option A cannot generate $001$
Regular expression in option B cannot generate $100$
Regular expression in option C cannot generate $001$
Regular expression in option D cannot generate $001$

Hence, mark was given to everyone in GATE for this question.
selected by
3 votes
3 votes
Taking each option 1-by-1:

Option A:  it is not generate 01 which has odd number of 1.

Option B: it is not generate 10 which has odd number of 1.

option C: it is not generate 01 which has odd number of 1 i.e. force to start with 1 only.

Option D is also not generate 01.

So none of them is correct
edited by
1 votes
1 votes
[(0+1)*1(0+1)*1]*10* cannot generate "01".

(0*10*10*)*0*1 cannot generate "10"

10*(0*10*10*)* cannot generate "01"

(0*10*10*)*10* cannot generate "01".

All given options are wrong. No option generates the set of all binary strings with an odd number of 1's. The following expressions represents the set of all binary strings with odd number of 1's.

I. (0*10*10*)0*10*

II. 0*10*(0*10*10*
Answer:

Related questions

13.9k
views
3 answers
17 votes
Arjun asked Feb 12, 2020
13,905 views
Consider the following statements.If $L_1 \cup L_2$ is regular, then both $L_1$ and $L_2$ must be regular.The class of regular languages is closed under ... the above statements is/are TRUE?Ⅰ onlyⅡ onlyBoth Ⅰ and ⅡNeither Ⅰ nor Ⅱ
20.5k
views
7 answers
29 votes
Arjun asked Feb 12, 2020
20,529 views
Consider the language $L = \{a^{n}\mid n \geq 0\} \cup \{a^{n}b^{n}\mid n \geq 0\}$ and the following statements.$L$ ... for any $k$. Which of the above statements is/are TRUE?Ⅰ onlyⅡ only Ⅰ and Ⅲ onlyⅢ only
7.7k
views
4 answers
31 votes
Arjun asked Feb 12, 2020
7,685 views
Raman is confident of speaking English _______six months as he has been practising regularly_______the last three weeksduring, forfor, sincefor, inwithin, for
6.1k
views
6 answers
8 votes
Arjun asked Feb 12, 2020
6,052 views
His knowledge of the subject was excellent but his classroom performance was_______.extremely poorgooddesirablepraiseworthy