Lec 05-Finite Automata
Lec 05-Finite Automata
Finite Automata
2
Definition
• A finite automaton is a collection of three things:
3. A finite set of transitions that tell for each state and for each
letter of the input alphabet which state to go next.
3
How Does a Finite Automaton work?
• This sequence ends when the last input letter has been read
4
Example
• The set of all strings that lead to a final state is called the language
defined by the finite automaton.
• Thus, the string aaa is not in the language defined by this FA.
• We may also say that the string aaa is not accepted by this FA, or the
string aaa is rejected by this FA.
• The set of all strings accepted is also called the language associated with
the FA.
7
Example contd.
• If an input string is made up of only letter a’s then the action of the FA will
be to jump back and forth between state x and state y.
• To get to state z, it is necessary for the string to have the letter b in it. As
soon as a b is encountered, the FA jumps to state z. Once in state z, it is
impossible to leave. When the input string runs out, the FA will be in the
final state z.
• This FA will accept all strings that have the letter b in them. Hence, the
language accepted by this FA is defined by the regular expression
(a + b)*b(a + b)*
8
Abstract definition of FA
10
Transition Diagrams
• We draw arrows showing to which other states the different input letters will lead
us. We label these arrows with the corresponding input letters.
• We indicate the start state by a minus sign, or by labeling it with the word start.
• We indicate the final states by plus signs, or by labeling them with the word final.
11
Transition Diagram (cont.)
12
Transition Diagram (cont.)
13
Transition Diagram (cont.)
14
Transition Diagrams contd.
18
Example
• The second type include FAs of which the final states can not
be reached from the start state.
19
Example
20