Skip to main content
Engineering LibreTexts

Finite Automata

  • Page ID
    50518
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    A finite automaton (FA) is a simple idealized machine used to recognize patterns within input taken from some character set (or alphabet) C. The job of an FA is to accept or reject an input depending on whether the pattern defined by the FA occurs in the input.

    Finite Automaton can be classified into two types −

    • Deterministic Finite Automaton (DFA)
    • Non-deterministic Finite Automaton (NDFA / NFA)

    Deterministic Finite Automata

    In DFA, for each input symbol, one can determine the state to which the machine will move. Hence, it is called Deterministic Automaton. As it has a finite number of states, the machine is called Deterministic Finite Machine or Deterministic Finite Automaton.

    Formal Definition of a DFA

    A DFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −

    1. Q is a finite set of states.
    2. is a finite set of symbols called the alphabet.
    3. δ is the transition function where δ: Q × ∑ → Q
    4. q0 is the initial state from where any input is processed (q0 ∈ Q).
    5. F is a set of final state/states of Q (F ⊆ Q).

    Graphical Representation of a DFA

    A DFA is represented by digraphs called state diagrams.

    • The vertices represent the states.
    • The arcs labeled with an input alphabet show the transitions.
    • The initial state is denoted by an empty single incoming arc.
    • The final state is indicated by double circles.

    Non deterministic Finite Automata

    In NDFA, for a particular input symbol, the machine can move to any combination of the states in the machine. In other words, the exact state to which the machine moves cannot be determined. Hence, it is called Non-deterministic Automaton. As it has a finite number of states, the machine is called Non-deterministic Finite Machine or Non-deterministic Finite Automaton.

    Formal Definition of an NDFA

    An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −

    1. Q is a finite set of states.
    2. is a finite set of symbols called the alphabets.
    3. δ is the transition function where δ: Q × {∑ ∪ ε} → 2Q (Here the power set of Q (2Q) has been taken because in case of NDFA, from a state, transition can occur to any combination of Q states)
    4. q0 is the initial state from where any input is processed (q0 ∈ Q).
    5. F is a set of final state/states of Q (F ⊆ Q).

    Graphical Representation of an NDFA − (same as DFA)

    An NDFA is represented by digraphs called state diagrams.

    • The vertices represent the states.
    • The arcs labeled with an input alphabet show the transitions.
    • The initial state is denoted by an empty single incoming arc.
    • The final state is indicated by double circles.

    Videos:

    Construction of DFA

     

    LeD 1

     

    DFA Construction

     

    LeD 2

     

    LeD 3

     

    LeD 4

     

    LeD 5

     

    LeD 6

    Question Bank:

    Download: Question Bank.doc

    Course Materials

    Download: Lecture1.ppt

    Download: Lecture2.ppt

    Download: DFA.ppt

    Download: NDFA.pptx

    Contributors and Attributions

    • Deepika Dash

    Finite Automata is shared under a CC BY license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?