Docsity

Nondeterministic Finite Automata (NFA): Definition, Transition Function, and Language, Exams of Theory of Automata

Partial preview of the text

Download Nondeterministic Finite Automata (NFA): Definition, Transition Function, and Language and more Exams Theory of Automata in PDF only on Docsity!

Non-Deterministic

Finite Automata

q 1 q 2

q 3

a a

a

q 0

Alphabet set ={ a^ }

Nondeterministic Finite Accepter

(NFA)

q 1 q 2

q 3

a a

a

q 0

Two choices

Nondeterministic Finite Accepter

(NFA)

Alphabet set ={ a^ }

a a

q 0

q 1 q 2

q 3

a a

First Choice

a

a a

q 0

q 1 q 2

q 3

a a

First Choice

a

a a

q 0

q 1 q 2

q 3

a a

a (^) “accept”

First Choice

All input is consumed

a a

q 0

a q^1^ q^2

a

Second Choice

a

q 3

a a

q 0

a q^1^ q^2

a

a

q 3

Second Choice

No transition: the automaton hangs

An NFA accepts a string: when there is a computation of the NFA that accepts the string

all the input is consumed and the automaton is in a final state

AND

Example

aa is accepted by the NFA:

q 0

q 1 q 2 q 3

a a

a^ “accept” q 0 a q^1^ q^2 a

a

because this q^3^ “reject” computation

accepts aa

a

q 0

q 1 q 2

q 3

a a

a

First Choice

a

q 0

q 1 q 2

q 3

a a

a

First Choice

“reject”

Second Choice

a

q 0

a q^1^ q^2

a

a

q 3

Second Choice

a

q 0

a q^1^ q^2

a

a

q 3 “reject”