Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Nondeterministic Finite Automata: Understanding NFA and ε-NFA, Slides of Theory of Automata

An in-depth exploration of nondeterministic finite automata (nfa), focusing on their properties, examples, and the relationship between nfa and deterministic finite automata (dfa). Concepts such as nondeterminism, subset construction, and ε-transitions, using a chessboard example to illustrate the concepts.

Typology: Slides

2012/2013

Uploaded on 04/29/2013

shamir_69
shamir_69 🇮🇳

5

(4)

66 documents

1 / 37

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Nondeterministic Finite
Automata
Nondeterminism
Subset Construction
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

Partial preview of the text

Download Nondeterministic Finite Automata: Understanding NFA and ε-NFA and more Slides Theory of Automata in PDF only on Docsity!

1

Nondeterministic Finite

AutomataNondeterminismSubset Construction

2

Nondeterminism

A

nondeterministic finite automatonhas the ability to be in several states atonce.

Transitions from a state on an inputsymbol can be to any set of states.

4

Example: Moves on a

Chessboard

States = squares. Inputs = r (move to an adjacent redsquare) and b (move to an adjacentblack square). Start state, final state are in oppositecorners.

5

Example: Chessboard – (2) 1 2 5 7

r^1

b^

b 2 4

r^

b 1 2,

  • Accept, since final state reached

7

Transition Function of an NFA δ(q, a) is a set of states. Extend to strings as follows: Basis:

δ(q,

ε) = {q}

Induction:

δ(q, wa) = the union over

all states p in

δ(q, w) of

δ(p, a)

8

Language of an NFA

A string w is accepted by an NFA if^ δ(q

, w) contains at least one final 0 state.

The language of the NFA is the set ofstrings it accepts.

10

Equivalence of DFA’s, NFA’s A DFA can be turned into an NFA thataccepts the same language. If^ δD

(q, a) = p, let the NFA have

δ(q, a) = {p}.N^ Then the NFA is always in a setcontaining exactly one state – the statethe DFA is in after reading the sameinput.

11

Equivalence – (2)

Surprisingly, for any NFA there is a DFAthat accepts the same language. Proof is the

subset construction.

The number of states of the DFA canbe exponential in the number of statesof the NFA. Thus, NFA’s accept exactly the regularlanguages.

13

Critical Point

The DFA states have

names

that are

sets of NFA states. But as a DFA state, an expression like{p,q} must be read as a single symbol,not as a set. Analogy: a class of objects whosevalues are sets of objects of anotherclass.

14

Subset Construction – (2) The transition function

δis defined by:D^

δ({qD

,…,q 1

}, a) is the union over all i =k

1,…,k

of^ δ

(q^ , a).N i

Example: We’ll construct the DFAequivalent of our “chessboard” NFA.

16

Example: Subset Constructionr^

b 1 2,

r^

b

{1}{2,4}^ {5}{2,4,6,8}

{2,4}^

17

Example: Subset Constructionr^

b 1 2,

r^

b

{1} {2,4,6,8}* {1,3,7,9}

{2,4}^ {5}

{2,4}^

19

Example: Subset Constructionr^

b 1 2,

r^

b

{1} ^ {1,3,7,9} {1,3,5,7,9}

{2,4}^ {5}

{2,4}^

20

Example: Subset Constructionr^

b 1 2,

r^

b

{1} ^ {1,3,7,9} {1,3,5,7,9}

{2,4}^ {5}

{2,4}^