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

Application of an NFA - Theory of Automata - Lecture Slides, Slides of Theory of Automata

Application of an NFA, Examples of Kleene theorem, Avoiding loop using NFA, converting FA to NFA, Applying an NFA on an example of maze, Nondeterministic Finite Automaton are the key points and terms you can learn in this lecture. Other related concepts are also explained in this course.

Typology: Slides

2011/2012

Uploaded on 11/06/2012

parasad
parasad 🇮🇳

4.5

(56)

131 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Recap Lecture 14
Kleene’s theorem part III (method 2:
Concatenation of FAs) continued, Kleene’s
theorem part III (method 3:closure of an FA),
Examples
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Application of an NFA - Theory of Automata - Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

1

Recap Lecture 14

  • Kleene’s theorem part III (method 2: Concatenation of FAs) continued, Kleene’s theorem part III (method 3:closure of an FA), Examples

2

Task

Build FA corresponding to the concatenation of these two FAs i.e. FA 1 FA 2 where

FA (^1)

FA 2

a,b

x 1 - x^2 x^3 +

x (^4)

b a,b

a,b

a

a y 1 - y^2 + a

b b

4

Solution continued …

Old States

New States after reading a b z 1 - x 1 x 2 z 2 x 2  z (^2)

a,b

x 1 - x^2 x^3 +

x (^4)

b a,b

a,b

a

a y 1 - y^2 + a

b b

5

Solution continued …

Old States

New States after reading a b z 2 x 2 x 4 z 3 (x 3 ,y 1 )z (^4) z 3 x 4 x 4 z 3 x 4 z (^3) z 4 (x 3 ,y 1 ) (x 3 ,y 1 ,y 2 ) z 5 (x 3 ,y 1 ) z (^4)

z 5 +(x 3 ,y 1 ,y 2 ) (x 3 ,y 1 ,y 2 ) z 5 (x 3 ,y 1 ,y 2 ) z (^5)

7

Note

  • It is to be noted that as observed in the previous examples, if at the initial state of the given FA, there is either a loop or an incoming transition edge, the initial state corresponds to the final state and a non-final state as well, of the required FA, otherwise the initial state of given FA will only correspond to a single state of the required FA ( i.e. the initial state which is final as well).

8

Task

  • Build an FA corresponding to the closure of the following FA

a y 1 ± (^) y (^2) a

b b

10

Observations

It may be observed, from the definition of NFA, that the string is supposed to be accepted, if there exists at least one successful path, otherwise rejected.

It is to be noted that an NFA can be considered to be an intermediate structure between FA and TG.

The examples of NFAs can be found in the following

11

Example

b

a

1 - a

a

5+

2+

3

4

It is to be noted that the above NFA accepts the language consisting of a and ab.

13

Note

  • It is to be noted that NFA helps to eliminate a loop at certain state of an FA. This process is done converting the loop into a circuit. But during this process the FA remains no longer FA and is converted to a corresponding NFA, which is shown in the following example.

14

Example

  • Consider a part of the following FA with an alphabet Σ={a,b,c,d}

To eliminate the loop at state 7, the corresponding NFA may be as follows

7

a

10

9

8

6

5

4

b c d

a b c

16

Converting an FA to an

equivalent NFA

  • It is to be noted that according to the Kleene’s theorem, if a language can be accepted by an FA, then there exists a TG accepting that language. Since, an NFA is a TG as well, therefore there exists an NFA accepting the language accepted by the given FA. In this case these FA and NFA are said to be equivalent to each others. Following are the examples of FAs to be converted to the equivalent NFAs

17

Example

  • Consider the following FA corresponding to (a+b) *^ b
  • The above FA may be equivalent to the following NFA

Can the structure of above NFA be compared with the corresponding RE?

b

a

a b

- + - b^ +

a, b

19

Task

Build an NFA equivalent to the following FA 2

a

1–

3

6+

4

5

a

a (^) a,b

b

b

b

a (^) b

b

a

20

Application of an NFA

  • There is an important application of an NFA in artificial intelligence, which is discussed in the following example of a maze -^1 2 4 L 5 O 6 M 7 P

8 N 9 +