i.e, L is the set of all bit strings with even number of 1s. Which one of the regular expressions below represents L?
A
0∗1(10∗1)∗10∗
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
0∗(10∗10∗)∗
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
(0∗10∗1)∗
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
0∗(10∗1)∗0∗
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B0∗(10∗10∗)∗ Choice (a) (0∗10∗1)∗
will always generate strings ending with 1. But we want an expression for bit strings with even no of 1's, which includes strings like "110" which ends with 0.
So, choice(a) is not correct.
Choice (c) 0∗(10∗1)∗0∗
"1010101" ∉0∗(10∗1)∗0∗
but "1010101" has even number of 1's. So choice (c) is incorrect.
Choice (d) λ∉0∗1(10∗1)∗10∗
but "λ" is a bit string with even no of 1's (zero 1's). So choice (d) is incorrect.
Choice (b) can generate all bit strings with even no of 1's. So choice (b) is correct.