Which of the following regular expressions, each describing a language of binary numbers (MSB to LSB) that represents non-negative decimal values, does not…
Which of the following regular expressions, each describing a language of binary numbers (MSB to LSB) that represents non-negative decimal values, does not include even values?
Where {+, *} are quantification characters.
Show answerHide answer
Correct answer: (C) 0*1*0*1+
Explanation
Odd binary numbers end with 1 in the LSB and even numbers end with 0. Only 0*1*0*1+ always ends with at least one 1, so its language contains no even values.