RGPV 2015
Q. Design DFA accepting the following languages over the alphabet {0, 1}
- The set of all words ending in 00.
- The set of all words except ε.
- The set of all words that begin with 0.
Ans.
1. The set of all words ending with 00:
Some example strings = {00, 100, 000, 1000,0100,11100}
Regular expression = (0+1)*00
2. The set of all words except ε:
Some example strings = {0, 1, 00, 10, 01, 11, 000000, 11111}
Regular expression = (0+1)(0+1)*
3. The set of all words that begin with 0:
Some example strings = {0, 01, 00000, 0101010101}
Regular expression = 0(0+1)*