Non-Deterministic Finite Automata

1 / 78

# Non-Deterministic Finite Automata - PowerPoint PPT Presentation

Non-Deterministic Finite Automata. Nondeterministic Finite Automaton (NFA). Alphabet =. Alphabet =. Two choices. Alphabet =. Two choices. No transition. No transition. First Choice. First Choice. First Choice. First Choice. All input is consumed. “accept”. Second Choice.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Non-Deterministic Finite Automata' - veata

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Non-Deterministic Finite Automata

Alphabet =

Two choices

Alphabet =

Two choices

No transition

No transition

First Choice

All input is consumed

“accept”

Second Choice

No transition:

the automaton hangs

Second Choice

Input cannot be consumed

“reject”

An NFA accepts a string:

when there is a computation of the NFA

that accepts the string

There is a computation:

all the input is consumed and the automaton

is in an accepting state

Example

is accepted by the NFA:

“accept”

“reject”

because this

computation

accepts

First Choice

“reject”

Second Choice

“reject”

An NFA rejects a string:

when there is no computation of the NFA

that accepts the string.

For each computation:

• All the input is consumed and the
• automaton is in a non final state

OR

• The input cannot be consumed
Example

is rejected by the NFA:

“reject”

“reject”

All possible computations lead to rejection

First Choice

No transition:

the automaton hangs

First Choice

Input cannot be consumed

“reject”

Second Choice

No transition:

the automaton hangs

Second Choice

Input cannot be consumed

“reject”

is rejected by the NFA:

“reject”

“reject”

All possible computations lead to rejection

all input is consumed

“accept”

String is accepted

No transition:

the automaton hangs

Input cannot be consumed

“reject”

String is rejected

Language accepted

(redundant

state)

Remarks:

• The symbol never appears on the
• input tape
• Simple automata:

NFAs are interesting because we can

• express languages easier than FAs

NFA

FA

Formal Definition of NFAs

Set of states, i.e.

Input aplhabet, i.e.

Transition function

Initial state

Accepting states

Formally

: there is a walk from to

with label

Formally
• The language accepted by NFA is:
• where
• and there is some

(accepting state)