Programming
120 marks] Write regular expressions and design a DFA that accepts exactly the strings over the alphabet {A, B,…, Z} in which every double ‘0’ (i.e., pair of consecutive ‘O’s) occurs before every double ‘E’ (i.e., pair of consecutive ‘E’s).
Empty strings should be accepted as well.
For instance, your DFA should accept the strings “FOOD FOR THOUGHT”, “LOOK AT THE SHEEP”, “DO NOT FEED THE PIGEONS”, and “I LOVE CPSC” but not “THIS BEEF IS GOOD”. Clearly indicate the meaning of each state. You can use A—C, F—H to represent letter intervals in your DFA labels, i.e., A —C, F—H means A, B, C, F, G, H.
Write regular expressions and design a DFA that accepts exactly the strings over the alphabet {A, B,…, Z} in which every double ‘0’ (i.e., pair of consecutive ‘O’s) occurs before every double ‘E’ (i.e., pair of consecutive ‘E’s).