Introduction to nondeterministic finite automaton

Overview

nondeterministic finite automaton has one or more than one transition from one state to another or itself.

An NFA requires less space than a DFAdeterministic finite automaton for its construction. Moreover, a trap stateA state from which a transition can not escape. Also called a "dead state". is not required for an NFA.

Components of an NFA

Assume an NFA for a language L with the five tuples <Q,Σ,q0,δ,F><Q, Σ, q_0, δ, F> where

  • QQ is the finite set of states.
  • ΣΣ is the input symbols.
  • q0q_0 is the start state.
  • δδ is the transition function.
  • FF is the final state.

It is to be noted that δ:Q×Σ2Qδ: Q \times Σ \rightarrow 2 ^ Q. This means that the next possible states belong to the power set of QQ.

Example

The following is an example of an NFA, where q0q_0 is the start state.

g ENTRY q0 q0 ENTRY->q0 q4 q4 q0->q4   b q1 q1 q0->q1   a q2 q2 q0->q2   a q1->q0   a q3 q3 q2->q3   a q3->q0   b
NFA

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved