go to previous page   go to home page   go to next page

Which of the following strings match [BD][ae][ae]?d     ?

Answer:

StringBedBeadDeadaedBa?dDedBea
Match or
Reject?
Match Match Match Reject Reject Match Reject

The RE     [BD][ae]\?d     matches the strings Ba?d , Be?d , De?d , and Da?d . The question mark has been "escaped" with the backslash, and so does not function in its special role but merely stands for itself.


Automaton for Zero or One

three state finite automaton

An automaton for a?bc requires an optional state for the transition that is made when an optional 'a' is consumed.

The state q1 is reached when the optional 'a' is consumed. There then must be a transition out of that state for the following 'b'.


QUESTION 15:

Could we make the transition for 'a' out of state q0 loop back to q0?     Would this avoid the need for state q1?