I am learning about automata and finite state machines. Consider the following automaton, that accepts the word 'ab', does not have to be infinite, just once:
alphabet: 'a','b' states: 1,2, 3 (3 is the final state and 1 is the initial state)
state 1, symbol a, state 2 state 2, symbol b, state 3
First part of my questions:
Question 1. Is it required to add self-loops at 1 for 'b', and a self-loop for 'a' at 2?
Question 2. What about at state 3(final)? Should I add self-loops for 'a' and 'b'?
I basically need to know, how to design my final state. So that even if my alphabet was expanded (say a, b, c), and I have a 'dump' state, with the following transitions:
state 1, symbol a, state 2 state 1, symbol b or c, state dump state 2, symbol b, state 3 state 2 symbol a or c, state dump
Question 3. Now from final state 3, should I add a transition to dump state, with symbol values a,b,c ???
Your assistance is much appreciated.