The condition is there should be one 1 more than 0 in the language. So, the language of the strings would be:
{1,011,110,101,00111,….}
Now lets see each option:
- 0*1: Here, * can produce any number of 0’s ie 001 will also be generated by this regex which is not part of our language – False
- (0+1)*1(0+1)*: Here, we can have strings like 010 which is not the part of our language – False
- (0+1)*1(0+1)* + 1(0+1)*- Here also we can have strings like 010, 100,… -False
Hence, answer should be option D.
Also,
We can think as for generating this language, we would need to remember the number of 0’s which needs memory. So, cannot be done by a dfa. We need a PDA for it
Hence, option D