0% found this document useful (0 votes)
34 views10 pages

Analog Transmission 1

Nondeterministic finite automata (NFA) generalize deterministic finite automata (DFA) by allowing transitions from each state based on an input symbol to multiple possible next states rather than just one. An NFA is defined as a 5-tuple like a DFA but the transition function δ maps to the power set of states rather than a single state. While every DFA can be represented as an NFA, not every NFA can be represented as a DFA. The document provides an example NFA and demonstrates how to check if an input string is accepted by tracing the transitions.

Uploaded by

Sania Min
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views10 pages

Analog Transmission 1

Nondeterministic finite automata (NFA) generalize deterministic finite automata (DFA) by allowing transitions from each state based on an input symbol to multiple possible next states rather than just one. An NFA is defined as a 5-tuple like a DFA but the transition function δ maps to the power set of states rather than a single state. While every DFA can be represented as an NFA, not every NFA can be represented as a DFA. The document provides an example NFA and demonstrates how to check if an input string is accepted by tracing the transitions.

Uploaded by

Sania Min
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Nondeterministic Finite Automata (NFA)

Afsana Afrin
Lecturer
Dept of Computer Science and Engineering
Bangladesh Army University of Science & Technology

05-Jul-20 Nondeterministic Finite Automata 1


NFA

 NFA stands for non-deterministic finite automata.


 For the NFA, δ is a function that takes a state and input symbol
as arguments, but returns a set of zero, one , or more states.
 Every NFA is not DFA, but each NFA can be translated into
DFA.
 NFA is defined in the same way as DFA but with the following
two exceptions, it contains multiple next states, and it contains ε
transition.

05-Jul-20 Nondeterministic Finite Automata 2


Formal definition of a NFA

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

 Q is a finite set of states.


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

05-Jul-20 Nondeterministic Finite Automata 3


Example

Let a nondeterministic finite automaton be →


Q = {q0, q1, q2},
∑ = {0, 1},
q0 = {q0},
F = {q2}, and Transition function δ as shown by the following
table −

Present state Next State for Next State for


Input 0 Input 1
→q0 {q0, q1} {q1}
q1 {q2} {q0}
*q2 {q2} {q1, q2}

05-Jul-20 Nondeterministic Finite Automata 4


Example

Present state Next State for Next State for


Input 0 Input 1
→q0 {q0, q1} {q1}
q1 {q2} {q0}
*q2 {q2} {q1, q2}

05-Jul-20 Nondeterministic Finite Automata 5


Transition function

δ represents the transition with the assistance of inputs from one


state to another.
δ(q0,0)={q0, q1}
δ(q0,1)={q1}
δ(q1,0)={q2}
δ(q1,1)={q0}
δ(q2,0)={q2}
δ(q2,1)={q1,q2}

05-Jul-20 Nondeterministic Finite Automata 6


Input String acceptance

An input string will be accepted only when it will start to transit


from starting state and final input makes a transition to final
state.
Suppose that a input sting 10101010, now we have to check
either it is accepted or rejected for the following NFA.

05-Jul-20 Nondeterministic Finite Automata 7


Input String acceptance
Input String=10101010

Checking:
Input-1 and Transition δ(a,1)=b where a is starting state
Input=0 and Transition δ(b,0)=c
Input=1 and Transition δ(c,1)=c
Input=0 and Transition δ(c,0)=b
Input=1 and Transition δ(b,1)=a
Input=0 and Transition δ(a,0)=a
Input=1 and Transition δ(a,1)=b
Input=0 and Transition δ(b,0)=c where c is a final state.
State Sequence-> a-b-c-c-b-a-a-b-c
So the input string 10101010 is accepted.

05-Jul-20 Nondeterministic Finite Automata 8


Exercise

Check the following string patterns whether accepted or rejected

i. 101011010
ii. 111000110

05-Jul-20 Nondeterministic Finite Automata 9


Thank You

05-Jul-20 Nondeterministic Finite Automata 10

You might also like