0% found this document useful (0 votes)
31 views43 pages

18CS54 - ATCI - MODULE 1 - FSMs

The document discusses languages and strings. It defines an alphabet, strings, functions on strings, and relations on strings. It also defines what a language is as a set of strings from a given alphabet and provides some examples of languages.

Uploaded by

Akshay Bhagwat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views43 pages

18CS54 - ATCI - MODULE 1 - FSMs

The document discusses languages and strings. It defines an alphabet, strings, functions on strings, and relations on strings. It also defines what a language is as a set of strings from a given alphabet and provides some examples of languages.

Uploaded by

Akshay Bhagwat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

CHAPTER2

LANGUA G ES AD STR IN 65S

Alp habet

o characte6,
Pn alphabet tafoilë set of ymbols
.
t denotec 6y ihe ymbe
2a,b,c, , z }
E:O EngUsh alphabel
8tnay aphebet 20

* Striog
a fni le quence, posbly empty, of mbolS
A trino
6orne
apha
bet 2.
dran f0
+hat
that cas
can be
, k SbovlstE strono
tues any alphabet
i I l oil+ aj &
8.
for me d
forme d from Ihe Spryin ,

oueL an alphabet %
Jhe set of allpoible stigs
OrHco a

Ergbsh alphabek /a, b,c,.. - ,z}


a0.aa
Sting ase E, aabbg.
BnaH alphabet 20,1
Strngs
ase E, 0, 00 I00 .

FUMCTIONS OA STRIN6S

a tiog , i he numbr of Ambols to s


The leng Ih of
denoted a 161.
el O
E
For an ymbelcand s t i n g , Ihe function#s)
an
Ihe occu TS
o be he nuimber of me s Tha ymbot c

in

# a b ba aa) 4

he
Concalenahio af too trinos and t , 9 the
foved
fovmed by oppend'o p t , , orto as | l t oi st.
by
: heo
goo good, f: bye godye
So, zyl l +ly
Concatenatioo
Jhe e, 6 the identity fÅ
he
empt
emp-H hing,

Concatn ahon, as a
funcioo defocd co
thng s,
anoGotye So

Sting Repltcalo
for each %og and each natral numbe , the
defioed as

aaa

bye byye
ab bbb

Strog ReueThal
for each sting , The eerse of i s d e o e d as

lol he 3a e z (30 cz" Co-ua)).Cie las chanack

Jhen o a)
defioe w au
a u R
3
RELATIONS ON STRINGS

t S Occus
subatino of a stino f
AA thing
hn9 a

Cotiguouy Opost oft


ubn9 °f aaabbbaaaa

not aaa bbb aa


a substing of

A
A iog & i6 a prope ubotog ofa trng t f f
bstoná ft and #t.

ve to i a
sibtring of tself.
Je Empty sting s a subrting of eue
A a pxef a f t { I ¬S t »1)
A is
s a pvopes pe of a
stig t 4f a

Pefoftancd s tt.
Euery ting pef* of rtself
a a

he
ph ngE a pef* of Euey g
Jhe
Jhe prefaeb
pe ef abba ave, E, a,ab, abb , abba

a
f t ff 31 ezCt za
A a
proper suffo a
hóng t
tff is
fand tt.
Evey t 5 a sffr of self
4self
Euev
Jhe Emphy
Enp t i 9 a kuffi of &veny *i

e Jhe suf*Cs f abba aAe E, a


,
ba ,bba, abba
K
ANG UA GE S

A languag is a Cfoile tof*oik) e t ofstig oue

fofle alphabel .

OEr: Let a , b}

Some Lonouag Oues 2 aie

OEropty Lanouaoe
Lanougt SF15 Empt s t ECsiogle sting )
a,b
a , a aa, aaaa, . .

1 e , aa, aaaa,

L L2 ia,b al a's pre cede afl b s o

fo L
E, o, aa, aabbb, bb
aye
Shing L
are not fo
aba, ba, abc

are fo L
bbaa , ba
Strin , aa, aaa,
aTe not fo
&,bab,bca

L 1 z#y :, ¬ 1o, ',8,3,4,5,6, 7, 8. 9 S and when


Tepresentahonß of atulal
he decimal
and
ave Vie ed a

Dumbrr6,
ae fn L.
3+9 2#144
Storfs L.
ase not Po
3 # 8, 12, 2# 12ta
isto L.
A n a lgerithm IFaF ConVer stings to
u night CznvtE to 0 . #
Numbers

S to
nlegi Coovelei faik
to accept E, # 1s not to L
6 L Eia,b/a,bs DO picfY of w cotados b}

2 e , a, aa, aaa a a aa, a a a a ,

no psefa stari

Cheracla of w A a} OjEj
2eia, bs the frst

i E i a ,b3 " Every psefx of co tay a 6 S

CE s pveft of Evey *ing32


L 2 a: n> o
aaaa,
iE, a, aa, aaa,

Leicog raph:c OrdeL


Ihxo
total i d a D of^elemenL ofL
theve
exints a
total cidea called
we D to define on L
a weful
leicograph: c da , ostto as
KL
les tings precede lenge 0oes
Shor

dicHonay Ad uog which


Sovt Ih tings
Same lengh.

la he
Ihe Elemen
elemen i 9£
A ppgram lexi cographiCally Enumera
?t enumerala Ihem in lex cograjohie elda.
Lf
Lf
al a' precede all bk}
L 2x¬2a,b}
e
LP
Enumeratfioo of
Ihe lexicogrophic
ab, bb, aoa, aab, ab b, bbb, a aa
E, a, b, aa,
aab, aabb, abbb, bbbb, a
a
6
* C a r d t n aUtt_of hanouaoe

Jhe
Jhe Smallest Languag ovc ay alphabet A , Ohose co 1dinalit

OUeL
an alphabek I is .
The
Jhe Lages language
I f I: ¢ Jhen 2e Ond |= I

A Languag Oue s a subsek of 2


a t (east o and
T Jhe
cardina Cty cf &vey Language
atrett No.
So, all Languaes ale efther ffoile e Countably fofie.

Jhe Sel 4 languiages defsned on P ( S * ) ,


The ubseli
pow of "
eii
Act o et of all
f
f Z- ¢ the * n les ond ?C=*) 4,ieE}

*fUnCTIONS O LANGUAGES
2a,bt lo
ewen numbes of a's}
1Aings F Ib an

L 2 stings sf t5 no5s3: 2 8, a, aa, aaa, aaa, Ss

L,OL all tings jvst o plus Atinga that costai o


an d an Eveo numbei of as S

L,a 2 8 , aa, aaaa, aac aaa

L9- 2 a, aaa, aa aaa, aa a aaoa,

(-L,)2 stings OPlh at least One


b O

2shongs h an Eden numbe of a's


perato0s Conalenation

Kleene Gta
Reverse
ACme aphabe
languages deftned
ovcL
Let L, and a be o o
Jheo Ccocatenaioo
heneY

6,

L a 2 e T : 3 eL, Ct eta (w st)»

L cat, dog, mo 6°rd

bone, frod
L i Catbone, cotfovd, deg booe, dogfovd, mosebene
ouefod, biydbone, bdfood
feall Lan guages ie}l
L
LC) (P)L =
Con caleootioo as a functioo defsoed on larguages

aKoCiaive
LL - L, ( L )

Let Lbe
a longuage defned oue sp
alphabct
Jhen Kleene Stal of,o%tten as i s

L e Owez 3k> (3o,, ¬ L C: o. a )}


L the et tht Con
efemed by
Corcotenag togethe 3eLo dmose Aiogs fomL.
le

E L
idog, cak fANh
L e.deg c.,fsh, degdon.degeet,
fhcasdeg. fishdog fsheat,
f L: teo
C:ie}

* Kfeene Pluus

E L : 20,

Sthings 0,, 0o, 3


Let L be a larguag destoed OUC AOme aphabet2.
Jhen (he of L
Ame eL

s ofshin8 hat Con befene d taking


Some
tsog fn Land euers9

POER Of AN AuPHABET
A Ihe
Jhe pooc o n alphabck dencre.d by
coor of lengb 8,

S20, S the

20,
: i oo, 10, , 0
Cprofrathat halG on all topuat
Does ot Eist clear fema pecifcallon

L 2 0 s a eoten ce fn En
OS
Fin'te Stali mach:oe
machine (fsm) a computeton al
A fioilë stal
output is one of tay o value k
dev: c e ohobe foput t a
stin hose

that ea d
eaa-
Accept aeject.
fsms are also sometimes Called foi lë stale

Qutoma t a PSAs. (DFSm & NDf Sm NDFSN-&

Dlamioi stc : Jhese ia


alsas exacty 0ne move that can be
made at each siep, that move is determ ioed

Cu Teob &tale and the nerE toput


characeq.

De A delasm ot6tic FSM Cor DESm) Mi6 a


uin tuple
CK, S, , A), ohere
a f i o le eof stales

2 the toput alpha bet


EK thhe 6tart stalé

ACK 6 the se of accepting tales and

S the transttoo functoo

It mops from
K
K
Atali
toput tn stale

Jhe
Jhe languqg e acceptrd by M, denoted L(M), the set of all

M.
accepted alphobelk ( l a b e h )

Notations O stales SBo1):


Trastion

daham
O)fnal stale & So, 1) : bo

O n:bal htale
s(o,0)
lable
diec o edae Sl) b,
e

CO

T
Exampes (Drsm) 107
a bf
OL 3we la,b ewe htmmedate fellaoed
elbl°ab.

Jhe ence of configurations for the toput Atrrné abbabab f ,

Bo, a bbabab), (,bbabab) Co, babab), (eo,abab),


(,, bab) , (o, ab), (,,b),(o.E) Stoce Bo s accepts
tale, M accep the oput stsing

L: iwe la,b3:eweyH a
ion is
of even gthf

L:2we io, 3 :w hak odd paritg


A has odd 71f the numbes of J' in it 1 odd.
nag tng parit

no mOre Ehan one bf


L we ia, b3 Conta'ns

la°ba°
6lala" | b

two consecutve eharac lers are the Aame


L weia,b3: no

8
( bb X
b
ab
a
ba
ababab.

( bababa....

L : 2 we ia,bf:
does not contain the ubsbino aabE
Q.b

b
L:2 : 6 the strng sepiesentation of a floato poiot wmber I08

Example: +3.0, 3.0, o.3E1 0.3Et1, -0:3Et1 -3E8

3
d (o-9) 43

E
d

all the legal eguen ces omemegt s


L the language that contains

between a cl:est and aserve U g


a
Aimple
Ehat Cas be exchanged
Communicotioo pro lo col

Let iOpen, Reguest, Repl, Close


Reply

Close

and Odd number


L:2w clo,b con tain s an ewen numbT of o' ao

f 6'
a

Vooels a,e,i, 0, u occu


L 2 ueia-z3": all five o o
alpbabett cal
orde
£-ial
2-1e 2-lot
)

Etomple:sa cv le giou ten ociou


fecetiou
ab stemiOus
(M

P
&
&

( Q

UO
imne diate ps e ceded and
E)L: w ¬la,bt ee
fotlaoed bb

e
the Laneuae accepted d
Gtve a clear Ergsh descptioo of
follosing FSM

- (6)
a,b

not Teachable tale So, Remove i t

b
O-
aa a ba
bbaaa
b aaaaa

ALlting of a's b' 6 coo6istrg aa bb° e


aa bb'a
aneuen numbeT Of a'6, a a bb aaa

folosed bH atE least one


6, aaaa bb"

fotlowed bH 3ero os ao odd mber of a's.

L: lo,b whas bolb a a 2 bb as aa


substings
oaboX
O

b
a

D
-

Contain at least tuo b^ that are not


immedately fotlased by a'
a,b
b
O
\O
-

- ooo

o
- o ° o o O|
o

8o
O

O o o
112
2we 2o-93 Corvesponds o be decmal encoding, s : thout

leadin 0s, of a odd natural numbes


eseD odd odd odd
468
Even - odd odd

Ee
Gen-odd: odd
3,S,7,9
O d d
Codd-Gver)-(odd)°: odd

'3S,7,9

L: 2w eio, has no more thao one par of Comecu bve o's and

Do nmore than one pai OF CoOsecative

OLOO

O11IO0
OLO0L

co ends to 03
L:2we io,j: none
of he prefe* of
E Oot
Prefes are O

OOl.

We'll hat the


Consider the ch:ldken ' game Rock, Paper, Sci%oss ay
to too Ounds to o:o the ame. Call the tao
fist player
A and 8
playets
DFoe an alphabet and descibbe a ttehoigaue for encodino Rock,
Paper,SGhors, g ames a over stig
CHint Coch yobol ioEshould Correspond
lo ao 0r dere d Poir

te Aimaltaneous actons of A and B)


that dehcibes

Let Res be the


Lanuage of Rock, Pape, Scimo amed,
past («) thal- covrexpond
s
encode d a os descrbed i0
atring
ins fo ploye A. Shouo a DFSM hat accep LRes
ployes
13

Non de l rmin:st5c FSMS

A nondele rministc FSM1 (os NDFSM) M i6 a guintaple (6,z, a,s,A)


whee,
K a ffoil set of stalés

6 an alphabet
EK i the Atart stalé
ACK s the et of fnal tate s and
A hEhe trar tboo selalon.

Lt a #oile aubset of : (K x (Tuie3)) x6

Examples:
OL iwe ia,hl: w6 made up of an optionat a follaoe d by aaa
fo Uowed 3eo o mose b's

)6
E a
a (oo) b

L:2o e la, b3 w aba os ll 6 even

LMinn : there i a ymbol a, ¬ not appeaso io w}

la, b,c,ds
, d

->( .cd
a,b,d

a,b.C
(8D

()
X

X
L2weia,bl
*

contains at least one tance of aaba, 6


bbb o ababa3

a,

a, a (
Da.b
,

L2 we Lo,3" : w Cowes poncds o the


6inay encoding of a pos: 6ve oleger
Ehat is divis:ble by 16 os is odd!
6 84 2
Odd

6 3 6 &42
122

3
ShoShow an FSM del xmini stio o« nondelëimioisic)
that accep L:iweia,b,c} : w contaios at least
80
on e
Aubstsoo th at conaiAts of three ldentical
OOoO 96
ymbol O o 0O112
128
Ex
ample Jhe fetlas io stinos are io a abbb baacccbbbOoO
L ,

not inL E, aba a b a b a b a b


ab cbcab

,6,C 60
a, ,b

O 0 o o ooT

C
b,c
(C

(O

E
Ses
()

( V

Go
T

E
R
O
o

CO
CO
e

CD

GCO
(,.9 (a) (g)(a)(,)%a)
i0,, , da.Os.7.ps,a) : 1 , , . ®u.t
tupu(G,)u(,
D, , s . ,%, b) 20,, a s.&.y.ag3 (8,) (ub G)()(a,G)
SHo.a.s . .®yd, c) 1 G,f
Co,c) (E,c) (c)e) (.c)
okactive -Atales 4
ie,.e,8,5, ¢,i,,ta.. s , , . , 1t,,,, 3 .

2,ag,Os. e, 4. 1e,s3
Con si de
L,4, ,b3s
a, o4, Bc,o,i ,a) t ¢
i , B4. vc, dat, b)
ta,s.eg
S ( , &y, , &, c) i.
& acbve -

6tali :
i i , . s , , ie,. , , s ,
2.Ogt, 2,©4, o,*
3,®s o, gs,24s, L, g, L,%3
Considc 16,, o s O6, .ogS
DCi,,,Os.o. ®3.rs a) 1a. o4,o,Bss
Dlio,,eu, , es. t, B9. ®s, b) 1,,a. , es, ,®9, ts
Sp Ct, ,
s , z ogk,c)
:
active-stales: {
2,ta),¢.io.a.g is. L,4,,%,®,,
i . . s , g 2eyt ,1g.es s , ,
ConideT 1ou ,1ea.,
Slis,a)

Sp (is,c) {tg}e
Consider 1 , gl

Spl,os.te, b) 1ou , » }

active - btalé :l io,,<, By, P, L,


s by teS, i.&, , , las,
1,.,.s u, *, 1, s Os, io,tt, 1t, &,t, 19,4e
C

p
on

CO

MM
(
terCCAe

f o fos
s each of the flooing NDFSM Use
ndfAmlödf hm lo conntruct
an eguiv alent
DFSM. Begin byshooing the value of epslg) for each
stale

STEP 1
Compu lee epsl) for each stale o Km

epl) 2e, b, os S 1
ep ) e,.
ep () Bo.,,
eps(a) 1e 1 . o 8,9.
eps ()
ep () l,,,
STEP 2 6: epsG) : io,6,, a STEP 4 K': 2 ieo,,.
STEP 3
Compule s'
*acive- stalë :
i&'t ioo.8,,e} i,,
STEP S :
A
Cons:der 1do,o,. , , 2e,,t
SpCite.e,.et. 1%,
SD Ci,8,, ) ie, sS 0,.3
octve stalës: i ito,,,, isy,}
=
(Bo.o)u(0,,o) U (,o)
Consider les, ay, s
SpCtea, st,o) i, . o y u(,) u ( )
SpCt, ,D te,,,e«s s , 0 ) U (,0) U ( o

Ocbve - stales :
1iec.,,,, , x , i,,2,
Ccchide 0,y} , ) u,)u(e.)
s U (3,.) U¢(,,.s)
,a.S,0) ia, y,
(,)u.0)u(e.0)
So( a.,1)
(e.)u) u ( )
3
a
-

STEP 1
Compu e epsle for each stal fo KM
S b
epsl) 1o,,3
eo,,,
ep Ce
ep ( i6,s 2oo,,.xf
ep (4 e,,,
ph Ce)

STEP 2 ' eph4) : 26o ,


STEP3 Compulë S
active - ^tals : ^ : 1eo } a
)
a
Splieo.e,s, a): ita, 4t
Sp(1ee.c,3, b)

Gctie
Consid
-stalës
i , tu
12do, .s, ie, Bus, 2Bo,®,,%) fo,.as)
SplLe,eyt, a) i,. 4
Sp(1.ut, b) 2 o, 8,.,
Gctve - staléi : tieo, 8.s, 1 , u 3 , i e 0 . 6 . . , i e , t,iBo,, , ,

Consider 1o.
SC0, e..tt,a)
Sp (ieo.,,egt, b) ieo.,

Conider ie,,e
S C1e,, , u t , a) : 1ea. y , , i

(1 , Bus,b) 1s . o ,

Conb:desiee,, . ,
Sp(io,,,.st,a) 1.u
S (1e0.,,g.%b) 1eo,®,.,
STEP A K': 1ieo . , 1 , u , deo,8, , 16,,t, 1eo.,, e, e
SIEP 5 i . , ie,..,&x 3} i6,, 35
a

8TEP 1 Compulë epsl) for each stali g ro Km

eps) *i8,
epe 2s
ep e
eple) ie4
STEP 2 '
eps(A): leos
STEP3 Compue S
acive- stalë : 3s'5 : os
Cons de 1 t

Sp (1e. b eo
& actve- Atalis - os, 1e..8,5
Consi de ieo, .

SlieoR.s,b) i
acve 4talä :2o? , ie , , 1bo,B.
, 1%,®aSS
Con i de
leo,,,
Spl2o,o..3s.a) to,,, a
Sp (1,,,5,b) 2
o,,
active- stala 1 1eos,
1e%3s, 20.,3,. S, 1e.,1,
:

Ccnsids 2o, io,,,., Leo,,

S (2e0,S. b)
2,g
*a cbve ntaleo: i¬k,
id,8,t, 1E0,8,ot,
io,2s,1800,,, 1,.,
1o, , ito,a
Coside 1eo, 8,, ,
Spio,, , , a) iBo,,u,,S
Sp(10,to, gt.b)
te,,,S
&active stal i : i ies, ieo.3,2eo , S , 2 2 . , 1e,,., , iso,3. 25

2 1to3, i e . , a & , 1e,,,ekf


Cand 2o,,
Slo.,i,a) ie.3,,, ouS
S5te,y., b) o ,u
ace -taley :iitt, ido,Bs, io..., 1 , ito, ®.,o,, 2to.
o, , io.,eo,8,,,2., ito.® s , , teo,44,

Conside leo, ..G3

Spl2e0.o,,,a) ito.8,,,4s
Sp (ito, B, 25,6) ie,, 5S

acive -talei : 2ees, ieos, ieo.8.S, ie» 2 S, 2eu,


,,E, 1to ,
10, , teo ,ieo,, ,e,, l , ie, í,ito ,,.. ,
io , s , 2o®,.,eus, 1ee
,+3
Cosid ie.
S 0 . . a) 1to ,,u
SD (t0,2. 6) 2, u
acve tals : i ieos, 100 ,?,ito.,,,1o.
i ,1eo , , , 280.%,,
o,,,, ie.,i0o,o,u a , i
1e.
,,euí, ie,,6,,,a
g.t, 2ee, 3,,, ,
2o .5, 1eo, B.,&uf, 2to,x, 3
Cons des ido, 8,,,q, 4j
S,(i0, ,,,3 , a a) :
140., ,3, us
SpHo, , , . 3 . . b) o, ,
1, .
Coride iEo, , . us
S 0,., d,a) io,o, . a
S (io,3,,4,b) 1o 3,
Cons:der 1, ,, . y
Slo,e,,2245.a ) io8, , a , S
Spi , , s , b) i , , u s
Conbd 20, 3, s 126

Spleo,, s , a) 1o,®,,4}
Sp io. s, b) o }
Conbide ito,.a, Eu3

D i , ,, , a ) i ,, ,u,
So l1, 8.,, &t, 6)
ie,,2
Conides iee,E.
S2®,as, a) 1o,,.
Sb lio , uf, b) :
2,
Conhid io,3,, us
S ,,eus, a) i,,, S
Sp lio,, yf,b) 2,l
Conid o,s

STEP 4 K: 21t, io,6, 5,2eo,,,s,1o , 1te, , , , io, s.


1eo , « , , ie,a,,,,l, ieo,a,3,f, 2t,3,.
,

1 s , iu.o,,, , 1o, f , io, ,,a s, le,eS


STEP S: A iio,,.,, s ,
ito,3, io,,.3., io . s
2 , , , , 1o.a us, io,, s. 2%
3

PT 0
S I2
O b

20 .

2,,,
e.a.3 eo.., y, , ,s,4
io ,
2o..,.us

20.,,at
ito,,, a.3, us

2e0,a 45
1B,,, ,
ito.,
o,.,u
o,,,, y5 1eo,,
ie, ,,g

.,
2,,

PTO
28

(o ,',.3 6.', a,3,4


b

..3) ((0.3.3,4

o,
7 )|
((O,',3,4)

(3,4)
((o,,4)

o,4
Let M be the
folloong NDFSM Cosbruct Cu sin6 ndsma dsm), a
DESM at
accepli L(M).

a
(
b creoting Dead Stale Dand addin the transitios
Complele
3,0,D 4,0,D {Da,D)
5,b,D) T,aD D,bD
29
ep 24,
b

i3 D 25.6
5 D3
* 5,6
D.
D

3,D D
*l3,T3 D 15,6
D,T D

2D,

a,b
a a

(D).
b

(b

DFSM LM) Ps
Occept

.c4-5.)
0
1
Minimi3:ng FSMA 30

Etamples :
Delerminioo L
61
a b
1 we T: eueny a is immediately follooed by
where : 2a ,bs
Jhe
Jhe eguvalence clakeb o are
JLE,b,abb,..J allstvi io L

eod and have


La, abbba,.-. all iogs that o a

no priof a that i not follose l


a b

Taa, abaa,..3 all sti ogs that contaio at leas t


One o stance of a2a

Cxomple: Bu:ld o moimal DFSM o accepE

charac lers ae the


L 2 e ia,b: no too adjaceot
asneS

( Co, aba, ababa,J at ronempty striogs that end


O,ac, o.b a, acac o a and hav e no ideoti ca l

adjacent characlas.

Cb, ab, bab, abab, that end


B all
nonempty stggs
,ba, bab,bab a. iob and have no decatical
adjacent char acless

C4 Caa, abaa,abab all Atirg that contaio at


O0,bb, aob, bba,
cas ooe pais of ideottcal

djaceot chavac l ss, these


a not io L, no
Stns aye
a
ohat Cones nect.
matte
ELevCihe 13
O For och ofthefollooing langu oges L

Deberi be the euivalence clamed of FL


f the number of eguiva lence clasbes of n fni lë, coostruet
the mioimal DESM that accept L.

e io,3*: evesHo in mme diatel follooed by the sbsiRS S

LS E,1, ol, 0l10I


2 iothetoise io L except ends io 03
3otherois e io L ezcept ends io Ol}
(D icosehpond lo the Dead stalë: ^trio contains at leabt ooe
eance of 00 ov O10

b L : 1 elo, 3 has ethes an odd number of 'a and ao odd number


Of o' oYit hak Q0 eveo oumbes of 1'% and an eveo number of
o'»
132
L : o tweia,bl : w cont ain at least one occurence of the strio
aababaa3

d) L: u e la,b}"3
) L : o ela,bj: Contasns at least ooe a and ends at least135
two b's 3

f)L: o e lo, : these i no occreoce of e substsiog 00o o aj


Eomple : Using minDFSM find a Miaimal Machine

clames :
i (a,4J, Li,3,s,6J}
At tep

CC,a), [3,5.63) (C4a), L3,5,63) No plitting eguired here.


Ca,b), 0.3,5,6]) (CA,b), C3,5,3)
(Ca), Ca.4) ((3,a),a,4) (5,a), ) ((6,a),CI,3S.6))
(ob), . ) (C3,, [a) ((S,),a4) ((6b),3,5,6))
Spl: ttio Teguved
Clae ì Ca.43, ti,3,5J, [C3

At 3E p2:

C,a), C'3.53) ((4,a), t J Spl:ttng Teguised


Ca,6), CCI) (C4), ,a,51)

(Ca)Ca,4J) ((3,a), [a,u43) CC5,a), Ca.4) No 6pl: ttbog


(Ci,b, Ca,4) ((3,), Co4) C(S.b), C,43)
Claes i CaJ,C4J, C,3,53, Ts
At slep3: a

CCa).C 2,4 ) No spl tbno


(C,b .4 J)

((3,a), C43)
CC3,b), 43) a

C(s, C.4)
CCs, 43)
Exec:se 135
Let M be the following DFSM. Use mioDFSM lo mioi mize M.

Clahes i U , 3 J , (2,4,s,6J}

STEP 1
CC'a), Ca,4,5,63) (C3,a), R.4.5.6) No SptEbng
CC,b, C,4,5,63) CC3,), , 4,563)

CCa),[,33) (C4,0),[.4,S,63) (C5,a), [,4,5,3) ((,a), ,4S6J)


(,6) Ca.45.63) (C4,b), C33) (CS8), To,4,S.¢J) Cc6,6), C,3)

Spl:t ol C3, C3, [SJ

clases i C,33, C3, C4,63, C$3


STEP 2

CC,a), C3) (C3.a), oI) No Spl:t


C,b), C4,63) Cca), )

(C4.a),5J) ((6.a), CsJ) No SptE


CC4,b),C,33) (.b), C)

b
a

a
fio: lE Stalë TranAducers 13
*Man8 foile stalë +hansducers ave loop that Aimp'y run fovever
Pro cehing opulb
Cample: Traffic Ligh

To Aeconds > o seconds


MooY machine

80 beconds

KTrannduces Moore machine


Mealy machine

Moore Machin e Mealy Machine


Toveted by Edwaid Moore Lovented by Gcoroe Meal
FSMA associ ate b an
output FSMA aMociates an output w;b
toth each stale a machine
af brans; tons

A Moore machoe M ib a
AMealy machine M : a bi-tuple
even- tuple ( K, E,0, S, D,s,A) (K, E,o,8,^,A) uhere
whes e

Ki a fin:le sek of stales


. K i a fin:le set of stales
an oput alphabet
2 i an
ioputE alphabek
an output alphabet
O ib
an output alphabet
EK the bast stalë
EK i the staat stale
Cs the set of acceptin stalës
ACK i the bek of S in Ehe trannition
a ccepbng Atales functo.
LE is
S
a
functoo fyo m (Kx2) lo
i a tranhition funcbon
LEifuneton from (Kxo)
(K x E) 15 K Mealy machioe M
compule a
D i the displa o
function flo) if, ohen iE veads the
Toput trin o , :t outpuE
output funcbon.
TE i a fuoctioo fiom Seguence flu).
Kl6 O
A Moove machtoe M Compule& a
function fl«), iff e o t eodb
the
inpu srioe , t t oatput bc 9,uence i6 #(o).
ELamples 137

Generating Party 8:ts

Mealy Machine
adds an odd povity bit aflés every four bina digts that
Teadb.

OooO
ooo10
olo, 10 ol
olo olo
Readioo Gene(alog
olo
O000
00ol 10

0000
00
olo olo enevorl cd
O1000 o loo, 1|11
O1D1 1001 Poptt

Ba Code Reade
Bor Ehat encodes usE binay numbeis.
Code b lem
A ingle black colum encodes O
A double black column encode 1
Represeot a black bar i bh the stnbol 8 and a cohile bar oi th

ehe yobol
Read bhe bar code from lesE obE : input
Aumptio0s
bar Code Atarts oith a black columo , so oh:le
Eves
ace
comect
ahead of the firsE black column noed.
onored.
5
bar code there ae at least too hilë
Afl eue complelë
lo ead the nett Code.
column 6. At this po:ot, Teset
Tf eader bees Eree 0% more black column 70 a rOu, i t mutt

and íth erros Atale until


tndical an eros stay io

eet by seein tuoo coh: la columns.


38
tart
BlE BE
4le Ble
Gle18) Ble le

lo

BWLode

ComDose d Column Cach of he


Column Can

wO blaK Columns eacb othaA ?i| lo ok Cke

ol black fho ade 3?flsee

ad acen biacs CeLumo 3id b

Jhe jo6 f Column dei; black

RECTIONAL TRANSDU cERS


8IDI

Letla Subatuhon

bidectionel
that Cao Coovet t n g
tran Aduce1
Buld a simp e
L Vice Veja ohue :}a,6f

alo
Ezercie (39
O Conhtruct a deleministicfoile stale transducer wth iopa t 2o,b}
for cach Of Ehe
follooing tasks
a) On
input «, produce 1", ohese n #)
a1 al

b)On oput ,produce 1 ,ohe«e n: #)|2


al1 a

c) On input , produce 1, ohese n the number of o ccuTrence (A

Ofbhe 6ubstiog aba iq


b o so bobaba

a 3

al lo Scl loop
bl al

Xabab ab

o booba
Ga°h a

You might also like