Different classes of automata exist; examples include finite automata and pushdown automata. Of these, the finite automaton is the simplest. In the Chomsky hierarchy, Type-3 (regular) languages are recognised by finite automata.
A finite automaton M is a 5-tuple
M = (Q, Σ, q0, δ, F)
The following figure is an example of a finite automaton M:
For the automaton shown above, its components can be identified as follows.
δ(q0, a) = q1
This means: given the current state q0 and the input symbol a, the automaton moves (transits) to state q1.
Other example transitions (from the figure) are:
δ(q1, b) = q2
δ(q2, c) = q3
δ(q1, c) = q4
δ(q3, b) = q4
A finite automaton is often represented as a transition diagram, where states are nodes and transitions are labelled arrows. The same automaton can also be described by a transition table that lists, for every state and input symbol, the resulting state(s).
Notation used in diagrams or tables:
Informally, a finite automaton is used to check whether an input string is valid according to the rules encoded by its transitions. Formally, for a deterministic automaton the extended transition function δ* : Q × Σ* → Q maps a state and a string to the state reached after processing the entire string. For nondeterministic automata δ* maps to a set of states. A string w ∈ Σ* is accepted by M if the state(s) reached after processing w include at least one state from F. The language of M is L(M) = { w ∈ Σ* | M accepts w }.
Example 1:
Consider the following finite automaton M:
Check whether the string abcb is accepted by this automaton.
Processing begins at the start state q0. Each line below shows the extended transition after reading the next symbol of the string.
δ(q0, abcb) = q1
δ(q1, abcb) = q2
δ(q2, abcb) = q3
δ(q3, abcb) = q4
After processing the whole string we end in q4, which is a final state. Therefore the string abcb is accepted by M.
Example 2:
Consider the finite automaton M shown below:
Check whether the string abc is accepted by M.
Processing from the start state q0:
δ(q0, abc) = q1
δ(q1, abc) = q2
δ(q2, abc) = q3
After processing all symbols the automaton halts at q3. Since q3 is not a final state, the string abc is rejected by M.
Example 3:
Consider the finite automaton M:
Check whether the string abca is accepted by M.
Processing from q0:
δ(q0, abca) = q1
δ(q1, abca) = q2
δ(q2, abca) = q3
At this point we must process the final symbol a from state q3, but there is no transition defined for (q3, a).
Because the automaton cannot process the entire input string, the string abca is rejected by M.
Given a finite automaton M, its language L(M) consists of all strings accepted by M. For the automaton shown below:
Examples of membership in the language L(M):
Finite automata are classified mainly into two types:
An NFA allows, from a given state and input symbol, multiple possible next states (or no next state). Thus the next move is not uniquely determined by the current state and the input symbol. Formally, for an NFA the transition function is
δ : Q × (Σ ∪ {ε}) → P(Q)
where P(Q) denotes the power set of Q and ε denotes the empty (epsilon) transition if epsilon transitions are present.
Example:
In the figure above, from state q0 with input symbol 0 there are two possible next states: q0 or q1. From q1 on input 1 the next state can be q1 or q2. Such nondeterministic choices characterise an NFA.
Example 1:
Consider the NFA below:
Check whether the string 0100 is accepted.
Processing along one possible path from the start state q0:
δ(q0, 0100) = q0
δ(q0, 0100) = q0
δ(q0, 0100) = q3
δ(q3, 0100) = q4
Since q4 is a final state, the string 0100 is accepted by the NFA (existence of at least one accepting path is sufficient).
Example 2:
Consider the NFA:
Check whether the string 01101 is accepted.
One possible sequence of moves is:
δ(q0, 01101) = q0
δ(q0, 01101) = q0
δ(q0, 01101) = q0
δ(q0, 01101) = q1
δ(q1, 01101) = q2
Since q2 is final, the string 01101 is accepted.
Example 3:
Consider the NFA shown below:
Check whether the string abbaa is accepted.
One accepting path is:
δ(q0, abbaa) = q0
δ(q0, abbaa) = q0
δ(q0, abbaa) = q1
δ(q1, abbaa) = q2
δ(q2, abbaa) = qf
qf is a final state, so abbaa is accepted.
An NFA may include transitions labelled with ε (epsilon). An ε-transition moves the automaton from one state to another without consuming any input symbol. Epsilon transitions allow the automaton to change state spontaneously. The ε-closure of a state is the set of states reachable from it by zero or more ε-transitions.
Example:
Check whether the string 100110 is accepted.
One sequence of moves:
δ(q0, 100110) = q0
δ(q0, 100110) = q0
δ(q0, 100110) = q0
δ(q0, 100110) = q1
δ(q1, 100110) = q2
δ(q2, 100110) = q2
δ(q2, ε) = q4
Since q4 is final, the string 100110 is accepted. Note that the ε-move from q2 to q4 did not consume any input symbol.
Example 2:
Consider the NFA:
Check whether the string 0012 is accepted.
Processing along one path:
δ(q0, 0012) = q0
δ(q0, 0012) = q0
δ(q0, ε) = q1
δ(q1, 0012) = q1
δ(q1, ε) = q2
δ(q2, 0012) = q2
q2 is final, so 0012 is accepted.
A DFA is a finite automaton in which, for every state and every input symbol, there is exactly one defined next state and no ε-transitions. Formally,
δ : Q × Σ → Q
In a DFA, the next move is uniquely determined by the current state and the input symbol.
Example:
In the automaton above the input alphabet is {0, 1, 2}. From every state and for every symbol there is exactly one transition defined; hence the machine is deterministic. No ε transitions are present in a DFA.
Example 1:
The following transition diagram is a DFA:
The same DFA can be written as a transition table:
Check whether the string aaba is accepted.
Processing from the start state q0:
δ(q0, aaba) = q0
δ(q0, aaba) = q0
δ(q0, aaba) = q1
δ(q1, aaba) = q1
After processing all symbols the automaton reaches q1, which is a final state. Therefore aaba is accepted.
Example 2:
Consider the DFA shown below and check whether the string aabba is accepted.
One path of deterministic transitions yields:
δ(q0, aabba) = q0
δ(q0, aabba) = q0
δ(q0, aabba) = q1
δ(q1, aabba) = q0
δ(q0, aabba) = q0
After processing the whole string the automaton ends in q0, which is not a final state. Thus aabba is rejected.
A finite automaton is a simple, yet powerful mathematical model for recognising regular languages. Its formal definition M = (Q, Σ, q0, δ, F) captures the essential elements: states, input alphabet, start state, transition function and accepting states. Deterministic and nondeterministic variants are equivalent in expressive power, and both are fundamental tools in theory and practice for processing and recognising regular patterns.
| 1. What is a finite automaton in computer science engineering? | ![]() |
| 2. What is the significance of finite automata in computer science engineering? | ![]() |
| 3. How does a finite automaton differ from a regular expression? | ![]() |
| 4. Are all problems solvable using finite automata? | ![]() |
| 5. What are the different types of finite automata? | ![]() |
![]() | Explore Courses for Computer Science Engineering (CSE) exam |
![]() | Get EduRev Notes directly in your Google search |