assignment - ningapi.ning.com/files/wrzgh8dgedkyzdb8i…  · web view · 2017-05-29fa2...

5
Assignment CS402 Question No 1: Let r 1 = (a+b)*ab(a+b)* r 2 = (a+b)*bb(a+b)* FA 1 corresponding to r 1 FA 2 corresponding to r 2 Using the FAs corresponding to r 1 and r 2 , Build an FA corresponding to a) r 1 + r 2 (Union of r 1 and r 2 ). b) r 1 r 2 (Concatenation of r 1 and r 2 ). c) r 1 * (Closure of r 1 ).

Upload: lythuy

Post on 02-Apr-2018

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Assignment - Ningapi.ning.com/files/WRzGH8dgeDKyzdB8I…  · Web view · 2017-05-29FA2 corresponding to r2. Using the FAs corresponding to r1 and r2, Build an FA corresponding to

AssignmentCS402

Question No 1: Let r1= (a+b)*ab(a+b)*

r2= (a+b)*bb(a+b)*

FA1 corresponding to r1

FA2 corresponding to r2

Using the FAs corresponding to r1 and r2, Build an FA corresponding to

a) r1+ r2 (Union of r1 and r2). b) r1r2 (Concatenation of r1 and r2).c) r1* (Closure of r1).

a) r1+ r2 (Union of r1 and r2).

Old NewA B

L1- = (x1.y1) L2 = (x3,y2) L3 = (x2,y1) L2+ = (x3.y2) L2 = (x3,y2) L4 = (x3,y1) L3+ = (x2.y1) L5 = (x2,y2) L3 = (x2,y1) L4+ = (x3.y1) L2 = (x3,y2) L4 = (x3,y1)

Page 2: Assignment - Ningapi.ning.com/files/WRzGH8dgeDKyzdB8I…  · Web view · 2017-05-29FA2 corresponding to r2. Using the FAs corresponding to r1 and r2, Build an FA corresponding to

L5+ = (x2.y2) L5 = (x2,y2) L3 = (x2,y1)

b) r1r2 (Concatenation of r1 and r2).

Old NewA B

L2- = y1 L2 = x3 L3 = (x2,y1) L2 = x3 L3 = (x2,y1) L3 = (x2,y1) L3 = (x2.y1) L4 = (x2, y1, y2) L3 = (x2,y1) L3+ = (y2.y1) L4 = (x3,y1,y2) L3 = (x2,y1)

c) r1* (Closure of r1).

Old NewA B

L1+

L2

L3

a

b

a

b

a

bb

a

L1-

L4

L3

L2a

b

b

a

b

a

a,b

Page 3: Assignment - Ningapi.ning.com/files/WRzGH8dgeDKyzdB8I…  · Web view · 2017-05-29FA2 corresponding to r2. Using the FAs corresponding to r1 and r2, Build an FA corresponding to

Final L1+- = y1 L3 = (x2,y1) L2 = y1 Non final L2 = y1 L3 = (x2,y1) L2 = y1 L3+ = (x2.y1) L3 = (x2,y1) L2 = y1

Question No 2: Marks: 4

Convert the following NFA into FA.

L0

-

L1

+

L2

a

a

a

b

b

a,b

b

Page 4: Assignment - Ningapi.ning.com/files/WRzGH8dgeDKyzdB8I…  · Web view · 2017-05-29FA2 corresponding to r2. Using the FAs corresponding to r1 and r2, Build an FA corresponding to

Question No 3:

Build an NFA equivalent to the FA* where

FA

Answer

L1-

L4

L3

L2

+

L5

+

a

a

a

a

a

b

b

b

b

b