Search code examples
regexwildcardmatchingautomatafinite-automata

How to understand DFA (Finite Automata)?


Indicate the state that the DFA will end in after processing each of the following input strings. Note: the input labeled "The empty string" is literally the empty string—a string with no letters in it—not the letters 'T', 'h', 'e', ' ', 'e', and so forth.

enter image description here

For the string = abcba, do I end in state 2?

Also, what is that double circle means?


Solution

  • Yes, after abcba, you end in state 2.

    The double-circle usually indicates an accepting state -- in the DFA for a regular expression, the string you've received so far matches the regular expression iff you're in an accepting state.

    If a regular expression matches the empty string then the start state will also be an accepting state, as is the case here.