Let $L=\{ w \in \:(0+1)^* \mid w\text{ has even number of }1s \}$. i.e., $L$ is the set of all the bit strings with even numbers of $1$s. Which one of the regular expressions below represents $L$?
@abhishek_(123)
Option B can construct 110101 →
First two 1 and one 0 using (10*10*) => 110
Next 101 using (10*10*) => 101
How would you create the 0 (in the middle) for 011011 using option b ?
had it been 0*(0*10*10*)* , then we could have produced 011011.
How will option B generate 11101
011011 production from B:
0*(10*10*)*: 0(110)(11)
@nbnb you can check like this
0*(10*10*)(10*10*) it will generate all type of strings 11110,11101,11011,10111,01111
or any type of string you want just put the number at place of *
I hope you will get it.
0$^{*}$(10$^{*}$10$^{*}$)$^{*}$ produce set of all the bit strings with even numbers of 1s.
@Chuzu
$0^*(10^*10^*)(10^*10^*)0^*(10^*10^*)^*$
$\epsilon(1\epsilon1\epsilon)(1\epsilon1\epsilon)0\epsilon=11110$
@Doodle) answer clearly explains-- in option C strings of the type 011011 (0 between 2nd and 3rd 1) are not generated..
String "01011010" cannot be generated by Option B. Please guide.
B can’t generate 1100 so how can B be the answer?
Prasanna how from option C u generate 1 as substring??
Devwritt
U have edited the option but the explanation for C is wrong. as here the option C can generate 11011...but in the actual paper the option C was different.
method 1: draw the DFA and then derive reg ex from it
method 2: by verification
option a. does n't generates strings ending with 0 ex:1100
option c :does n't generates strings like 110011,1101111,011011,...i.e it does n't producing 0 between 2nd 1 and 3rd 1 in the string
option d: does n't generate $\epsilon$
option b: is the answer
64.3k questions
77.9k answers
244k comments
80.0k users