πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

NFA (Non-Deterministic finite automata)

Non-Deterministic Finite Automata (NDFA or NFA) is an automata which accept all regular languages whether they are finite or infinite. So All DFA are NFA but not vice versa.

Very important In NFA is that,

  • Empty String (epsilon) transition is possible.
  • No Need to specify the transition of each input from any state.

Formal Definition of NFA

A NFA can be represented by a 5-tuple (Q, βˆ‘, Ξ΄, q0, F) where

  • Q is a finite set of all states (q0, q1, q2,   … qn). where n is finite number
  • βˆ‘ is a finite set of symbols called the alphabet. i.e. {0, 1}.
  • Ξ΄ : Q x βˆ‘ β†’ 2Q is a total function called as transition function
  • q0 is the initial state from where any input is processed (q0 βˆˆ Q).
  • F is a set of final state/states where F will be subset ( βŠ† ) of Q.

Example of Non-Deterministic Finite Automata with Epsilon

Example of Non-Deterministic Finite Automata with epsilon is given under

Example of Non-Deterministic Finite Automata with Epsilon

The above NFA can be defined in form of five tuples as-

{Q {q0, q1, q2}, βˆ‘ {0, 1}, Ξ΄, S {q0}, F {q2} }

where

  • {q0, q1, q2} are set of states
  • {0, 1} are the set of input alphabets
  • Ξ΄ refers to the transition function
  • q0 refers to the the initial state
  • {q2} refers to the set of final state

Transition function Ξ΄ is defined as

  • Ξ΄ (q0, 1) = q1
  • Ξ΄ (q0, ∈) = q2
  • Ξ΄ (q1, 0) = q2

Transition Table for the above Non-Deterministic Finite Automata is

States / Alphabets01∈
q0–q1q2
q1q2––
q2–––

Example of Non-Deterministic Finite Automata without Epsilon

Following automata is an example of Non-Deterministic Finite Automata without epsilon

Example of Non-Deterministic Finite Automata Without Epsilon

The above NFA can be defined in form of five tuples as

{ Q{ q0,q1,q2}, βˆ‘{0,1}, Ξ΄, S{q0}, F{q2} }

  • set of states are {q0,q1,q2}
  • set of input alphabets are {0,1}
  • Ξ΄ refers to the transition function
  • initial state is q0
  • set of final states are {q2}

Transition function Ξ΄ can also defined as

  • Ξ΄ (q0, 1) = q1
  • Ξ΄ (q0, 1) = q2
  • Ξ΄ (q1, 0) = q2 

Transition Table for the above NDFA is

States / Alphabets01
q0–q1, q2
q1q2–
q2––

Equivalence of DFA and NFA

  • Two finite automata accepters are said to be equal in power if the both accepts the same language.
  • DFA and NFA both accept the similar languages because DFA and NFA can be constructed for any regular language. So, both exactly equal in power.

Important

  • Every NFA is converted into its equivalent DFA.
  • Every DFA is a NFA but every NFA is not a DFA.

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

<$CommentPager$>
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>