Introduction of Finite Automata
Last Updated :
25 Aug, 2025
Finite automata are abstract machines used to recognize patterns in input sequences, forming the basis for understanding regular languages in computer science.
- Consist of states, transitions, and input symbols, processing each symbol step-by-step.
- If ends in an accepting state after processing the input, then the input is accepted; otherwise, rejected.
- Finite automata come in deterministic (DFA) and non-deterministic (NFA), both of which can recognize the same set of regular languages.
- Widely used in text processing, compilers, and network protocols.
Figure: Features of Finite AutomataFeatures of Finite Automata
- Input: Set of symbols or characters provided to the machine.
- Output: Accept or reject based on the input pattern.
- States of Automata: The conditions or configurations of the machine.
- State Relation: The transitions between states.
- Output Relation: Based on the final state, the output decision is made.
A finite automaton can be defined as a tuple:
{ Q, Σ, q, F, δ }, where:
- Q: Finite set of states
- Σ: Set of input symbols
- q: Initial state
- F: Set of final states
- δ: Transition function
Types of Finite Automata
There are two types of finite automata:
- Deterministic Fintie Automata (DFA)
- Non-Deterministic Finite Automata (NFA)
1. Deterministic Finite Automata (DFA)
A DFA is represented as {Q, Σ, q, F, δ}. In DFA, for each input symbol, the machine transitions to one and only one state. DFA does not allow any null transitions, meaning every state must have a transition defined for every input symbol.
DFA consists of 5 tuples {Q, Σ, q, F, δ}.
Q : set of all states.
Σ : set of input symbols. ( Symbols which machine takes as input )
q : Initial state. ( Starting state of a machine )
F : set of final state.
δ : Transition Function, defined as δ : Q X Σ --> Q.
Example:
Construct a DFA that accepts all strings ending with 'a'.
Given:
Σ = {a, b},
Q = {q0, q1},
F = {q1}
Fig 1. State Transition Diagram for DFA with Σ = {a, b} | State\Symbol | a | b |
|---|
| q0 | q1 | q0 |
| q1 | q1 | q0 |
In this example, if the string ends in 'a', the machine reaches state q1, which is an accepting state.
2) Non-Deterministic Finite Automata (NFA)
NFA is similar to DFA but includes the following features:
- It can transition to multiple states for the same input.
- It allows null (ϵ) moves, where the machine can change states without consuming any input.
Example:
Construct an NFA that accepts strings ending in 'a'.
Given:
Σ = {a, b},
Q = {q0, q1},
F = {q1}
Fig 2. State Transition Diagram for NFA with Σ = {a, b}State Transition Table for above Automaton,
| State\Symbol | a | b |
|---|
| q0 | {q0,q1} | q0 |
| q1 | φ | φ |
In an NFA, if any transition leads to an accepting state, the string is accepted.
Comparison of DFA and NFA
Although NFAs appear more flexible, they do not have more computational power than DFAs. Every NFA can be converted to an equivalent DFA, although the resulting DFA may have more states.
- DFA: Single transition for each input symbol, no null moves.
- NFA: Multiple transitions and null moves allowed.
- Power: Both DFA and NFA recognize the same set of regular languages.
Explore
Automata _ Introduction
Regular Expression and Finite Automata
CFG
PDA (Pushdown Automata)
Introduction of Pushdown Automata
5 min read
Pushdown Automata Acceptance by Final State
4 min read
Construct Pushdown Automata for given languages
4 min read
Construct Pushdown Automata for all length palindrome
6 min read
Detailed Study of PushDown Automata
3 min read
NPDA for accepting the language L = {anbm cn | m,n>=1}
2 min read
NPDA for accepting the language L = {an bn cm | m,n>=1}
2 min read
NPDA for accepting the language L = {anbn | n>=1}
2 min read
NPDA for accepting the language L = {amb2m| m>=1}
2 min read
NPDA for accepting the language L = {am bn cp dq | m+n=p+q ; m,n,p,q>=1}
2 min read
Construct Pushdown automata for L = {0n1m2m3n | m,n ⥠0}
3 min read
Construct Pushdown automata for L = {0n1m2n+m | m, n ⥠0}
2 min read
NPDA for accepting the language L = {ambncm+n | m,n ⥠1}
2 min read
NPDA for accepting the language L = {amb(m+n)cn| m,n ⥠1}
3 min read
NPDA for accepting the language L = {a2mb3m|m>=1}
2 min read
NPDA for accepting the language L = {amb2m+1 | m ⥠1}
2 min read
NPDA for accepting the language L = {aibjckdl | i==k or j==l,i>=1,j>=1}
3 min read
Construct Pushdown automata for L = {a2mc4ndnbm | m,n ⥠0}
3 min read
NPDA for L = {0i1j2k | i==j or j==k ; i , j , k >= 1}
2 min read
NPDA for accepting the language L = {anb2n| n>=1} U {anbn| n>=1}
2 min read
NPDA for the language L ={wÐ{a,b}* | w contains equal no. of a's and b's}
3 min read
Turing Machine
Decidability
TOC Interview preparation
TOC Quiz and PYQ's in TOC