Gate2020 cs Q16

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

  • Option : B
  • Explanation :
    Eliminate the options.
    --Option (A) is incorrect, it forces the string to start with 1, we cannot generate strings like 01, 0111, ….
    -- Option (C) is incorrect, it generates string ending with 1, so cannot generate strings like 10, 1110
    -- Option (D), not always generates strings with odd 1’s as it can generate 110.
    -- Options (B), is correct, as it can generate all the string with odd number of 1’s.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *