58
7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 1/58 FL T A 6 5 S C 0 1 U T V N O I T U L O S N A B N O I T S E U Q S 1 t i n U a t a m o t u A e t i n i F o t n o i t c u d o r t n I n i a t b O s A F D o t a t p e c c s s g n i r t o a s d n a bs a hv g n i t c a x e ly e n o ( ) m 5 ( . a C E D - 4 1 0 2 ) 2. n i a t b O D a F o t A c ac n i r t s t p e g a o s d n a s b’ g n i v a h s ev u n n e m a o r e b d n a s b’s ( C E D - ) 3 1 0 2  L = {Œ a a , a a b b , b a a b , a b a b , b a b a , b b a a , b , a a b - - -- - --- - } . 3 i l p p A e v i G c o s n o i t a F e t i n i o t u A m . a t a u J ( ) m 5 ( n-July- 4 1 0 2 ) g n i r t S Pr c oe g n i s s d i s n o C er n o l a n i h t i w ) g n i t s g n i t s g n i t s t x e t ( g).  b e n o d e  b n a c s i h T y n i s s e c o  p g u o h t t x e t e h t g n i t s l l a o A F D e h t : A F D a h g h t i w d n e t a h t s h t e pa t t en t srn ig  . u c e h t , d e h c a e s i e t a t s t  p e c c a e h t e m i t h c a E e r h t n i n o i t i s o  p t n e text . t u  p t u o s i F e t i n i - e t a t S n i h c a M es A t i n i f e - o t A F n a s i e n i h c a m e t a t s g a h t i w e h t e c s n o i t h t n o e r a . s c Sta e t a h c rs t t a t S o t e s a s a s s a t l e d o m s t a h c e f t s ates a d n c a s n o i t . e h T y a i d A F d n e t x e g . s m a r Le i xc s i s y l a n A l a o t  p e D E S C ,SB J IT 1 . 1 . 3 i f n i d n g a o l l cu c rre o s e c n f a t s t o h s rn ig p (at ten r

Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

Embed Size (px)

Citation preview

Page 1: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 1/58

FL TA 65SC01

UTV NOITULOSK NABNOITSEUQ S

1tinU

atamotuAetiniFotnoitcudortnI

niatbO sAFD ot a tpecc s sgnirt f o ’a s dna b’s ah v gni tcaxe ly eno ()m5(.a CED - 4102 )

2.  niatbO Da F otA ca c nirtstpe g af os ’ dnas b’ gnivahs ev unne m af oreb ’ dnas b’s ( CED - )3102  

L = {Πaa,aabb,baab,abab,baba,bbaa, b ,aab -- -- -- - -- }

.3 ilppAeviG c f osnoita F etini otuA m .ata uJ()m5( n-July- 4102 )

gnirtS Pr co e gniss

disnoC er nolanihtiw)gnir ts g nir ts g nir tstxet( g).

 benode bnacsihT y nissecor  p g uor httxeteht g nir tsllar of AFDeht:AFDah g htiwdnetahts ht e pa tt r e n

ts r ni g  . r uceht,dehcaer sietatst peccaehtemithcaE er htninoitiso ptn e text .tu ptuosi

F etini - etatS nihcaM es

A tinif e- otAFnasienihcametats g ahtiwr ehte c snoit htno e r a .sc

Sta et ahc r st

tatS otesasask satledomstr ahce f ts ates a dn ca snoit . ehT y aidAFdnetxe g .smar

Le ix c sisylanAla

f ot peD ESC , S BJ IT 1

.1

.3

if nidn g a oll c uc rre osecn f a tstr ohs r ni g p( a tt e nr

Page 2: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 2/58

FL TA 65SC01

I nili pmocn g or  pa g eht,mar tsr if sisylanalacixelsi pets . hT is ek setalosi y tnedi,sdr ow i if tesr e c lihw,. e 

nitanimile g r r i e vel a stn y slo bm  . k otA e asin ac r oget y r of , e l pmax e itnedi“

 ps ce i

.4 ,AFDenif eD L&AFN ceD()m5(?egaugna - 4102 )

reteD m otuaetinif citsini m D(nota F )A —  itsinimr etedsanwonk osla c f tini e ts a met ca enih  —  etinif asi

catahtenihcametats nir tsetinif stce jer /st pec g sf os y lnodnaslo bm y cudor  p es a uqinu e r o(noitatu pmoc

htf o)nur e motua a not f r o eac nir tstu pnih g. ' citsinimr eteD ' ehtotsr ef er neuqinu e htf oss e c tu pmo a .noit

retednoN m otuaetinif citsini m N(nota F )A  etinif citsinimr etednonr o sienihcametats a f tini e ts a et

stu pninevigadnaetatshcaemor f er ehwenihcam y amnotamotuaehtlo bm y el bisso plar evesotni pmu j

tstxen ates  . sidsihT t ni g itsinimr etedehtmor f tisehsiu c f tini e a motu a D(not F r ehw,)A e ht e el bisso ptxen

leuqinusietats y denimr eted  . uohtlA g nitsidevahAF NdnaAFDehth c dt e ,snoitinif a NFA c e bnaviuqeotdetalsnar t ale Dtn F nisuA g eht tes bus c ur tsno c noit algor mhti

nalA g au g nasie y f otes bus

L na g au ge :s

5. DaniatbO F otA ca c nirtstpe g af os ’ dnas b’s ats r gnit gnirtsehthtiw ba  . 6( eD() c- 3102 nuJ() -

luJ y- 02 51 )

f ot peD ESC , S BJ IT 2

,”r eif noitaler “ r o”r otar e po

cif .dr owyek

.4

Page 3: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 3/58

FL TA 65SC01

,bba,aba,ba{=L a bab , abba,bbba,aaba ---- --}

6. DawarD F otA cca e tp ts ring 0f o ’ 1dnas ’ gnidnes iw t ehth gnirts ceD()m4(.110 - 3102 ) ( nuJ -

luJ y- 02 41 )

L= ,11011,11001,11010,11000,1101,1100,110{ .. . ,}

7. DetirW F 2&s’1,s’0f osgnirtstpeccaotA ’ bs e gninnig 0ahtiw llof owe ddoybd un mbe s’1f or

dnedna i 2ahtiwgn  . ceD()m01( - 02 31 nuJ() - yluJ - 02 15)

f ot peD ESC , S BJ IT 3

Page 4: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 4/58

FL TA 65SC01

8. DangiseD F rpretninehws’1&s’0f ognirtstpeccaotA ete anibsad r uny mb re dluows eb

3f oelpitlum nuJ()m5( - yluJ - 4102 uJ() n- yluJ -2 310 )

9.F sllaf otesehtevigdnaetatshcaef oerusolcdni htgnelf osgnirt ro3 le ass cc pe et ybd

(.notamotua nuJ()m5 - yluJ - )3102

10.  niatbO Da F otA ca c nirtstpe g af os ’ dnas b’s ah v gni busa str gni aa  . nuJ()m5( - luJ y- 3102 )

f ot peD ESC , S BJ IT 4

.

Page 5: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 5/58

FL TA 65SC01

11.  etirW R ge ul ra xe rp se si no f ro the f ollo w ni g L = { an

bm

: ,m n era ve en} L = { an,b

m:

)m5( ( ceD - 4102 , nuJ - luJ y 4102 )

ab  (f Or e bmun a)= bmundna1 e f Or ( ) b = >1 2/1

 b ba   )a(f Or e bmun =1 a bmundn e f Or ( ) b =2 > 2/1 b b ba 2/1>3=) b(f Or e bmundna1=)a(f Or e bmun

aa b b r e bmun ) b(f Or e bmundna2=)a(f O = >2 1=2/2

 b baaa 5.1=2/3>2=) b(f Or e bmundna3=)a(f Or e bmun

 bmun b baaaa r e dna4=)a(f O bmun e f Or ( ) b = 2/4=2 = 2

noC.21 v obatre v otuae m nota t Dao F .A 01( m eD() c- )3102

0

,p{ r}

}s,r{

}s,p{

,q{ r}

f ot peD ESC , S BJ IT 5

m .}2=>n,2=>

δ

N

p

q

*

r

1

{q}

{p}

}r{

I

Page 6: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 6/58

FL TA

13.  trevnoC wollof i Ngn F DotA F curtsnoctesbusgnisuA t mnoi e .doht enuJ( - yluJ - )4102

δ

� { }r  I

p}q,p{

q

. noC v ttre h f e o gniwoll FD eR otA g lu a erpxEr s nois ( 01 m ceD() - 4102 )

f ot peD ESC , S BJ IT 6

b

p{ ,r}

I

{p

a

{q}{p}

{r}

.41

Page 7: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 7/58

FL TA 65SC01

15.  enif eD NFA  . axehtiW m eD()m5(noitcnuf noitisnartdednetxeehtnialpxeelp c- 02 41 )

 ¯ ednacew,AFDahtiwsA ar tdednetxeehten .AF Nnaf onoitcnuf noitisn f I eht noitisnar t noitcnuf si ±

llausuew y bnoitcnuf noitisnar tdednetxeehtetoned y ^±  . ^tahtsisisa behT ± :gqf =:)a;q(

^e bStel, petsnoitcudniehtr oF ± )x;q(  .  S2 p[=:)ax; p(±^nehT ± :)a; p(

hT e s buS e tsnoCt r noitcu

nI r edr o ot wohs taht sAFD dna sAF N ah ve eht sa em lanoitatu pmoc wo p e ,r ag ve eht es bus t tsnoc r noitcu

,hcihw nevig na ,AF N stcur tsnoc a AFD taht st pecca eht emas egaugnal . ehT te bah pla f o eht wen AFD si

aemaseht s taht f o ht Ne .AF tesehtsiQf I sf o t seta f o eht ig v ne N ,AF ht en eht tes 0Q of ts seta of t eh wen

AFD si ,)Q(P the r  ewo p tes f o ,Q taht i ,s eht es t f o lla es bus ts f  o .Q nI an r  ehto ,sdr ow a st eta f o the wen

AFD si a tes f o ats t se f o eht AF N . f I 0q si eht st r  a t etats f o t eh AF N , neht f g0q si eht ts a tr ts ate of t eh wen

AFD . A etats ni eht n we AFD si it pecca ng f  i it sniatnoc na ac pec it ng ts eta f o eht N .AF f I ± si t eh

noitisnar t noitcnuf f o eht ,AF N neht ew en ¯ ed eht noitisnar t noitcnuf 0± f o eht wen AFD sa swollofsasiadnaQf otes busasiSer ehW y o bm S2 p[=:)a;S(0±:l ± :)a; p(

16.  nialpxE urdnuorgeht l f f ose i otuaetin m enuJ()m5(.ata - yluJ - 3102 )

ot peD f ESC , S BJ IT 7

Page 8: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 8/58

FL TA 65SC01

f ot peD ESC , S BJ IT

Page 9: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 9/58

  8

Page 10: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 10/58

FL TA 65SC01

UN TI 2

otuAetiniF m oisserpxEralugeR ,ata ns

1.  T.P . teL R be a r ge u ral e px ser is on. nehT ereht stsixe a f etini notamotua M = (Q, 

ihw)A c ccah e stp L(R 01(.) m) nuJ( e- 4102yluJ )

2.  enif eD vired noita , yt p se noitaviredf o , noitavireD eert & amb suougi .rammarg iG veaxe m f elp o er a hc  . enuJ()m4( - 5102yluJ )

De vir a Tnoit r ee

seer tesr a p"dellacosla(seer tnoitavir eD " awaer a)k oo bs'ihteSni y r ot e ser  p e httn e g ene ar nir tsf onoit gs

ni a g mmar ar . ehT e.i,sgnir tsehtf oer utcur tsehttuo banoitamr of nievigoslay  . aweht y eht y dezinagr oer a

sni y etaclacitcatn g ir o e .s

noitinif eD

r ammar ganeviG :tahthcuseer tasiGr of teer tnoitavir eda,>P,s, N,T<=G

ehT le balsitoor e bd y s er asevaeleht bdele bal y slanimr et y slo bm

hcaE siedonetaidemr etni nonay bdele bal - er aner dlihcstineht,Asile balstif i,dna,lo bmyslanimr et

 bdele bal y sy ,2s,1sslo bm  ... ns, 2s1s=::Anoitcudor  pastsixeer ehttahthcus ns... ni P

evaelehtf osle balehT nir tsehttneser  per )egnir f (s g g tar ene e ty bd  .  btietacidnilliweW y nir ts g .)t(

I saesit y llausu(snoitavir edf otesastneser  per eer tnoitavir edatahteesot y r om e nonaht e) for emaseht

nir ts g r tnoitavir edasier ehtnoitavir edhcaer of tahtdna, ee for ht e sa em ts r ni g  . sedicnioc)G(LecneH

nir tsf otesehthtiw gs g bdetar ene y del bisso plla r e r tnoitavi ee s f Gr o  . y betonedewf i,yllamr of er oM

r tnoitavir edllaf oteseht)G(TD e se for w,G e vah e niwollof eht g re :tlus

Pr noitiso po

f ot peD ESC , S BJ IT 9

,¦ ,G q0,

Page 11: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 11/58

FL TA 65SC01

L *Tniah pla{=)G( | nir ts=ah pla (g )t of r mos e TDnit (G) }

el pmaxE

L nalehtniagar edisnocsute g au g pxelacir emunf oe r ,snoisse phtiw r udo cti sno

mu N=:: pxE | pxE+ pxE | pxE* pxE

r of eer tnoitavir edel bisso patahtevaheW nir tseht g htsi5*3+2 e f gniwollo

 pxE

/|\

|/ \

/ | \

 pxE + Exp

|  /|\

|  / | \

|  / | \

 pxEmu N * Exp

| | |

2 mu N mu N

|  |

3  5

nir tsemasehtr of snoitavir edlar evesotsdno pser r oceer tsihT g lnor ef f idhcihw, y of r iohceht ec ehtf o

non - nimr et a pxeotl a tadn eac vir edh a tsnoit e . p

ibmA g ytiu

llaususinoisser  pxenaf oer utcur tsehT y e ss e itn a emstiter  pr etniotl a nin g ehT. e px er 5*3+2noiss f r o

nidne pedseulavtner ef f idowtsahel pmaxe g tsdednetnistino ruc ut r :e I wf e mussa e botti e 2 + ( )5*3

.i( e.  br ehtegotde puor g5dna3 y .71sitluser ehtneht)* If htno, e ,dnahr ehto we mussa e botti e ( )3+2

ht,5* e htn e re 52sitlus  . I i bmaf odnik sihtdiovaotr edr on g tiu y ehttahtlaitnessesiti, g r ammar g ene ar set

f ot peD ESC BJS, IT 10

Page 12: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 12/58

FL TA 65SC01

lno y aer of er utcur tsel bisso peno c nir tsh g nalehtni g au ge  . tsehtecniS r detneser  per sier utcu b ehty

er tnoitavir ed e hew, a ehtev niwollof g :noitinif ed

Def noitini

i bmasiGr ammar gA g nir tsatsixeer ehtf isuou g ni L vir ede bnachcihw)G( bde y id)er omr o(owt f r ef e tn

der r  tnoitavi ee .s

el pmaxE

evo bael pmaxeehtnir ammar gehT ehty bosladetar enege bnac5*3+2gnir tsehttcaf ni,suougi bmasi

niwollof g tr :ee

 pxE

/|\

|/ \

/ | \

 pxE * mu N

/|\ |

|/ \ 5

/ | \

Exp + Exp

|  |

u N m  mu N

|  |

2  3

ni puor gehtotsdno pser r oceer tsihT g htelihw,5*)3+2( e r t ee htni e exa l pm e a vo b e c otsdno pser r o +2

( 3 * 5 .)

naler aer ehT g au g llacisnir tnier ahcihwse y .i,suougi bma e  . i bmar iehtetanimileotel bisso ptonsiti g seitiu

nahctuohtiw g ni g eht nal g gau e.

f ot peD ESC BJS, IT 11

Page 13: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 13/58

FL TA 65SC01

Def noitini  : llacisnir tnisiLegaugnalA y e bnacf isuougi bma g lnodetar ene y by suougi bma g ,sr ammarever of ry g tahthcusGr ammar L=L htevahew,)G( a i bmasiGt g .suou

lik cuL y, nal g au g nitser etnier ahcihwse g or  pf oweivf otnio pehtmor f g nimmar g llausu y toner a

llacisnir tni y i bma g nondnif nacewer of er ehtdna,suou - i bma g hcihwsr ammar gsuou g hW.mehtsetar ene en

non(a - bdetneser  psiLegaugnal)suougi bmayllacisnir tni y ougi bmana ehtetanimileot",Gr ammar gsu

i bma g Gf oseitiu " r ehtonadnif otsnaem r g Gr amma ' hcihw, i bmanonsi g hcihwdna,suou ge tar en e ehts

nalemas g au ge L.

3.  niatbO na   NFA ot ac ec pt eht   llof o iw ng lang au ge L  =  {w  | w

baban  abaro

n  hw ere n }0t (6m)( ceD - ,3102 enuJ - yluJ - 4102 )

.4 gniwollof ehttrevnoC NF iuqenaotniA v tnela DFA  . ceD()m01( - 3102naJ nuJ() - luJ y- 5102 )

.5 gniwollof ehttrevnoC NF DtnelaviuqestiotA F D()m01(A nuJ( - luJ y- 02 51 )

f ot peD ESC , S BJ IT 21

Page 14: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 14/58

FL TA 65SC01

6.  niatbO Nna F hcihwA acce tsstp r ni g af os ’ dnas b’s gnitrats ehthtiw ts r gni ba  . )  . 7( m)(

nuJ e- 3102yluJ )

7.  enif eD marg m ohCnialpxE?ra m areiHyk s r axenaeviG?yhc m enuJ()m6(elp - 4102yluJ )

r of A tsihtf or ammar glam y :f ostsisnoce p

tf el(selur noitcudor  pf otesetinif a - edisdnah thgir - f oecneuqesaf ostsisnocedishcaeer ehw)edisdnah

seht e sy slo bm

slanimr etnonf otesetinif a y nitacidni(slo bm g nacelur noitcudor  pemostaht ye bt e a )deil p p

a slanimr etf otesetinif y nitacidni(slo bm g udor  pontaht c noit r celu a bn e il p pa e )d

str atsa y nitsida(lo bm g slanimr etnondehsiu y )lo bm

f ot peD ESC , S BJ IT 31

Page 15: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 15/58

FL TA 65SC01

eht,el pmaxer oF gra mm r a nimr ethtiw a sl , tnon e nimr a sl , pr udo c noit r selu

r ehw(ε e ε ehtsi e t pm y nir ts g)

k smohCehT y hcr ar eih y niwollof ehtf ostsisnoc g le :slev

yT pe-0 sr ammar g detcir tser nu( )sr ammar g cni l edu lla r of m la .sr ammar g yehT etar eneg caxe lt y lla

segaugnal taht nac e b dezingocer by a ir uT ng am c .enih esehT al n segaug er a osla nwonk sa eht cer u evisr ly

nalel bar emune g gau e .s N sihttahteto si tner ef f id ehtmor f evisr ucer al ngu sega hcihw c na e b d ce ided by naawla ys- nitlah g nir uT g nihcam e.

epyT -1 txetnoc(sr ammar g - ehtetar eneg)sr ammar gevitisnes txetnoc - segaugnalevitisnes  . esehT sr ammar g

evah ur l se f o eht fo mr htiw a lanimr etnon na d , dna strin sg f o t nimr e als dna non t r e im .slan ehT sgnir ts

 pmee byamdna t tu b,y pmenone btsum t elur ehT.y si f idewolla tonseod r ae p pa no eht thgir edis f o any

lur e. ehT segaugnal de bir csed y b eseht sr ammar g er a tcaxe ly lla gnal uages taht nac e b cer o dezing by a

r aenil dednuo b notamotua a( citsinimr etednon gnir uT enihcam esohw e pat si dednuo b by a atsnoc nt tim se

ht e nel g ).tu pniehtf oht

pyT e-2 g txetnoc(sr ammar - eer f g )sr ammar g txetnocehtetar ene - naleer f g au g .se bdenif eder aesehT y selur

f o eht fo mr htiw a non t lanimr e dna a ir ts ng f  o t r e m slani dna non t r e im n la .s esehT segaugnal er a ex tca ly

lla segaugnal taht nac e b cer o dezing by a non- ed t citsinimr e nwodhsu p ua tom .nota xetnoC t- eer f al n segaug – r o r ehtar the tes bus f o citsinimr eted etnoc tx - eer f al ng au eg – er a eht t laciter oeh b sisa r of eht esar h p

er utcur ts f o tsom gnimmar gor  p ,segaugnal hguoht r ieht s ny tax osla sedulcni etnoc xt- evitisnes eman

r alcedoteudnoituloser a snoit a pocsdn e  .  anetf O s f otes bu otdesuer asr ammar g am k sr a pe i gn e eisa r hcus,

 bsa y Lna L sr a p e .r

e pyT -3 sr ammar g r aluger ( )sr ammar g etar eneg the re r  alug al n .segaug hcuS a r ammar g r tser i stc sti selur ot

a gnis le lanimr etnon no eht f el t- dnah edis dna a hgir t-h dna edis gnitsisnoc of a is n elg term ani l, p bisso ly

dewollof y b a elgnis lanimr etnon r ( i thg re lug a )r . evitanr etlA l ,y eht hgir t- dnah edis f o eht gr r  amma nac

tsisnoc f o a elgnis ,lanimr et yl bisso p ecer  p d de y b a gnis le lanimr etnon tf el( aluger r ;) eseht r eneg eta eht

segaugnalemas – ewoh v f i,r e tf el - ur r aluger l thgir dnase - r aluger ur l se er a c ,deni bmo eht egaugnal n dee on

r egnol e b .r aluger ehT elur si osla olla w de er eh f i eod s ton p pa e r a on t eh ri hg t edis of any elur . esehT

segaugnal er a yltcaxe lla segaugnal taht nac e b dediced by a etinif etats .notamotua ,yllanoitiddA siht

imaf ly allamr of f o n iat boe bnacsegaug n de by r  aluger ex ylnommocer asegaugnalr alugeR .snoisser  p desu

ur tslacixelehtdnasnr etta phcr aesenif edot c or  pf oer ut g nimmar g lang gau e .s

.8  sI suougibmarammarggniwollof eht (7 J()m u en - Ju yl 102 ceD,4 - 3102 )S - |Ba> AbA - Sa> | AAb |a

f ot peD ESC , S BJ IT 41

Page 16: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 16/58

FL TA 65SC01

B - |Sb> |BBa b

I sit am i b ug ou bs eca su e t eh re are two di®erent le tf most ed r vi ations f r o

ht e string aa :a

.9 niatbO rammarg ot etareneg gnirts gnitsisnoc f o yna rebmun f o a’s and b’s w hti ta tsael

one (.b 5m)( ceD -2 10 4, uJ n-Ju yl - 102 )

.01 niatbO a rammarg ot etareneg eht gniwollof egaugnal L R WW{= erehW W ,a{ .}*}b (

)m5 nuJ( - yluJ - 102 5)

f ot peD ESC , S BJ IT 51

Page 17: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 17/58

FL TA 65SC01

.11 O niatb a rammarg ot eg n etare the f lo ol w ni g langu :ega L = { 0m

1m

2n

| =>m 1 a dn n>= .}0

5( m () enuJ - yluJ - 3102 )

L {= |w n > n  }

L = { an

bm

ck

| m2+n = k rof ,0=>n }0=>m

f ot peD ESC , S BJ IT 61

 .21  aniatbO g mar m enegotra r ehteta iwollof gn nal g au g (:e 5m) ceD( - 3102 )

a(w) 

b)w(

Page 18: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 18/58

FL TA 65SC01

1 .3   enif eD PDA  . bO at ni PDA ot ecca pt the langu ega L = a{n

bn

| n }1=> by a fi lan ats te  . 5( m)nuJ( - luJ 02y 51 )

14.  etirW cilppanoetontrohsa noita o rf txetnocf ee gr ma mar. ceD()m7( - 102 4)

lleW - htnerapdemrof esesmsisehtner a psir ammar geer f txetnocaf oel pmaxelacinonacehT atc nih g ihw, c sih rep er tnes a evit ehtf o

ge clar en ase  . slanimr etowter aer ehT y slanimr etnonenodna")"dna"("slo bm ym Slo b  . hT e pr noitcudo

lur es a erS → SSS → )S(S → )(

l pitlumotsSswollaelur tsr if ehT y bdesolcneemoce botsSswollaelur dnoceseht; y tam c gnihr ehtsetanimr etelur dr ihtehtdna;sesehtner a p ce .noisr u

lleW - k carberauqsdnasesehtnerapdetsendemrof te snihctamf osdnik tner ef f idowtsiel pmaxelacinonacdnocesA g htner a pdetsen ese d,s esc bir e bd y eht

:snoitcudor  pS → SSS → )(S → )S(S → ][S [→ S]

slanimr ethtiw y )(][slo bm a tnondn r e nim a .Slniwollof ehT g vir ede bnacecneuqes e tahtnid g ammar r:

( )])][(]]][][)()([[[A r aluge r marg m ra

r evE y txetnocsir ammar gr aluger - txetnocllatontu b,eer f - r aluger er asr ammar geer f   .  ehT f gniwollotxetnoc - eer f g mmar a woh,r eve er oslasi,r g lu r a .

S → aS → Sa

f ot peD ESC , S BJ IT 71

Page 19: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 19/58

FL TA SC01 65

S → S blnoehtelihw, bdnaaer aer ehslanimr etehT y non - Ssilanimr et  . nalehT g yt pmenonllaside bir csedegau

nir ts g sf os a htsdn at e .nidnsihT g er sir ammar g ir stinilanimr etnonenonahter omsahelur on:r alu g th - ,edisdnah a edn a hc of ht e es

n ir ehtf odneemasehttasislanimr etno g th - .edisdnahr evE y er g r alu g ltcer idsdno pser r ocr ammar y motuaetinif citsinimr etednonaot a wos,not e isihttahtwonk

er a g lr alu ang gau e.lof saylesr eter omde bir csede bnacevo bar ammar geht,slo bmyse pi pgnisU :swol

S a→ | aS | S baM ct iapgnih rs

I txetnocan - eer f g awehtsr etcar ahc pur ia pnacew,r ammar y bhtiwodew rac stek   . :el pmaxetsel pmisehTS → bSaS → ba

nalehtsetar enegr ammar gsihT g au g er tonsihcihw,e g nidr occa(r alu g ni pmuPehtot g L er r of amme g r alulanguage .)s

r ahclaice psehT ca t r e sdnatsε ehtr of e t pm y gnir ts . By nahc g ni g evo baeht g mmar a otrS → a | bS ε

egaugnalehtgnitar enegr ammar ganiat boew daetsni  . lnosr ef f idsihT y t pmeehtsniatnoctitahtni y gnir ts

ir oehtelihw g ammar glani r .tondidglA ebraic e rpx e snoisstxetnocasier eH - sr of r ammar geer f y llacitcatn y y,xsel bair avehtnisnoisser  pxeciar  beglaxif nitcer r oc

a :zdnS → xS y→S → zS → S + SS → S - SS → S * SS → S / SS → ( S )

sihT g gnir tsehtetar eneg,el pmaxer of ,nacr ammar+x( y x*) - *z y )x+x(/

as :swollofS ( eht str ats y )lo bm→ S - b(S y )5elur

S*S→ - b(S y )Stsomtf elehtotdeil p pa,6elurS*S→ - b(S/S y ir ehtotdeil p pa,7elur g )Stsomth

→ ( S*)S - b(S/S y )Stsomtf elehtotdeil p pa,8elur→ ( S*)S - )S(/S (by lur e il p pa,8 e )Stsomthgir ehtotd→ ( S*)S+S - /S ( ()S etc ).→ ( S*)S+S - /S*S ( )S→ ( S*)S+S - /S*S ( )S+S

x(→ S*)S+ - /S*S ( +S )S

+x(→ y S*) - S(/S*S + )S+x(→ y x*) - *S y (/ )S+S+x(→ y x*) - *S y )S+x(/+x(→ y x*) - )S+x(/y*z+x(→ y x*) - *z y )x+x(/

namtahteto N y awr ednuedamer ewseciohc y sawetir wer hcihwotsa g nio g ndemr of r e pe bot e tx . esehTr ar ti br aetiuqk oolseciohc y ettamasA. eht,tcaf f or y llanif gnir tsehttahtesnesehtni,er a y sidetar eneg

awla y hts e same ht,el pmaxer oF. e se dnoc a dr ihtdn er wr ti esS*S→ - b(S y )Stsomtf elehtotdeil p pa,6elurS*S→ - b(S/S y )Stsomthgir ehtotdeil p pa,7elur

D f ot pe ESC BJS, IT 81

Page 20: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 20/58

FL TA 65SC01

 bdluoc e nod e ni ht e tiso p po e ord r  e :→ S - b(S/S y ir ehtotdeil p pa,7elur g )Stsomth

S*S→ - b(S/S y lehtotdeil p pa,6elur e )Stsomtf

15.  nialpxE otuaetinif m noitisnartnolispehtiwata . (7 enuJ()m - yluJ - 2 410 )

nA lamr of ni tnemtaer t f o €- ,s'AF N gnisu noitisnar t smar gaid htiw f wolla ed sa a .le bal nI eht ex sel pma ot,wollof k niht f o eht notamotua sa gnit pecca esoht secneuqes f o al b sle ola ng p shta mor f eht tr ats ts ate ot a

gnit pecca .etats oH w ,r eve hcae e ola ng a a p ht si i" n "el bisiv j ,.e.i ti noc t ir b setu gnihton ot eht ts ir ng nolaht e pa .ht

In Fig  . nasi €- nocsr e bmunlamicedst pecc.atahtAF N - 2:f ognitsis  . nir tsA g idf o g ,sti1  .  r o+lanoit ponA - is g ,n3  . dA ec mi a dna,tnio pl4  . nir tsr ehtonA g idf o g sti  . tr ehtiE nir tsehtr o,stigidf ognir tssih g nac)2(

t pmee b y nir tsowtehtf oenotsaeltatu b, g idf os g btsumsti e non e t pm y.

16.  nialpxE noitacilppaeht f o )m6(noisserpxeraluger nuJ( - luJ y- 02 51 )

·hcr aeS sdnammoc hcus sa eht XI NU per g r o tnelaviuqe sdnammoc r of f gnidni sgnir ts taht eno s see i beW sr eswor  b r o txet - gnittamr of s sy t .sme esehT smetsys esu a uger l r a -ex noisser  p - ek il noitaton of

gni bir csed a p t- snr et taht eht r esu w tna s to dnif ni a elif . D tner ef f i hcr aes s smetsy noc v tr e the re alugser  pxe lif ehtnonotamotuatahtetalumisdna,AF Nnar oAFDar ehtieotninois e nie b g es arche .d

· lacixeL - ana l r ezy ,sr otar eneg hcus sa xeL r o .xelF llaceR taht a lacixel ana lyz r  e si eht tneno pmoc f o r eli pmoc taht sk aer  b eht ecr uos r  p o mar g otni lacigol stinu c( della t snek o ) f o eno r o more chara tc e sr aht

evah a der ahs si acif ing n .ec Ex sel pma f o snek ot i edulcn ke sdr owy e( . ,.g )elihw , sr eif itnedi (e. ,.g any l tte edewollof y b or ez r o er om sr ettel r o/dna )stigid ,and S ,gi T hcus,SI sa + r o .=< A lacixel - ana l r ezy tar eneg o

st pecca snoit pir csed f o t eh mr of s f o ot k ,sne ihw ch are se sen lait ly luger ar ex ,snoisser  p na d udor  p sec a D AFocer taht g nek othcihwsezin a e p p r a ns e htnotx e .tu pni

f ot peD ESC , S BJ IT 91

Page 21: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 21/58

FL TA 65SC01

3tinU

reporP,segaugnaLralugeR segaugnaLralugeR f oseit

1.  evorP up m gnip mel m (?a 5m enuJ() - 5102yluJ yluJ, - 4102 ) 

r oF eve ry r  aluger egaugnal er eht si etinif a etats notamotua )ASF( taht st pecca eht ugnal a .eg ehT re bmunf o setats ni hcus na ASF er a detnuoc na d taht tnuoc si desu sa t eh u p m i p ng el ngth p. r oF a ir ts ng of el n htgta tsael  p, tel  s0  e b eht tr ats etats dna tel  s1, ... , s p  e b eht euqes n ec of eht en xt p setats detisiv sa eht gnir ts is

e ttim e .d esuaceB eht FSA sah no ly p ,setats nihtiw siht ecneuqes f o  p 1+ detisiv setats eht er m tsu e b tatsael etatseno th ta si rep etir W.detae S fo hcusr a ts ahtsnoitisnar tehT.eta t k at e eht ma enihc or f m t eh tsr if

r etnuocne f o etats S ot t eh dnoces r etnuocne f o etats S hctam emos ir ts n .g sihT gnir ts si c la l de  y ni ehtecnisdna,ammel eht enihcam wi ll hctam a ts ir ng uohtiw t eht  y ,noitr o p r o eht gnir ts   y e bnac ae per t de any

htf osnoitidnoceht,semitf or e bmun e ammel er a sa sit fie .d

amigniwollof eht,el pmaxer oF g ASFnaswohse .

ehT ASF st pecca eht r ts i :gn ab .dc ecniS siht nir ts g sah a htgnel hcihw si ta tsael sa lar eg sa the num r  e b fo,setats hcihw si ,r uof elohnoegi peht setacidniel picnir  p taht er eht tsum e b ta tsael eno etae per d stategnoma eht tr ats etats dna eht en xt r  uof detisiv etats s. nI siht ex ,el pma no ly q1  si a er detae p .etats ecniS eht

atc bgnir ts bus k se eht enihcam hguor ht oitisnar t ns taht tr ats ta etats q1  dna dne ta etats q1, taht noitr o pdluoc e b er p detae dna eht ASF dluow llits ,t pecca ig v gni the nir ts g bc ba cd. evitanr etlA l ,y noitr o pc beht

e bdluoc vomer de dna ASFeht llitsdluow t pecca ivig ng eht r ts ing .da smr etnI f o eht gni pmu p el m ,am ehtgnir ts otninek or  bsidc ba an x noitr o p a a,   y c bnoitr o p adna   z  noitr o p .d

2.  evorP w{=Ltaht | asiw ordnilap m ralugertonsi}*}b,a{noe  . =L,.e.i { ,aabaa a ,ab

abbbba }…, 8( m () ceD - 4102 , nuJ e- 3102yluJ )

nesacehT = emtsu j0 a awlaεos(ε=utahtsn y hctams e r s ∗ cehtdna;) a nes = emtsu j1 a mutahtsn a hct es

naos(r y r sehctamoslar gnihctamgnir ts   ∗).  r oF xe a l pm e Σf i, = {a , b, c}

msgnir tsehtneht, ba=r dna nihcta g r ∗ a er ba, ba,ε a , b ababa , b e .ct

er aedulcnit’ndidewtahteto N g alu r r  pxe e ‘ehtr of noiss   ∗ l pmaxeXI NUehtnignir r ucco’ e lSnos i ed .1

r ef er er aewte bah plahcihwwonk ewecno,r evewoH r ni g t ,o Σ = ,1a{ ,2a as}na,... y gnacew, e ehtte ef f c ot f ∗ nisu g er eht g noisser  pxer alu

1a( |a2| ... | )na ∗ hw i bdehctamdeednisihc y na y Σnignir ts ∗ 1aesuace b( | 2a | ... | bdehctamsina y yna

sy lo bm ni )Σ

3.  evorP taht L irtslla{= ng 1f os ’s lesohw eng iht s irp m tonsi}e reg alu r  .  ,.e.i L={12,1

3 ,1

5 ,1

7

,111

 ,-- -- } (8m)( ceD - 3102 )eso p puS eht nemetats t si ,eur t na d siht al n ag u eg is re lug a .r ehT n er eht ex stsi a etinif (ASF state ua tomat no

taht cer o sezing siht al n ,egaug hcihw ew llac M. ehT gni pmu p ammel sa sy th ta er eht ex stsi a ar utan

f ot peD ESC , S BJ IT 02

Page 22: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 22/58

FL TA 65SC01

r e bmun p hcus taht r of eve ry gnir ts s ni )M(L of htgnel ta tsael , p eht re si a iso pmoced t no f o =s xyz cusht a :t

| |y 0>| p=<|yx

,wo N ew nac emussa taht er eht si a gnir ts w ni )M(L hcus taht k =|w| si eht tsr if emir  p r e bmun gr ae t r e t nah p ecnis er eht er a etinif ni ly am ny p emir .sr e bmun esuaceB w si in )M(L and |w| > , p w nac be decom eso p

x=wsa y vo baehtseif sitastahtz e c .snoitidno

wo N r edisnoc eht gnir ts . yB eht noitidnoc 3 ,evo ba v si ni .)M(L ,suhT eht htgnel f o v tsum e b a r  p mie bmun r . tuB . r aelC l ,y k | 1(k + |y| ) dna k > .1 ecneH |v| si ton r  p mi .e sihT noitcidar tnoc seil pmi taht ht

ehtdna,eslaf sinoitiso p pus g nalnevi g er tonsiegua g r alu .

4. ,Q(=MteL ¦ naeb)A,0q,G, F gaugnalehtgnizingocerA e L  . rehtnehT e e stsix tnelaviuqena

)R (L=LtahthcusLegaugnalralugerehtrof R noisserpxeraluger  . ceD()m8( - 3102 ) ( nuJ - luJ y-

02 ceD,51 - 4102 ) teL n e b eht gni pmu p -l amme noc ts .tna tseT lla sgnir ts f o htgnel wte b e ne n dna 2n-1 r  of sr e bmem h pi ni L

f I ew dnif neve eno us hc gnir ts , t neh L is i f  n in ti e. ehT nosaer si taht ht e pu gni pm l mme a seil p pa to s hcu a

nir ts g 'de pmu p``e bnactidna, ' nir tsf oecneuqesetinif ninawohsot gs r  a e ni L.

,r evewoh,eso p puS taht t er eh oner a ir ts n nisg L esohw el n htg si ni eht ra gn e n to 2n-1. mialceW er eht er a

on sgnir ts ni L of htgnel n2 r o ,er om dna suht er eht er a no ly a etinif nu r  e bm f o ts sgnir in .L nI foor  p

eso p pus w si a gnir ts ni L f o el n tg h ta l tsae n2 , a dn w si sa r ohs t sa any st gnir ni L t ah t sah length ta l tsae

2n. nehT eht i pmu p ng ammel seil p pa ot ,w dna ew nac tir w e w = xyz, er ehw xz is al os ni L. woH gnol

dluoc zx ?e b tI ac n t' e b sa gnol sa ,n2 uace b se ti si r etr ohs naht ,w dna w is sa tr ohs sa any st ir ng in L fo

htgnel n2 r o .er om ,n esuace b xz si ta tsom n r etr ohs naht .w uhT ,s zx si f o htgnel neewte b n and 2n-1

nir tsoner ewer ehtdemussaewecnis,noitcidar tnocasihcihw g nis L nelahtiw g r tahtniht ang .e

5. wollof ehtybdetpeccaegaugnalehtsitahW i gn F 6(.A m)( enuJ -J ylu - 3102 )

w{ siwni’a‘hcae:*}b,a{ mi em aid t rpyle e dec e f dnad o ll owe aybd b‘ ’}

w{ w:*}b,a{ basah a tsbusasab r }gni

w{ w:*}b,a{ iensah t eh r onaa r sbusasabb tr }gni

w{ w:*}b,a{ nasah unddo m dnas'af oreb unnevena m eb r }s'bf o

w{ w:*}b,a{ obsah t abah n saabd su sb t ir n }sg

6. (snoisserpxEralugeR f osnoitacilppAnoetontrohsetirW ceD()m6 - 3102 nuJ() - luJ y 02 51 )

f ot peD ESC , S BJ IT 12

Page 23: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 23/58

FL TA 65SC01

ehT tsr if tnemecnahne ot eht r aluger -ex noisser  p noitaton snr ecnoc eht tcaf taht tsom laer snoitacil p pa aed

htiw eht IICSA ahc r tca er .tes r uO sel pmaxe evah t aci py Uy us de a llams ,te bah pla hcus sa {O, .}I ehT

ecnetsixe f o ylno owt slo bmys dewolla su ot etir w tcniccus ex snoisser  p ek il 0 1+ r of a" ny ahc r r etca ."

er ehtf i,r evewoH er ew 1 82 s,sr etcar ahc a pxeemaseht,y r se nois dluow ovni l ev il gnits eht m a ll , dna uow ld

e b hgih ly in tneinevnoc to .etir w ,suhT XI NU r aluger ex snoisser  p wolla su ot etir w character lc asses ot

r altneser  per g ltcniccussasr etcar ahcf ostese y el bisso psa  . lcr etcar ahcr of selur ehT a ss es are:

ehT• sy lo bm . na"r of sdnats)tod( y ".r etcar ahc

ehT• se uq e cn e [at a r of sdnatsda...2 ht e er g lu ar e r  px e noiss

sihT noitaton sevas tuo ba f lah eht ,sr etcar ahc ecnis ew od n t' evah ot etir w eht +- .sngis r oF ex ,el pma ew

mocCnidesusr etcar ahcr uof ehtsser  pxedluoc bsr otar e ponosir a p y .J!=><[

7. f tahtwohS o ll o gniw l ertonerasegaugna g ralu 01( m) nuJ( e- 4102yluJ ) 

a{=L nbm | m,n  <ndna0 m }

tahtevor  poT L er atonsi g nalr alu g oor  paesulliwew,egau f by r  tnoc a noitcid  . emussAtaht L er si g alu r  . ni pmuPehty bnehT g L eR r of amme g r alu L na g astsixeer eht,segau

 js jer ehwL2sgnir tsynar of tahthcusLr of  p,htgnelgni pmu p szyx=s, p u tce j bniwollof ehtot g :snoitidnoc

 j)a( y j > 0x j) b( y dna, p j

x;0>i8)c( yi2z L.

esoohC s = p01 p0,ylr aelC js j p dna s 2 L. yB c noitidno ) b( ,evo ba ti swollof taht x dna y er a deso pmoc no ly f  o zer .so yB

tahtswollof ti,)a(noitidnoc y = emosr of k 0k 0> . nitluser ehtdna0=iek atnacew,)c(r eP g nir ts g bllitslliw e ni L  . ,suhTxy0

 bdluohsz e ni L  . xy0z = zx = p01)k  p(0. ,tuB lr aelcsisiht y niton L  . sisihT ac tno r ida c hthtiwnoit e ni pmu p g ammel  .  tahtnoit pmussar uoer of er ehT L er si g alu r si

dna,tcer r ocni L er atonsi g lr alu ang gau e.

a{=Lnb

m | m,n  >ndna0 m }

nalr aluger atonsiLtahtevor  poT g f oor  paesulliwew,egau by noitcidar tnoc  .  tahtemussA L er asi g r alu

nal g au ge  .  nehT b er eht,segaugnaLr alugeR r of ammeLgni pmuPehty ex elgni pmu pastsi n Lr of  phtg js jer ehwL2sgnir synar of tahthcus , p

x=s y niwollof ehtottce j busz g c :snoitidno

 j)a( y j > 0

x j) b( y dna, p j

x;0>i8)c( yi

a{=Lnb

mc

md

n  m,n| }1

nalr aluger atonsiLtahtevor  poT g bf oor  paesulliwew,egau y noitcidar tnoc  .  tahtemussA L asi

f ot peD ESC BJS, IT 22

Page 24: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 24/58

FL TA 65SC01

er g nalr alu g au ge.  bnehT y r alugeR r of ammeLgni pmuPeht L augna g se of  phtgnelgni pmu pastsixeer eht,

 js jer ehwL2sgnir synar of tahthcusL , p

x=s y niwollof ehtottce j busz g c :snoitidno

 j)a( y j > 0

x j) b( y dna, p j

x;0>i8)c( yi

a{=Ln  }erauqstcef repasin|

a{=Ln  }ebuctcef repasin|

L nisi f tini e  .  eso p puS L oslasi reg lu r a  .  gnidr occanehT t r egetninastsixeer ehtammelgni pmu po n hcus

hcuszyx=wsgnir tseer htotniwk aer  bnacew,n=>|w|er ehwniwgnir tsyr ever of taht :taht

,0>|y| | yx | nir tseht,0=>k llar of dnan=< g xyk

oslasiz ni L.

sitisitaht3n=ser ehws0=we botwesoohC a p r  e ef c uqst are.

L wte = x=00000………00000000000000000 y nelehT(.z g sihtni3n=s=wf oht ac ).esteL | |dnan=<|yx |y .k =

hT a wsit = k 00000

…000

X y z

,oS |xy =|z | 3n(=|y|+|zx

- k ) + ( )k

r F ehtdnasemitf or e bmunynay pmu pnacI,ammelgni pmu pmo gnole bosladluohsgnir tswen ehtot

nal g au ge  .  eso p puS I pmu p y nole bdluohsgnir tsweneht,nehteciwt g nalehtot g au g tahte

nelevahdluohstisi g htht a sit a pe ef r ct c e bu

8.  ylppA ammelgnipmup llof ot o lgniw a segaugn yhwdnatsrednudna octonnacew m etelp

01(f oorp m () ceD - 4102 )

=L { abana | }0tnLteL y bdenif edr aluger e b gnivahAFna ‘ .setats’n Le =wt a1 a, 2 ,a3----an a dn nisi L.

|w| n= ≥ n. L te eht ts r a tst a e bet P1. L x=wte y =xer ehwz a1 a, 2 ,a3 -- --- an-1 , y=an a dn =z

ε.

f ot peD ESC , S BJ IT 32

Page 25: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 25/58

FL TA 65SC01

mbna{=L }0tm,n|

L te L er e b g lu r a . L dnaemir  psi per ehw p1=wte | p| n= +2

 b.m=yteL y xLP y zk  ∈L

| xy zk | zx|= | |+ y |k

L te k = p-m

= (p- p(m+)m - )m

= (p- )m

)m+1( -----

csiht a mir  pe btonn e pf i -m

1( + )m ce b2≥ a su e m 1≥

L nitimi g p(2+n= pesac - )m nis2≥ ce m n≤

9.  DaniatbO F otA ca c nirtstpe g af os ’ dnas b’s ats r gnit gnirtsehthtiw 01(ba m eD() c- 3102 )

f ot peD ESC , S BJ IT 42

≥ 2 r o m+1 ≥ 2

Page 26: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 26/58

FL TA 65SC01

9.  niatbO ehtrof noisserpxeralugera FA hs ()m01(:wolebnwo nuJ - yluJ -2 510 )

R R = 1 . R 2. eW nocnac s st peccahcihwAF Nnatcur t L R ( 1 y bdewollof ) L R ( 2 ihw) ch ac e bn er r  p ese detnas L(R 1 . R 2)

I aelcsit r if mor f gur enihcamehttahte f a t r e acce nit p g L 1R ( ) vom e f s r tsmo ate 1f ot1q  .  asier ehtecniS ε-natuohtiw,noitisnar t y r ehttu pni e blliw e f noitisnar ta r tsmo a tsot1f et ate .2q I etatsn no pu,2q acc gnit pe

2f otsevomenihcameht,)2R (L lanif ehtsihcihwtats e. tr atsehtsemoce b1Menihcamf oetatstr atsehtsihcihw1q,suhT Ehtf oetats c i bmo ne amd c Menih

2f dna anif ehtsemoce b,2Menihcamf oetatslanif ehtsihcihw l.

01 . 01(:evloS m ceD() - 02 41 nuJ() - luJ y- 02 51 )

R = *)1R ( . r ehtiest peccahcihwAF Nnatcur tsnocnaceW .er ugif ninwohssa)*)1R (L It ac e boslan

r  per e tnes e .nwohssad I if mor f r aelcsit g nihcamehttaht5.3er u e can e r ehti ca oεt pec r na y f or e bmun

L nit peccasuhts)1R ( g naleht g au ge L 1R ( )*  . tslanif ehtsif qetatstr atsehtsi0q,er eH ate.

nir tsst peccahcihwAF Nnaniat bO g f os ’a s a bdn ’s ts r a nit g ehthtiw gnir ts a . b

f ot peD ESC , S BJ IT 52

Page 27: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 27/58

FL TA SC01 65

11 . lCnialpxE o axenahtiwseitreporperus m elp . 01( m)( enuJ -J 3102ylu )

usolC re ednU r noinU

:4.4mer oehT I augnalr aluger er aMdnaLf g siosneht,se L .MU

:FOOR P sihT f oor  p si pmis l .e ecniS L dna M er a ,r aluger ht ey evah uger l r a ex ;snoisser  p yas L = £ )R ( dna

=M S(£ )  . 1ULnehT \ =11 L b)S+R ( y er r of r otar e po+ehtf onoitinif edeht g snoisser  pxer alu 0.

oCrednUerusolC m nemelp tat noi

ehT mer oeht r of noinu saw edam ev ry ae sy by the esu of eht er alug r-ex oisser  p er  per s tatne i no r of t ehl na g au ge .s Ho ,r evew tel su txen r edisnoc pmoc mel ent .noita oD uoy ees woh ot ek at a uger l r a ex noisser  p

dna egnahc ti otni eno taht senif ed eht tnemel pmoc ugnal a ?eg W lle r ehtien od .ew ,r evewoH ti nac e b

,enod esuace b sa ew llahs ees ni mer oehT ,5.4 ti si sae y ot tr ats htiw a AFO dna noc ts tcur a D AF t ah

st pecca eht el pmoc m .tne uhT s, itr ats ng htiw a r aluger ex ,noisser  p ew oc u dl dnif a aluger r ex ser  p is no for

mel pmocsti e tn a :swollof s

1  . er ehttr evnoC g naotnoisser  pxer alu f.-NF .A

2  . .f tahttr evnoC - aotAFJ':: bAFO y .noitcur tsnoctes buseht

f ot peD ESC , S BJ IT 62

Page 28: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 28/58

FL TA 65SC01

UN TI 4

txetnoC - segaugnaLdnAsrammarGeerF

.1   .P T  . I ht,segaugnalralugereraMdnaLf e Lsiosn � M  . ( 01 m) enuJ( - 5102yluJ )

ler u powter aer ehT y aor  p paciar  begla er enif edotsehc g alu r nal g gau e .s If:

·  ,te bah plaetinif asiΣ

·  vodionomeer f ehtsetoned*Σ e Σr c nitsisno g f o a nir tsll g vos r e ,Σ

·  f : *Σ → M ehwmsih pr omomohdionomasi re M i as et ini f dionom , 

· S  si a tes bus f o  M  

ht e htn e set er si g lu r a  . evE ry nalr aluger g r aegau ESC .noihsaf sihtnis

If    L si any tes bus f o *Σ , eno senif ed na ecnelaviuqe r noitale ~ ( dellac the s tny a citc r oitale n) no *Σ sa:swollof u ~ v edsi f otdeni me na

wu ∈ L lnodnaf i y f i wv ∈ L for lla w ∈ *Σ  

ehT egaugnal   L si r aluger f i dna no ly f  i eht mun b r e f o iuqe v ecnela essalc s f o ~ is fi etin A( or  p of of siht isdedivor  p ni eht citr a le no eht s tcatny ic m iono d .) nehW a al n egaug si re lug a ,r eht n eht un m r e b fo

e viuq ale cn e cla ss es is e uq al ot   eht   e bmun r   of etats s  of eht laminim ted e itsinimr c etinif

a notamotu a cc e gnit p  L.

A r alimis tes f o stnemetats nac e b detalumr of r of a dionom . nI siht ,esac ecnelaviuqevo er M alel bazingocer af ot pecnocehtotsdael n egaug .

.2 

DaetirW F tniehttpeccaotA e esr tc =1Lf onoi ( =2Ldnaa*)b+a ( b+a ) b* t ah t of si r 1L ˆ .2L (enuJ()m01 - 5102yluJ nuJ() -J ylu -2 310 )

f ot peD ESC , S BJ IT 72

 

Page 29: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 29/58

FL TA 65SC01

.3   dniF eht D AF caot c ttpe h noitcesretnie Lf o 1 (= a )b+ a* +a(b b *) b+a(=2Ldna ) *)b+a(ab* tahtdnasi ˆ1Lrof 2L ( D()m01 ec- 3102 , nuJ - yluJ -2 410 )

.4  P T.  . Lsiosneht,segaugnalralugereraMdnaLf I  – M. 01( m ceD() - 4102 )

:f oor P L nalesohws’AFDe bBdnaAte g er asegau L pser ,Mdna ce vit ely.

ur tsnoC c udor  peht,Ct ct a motu a onot f dnaA B.

ehtek aM Aer ehwsr ia pehte bCf osetatslanif - Btu blanif sietats - ts ate .tonsi

f ot peD ESC , S BJ IT 82

Page 30: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 30/58

FL TA 65SC01

5 ngiseD. txetnoc - ollof ehtrof rammargeerf w sesacgni ()m01( ceD - ,3102 enuJ - 4102yluJ )

{=L |n1n0 n

EI,E ,E+EE ,E*E

E(E),Ia|b|c

ia{=L b c j k| i≠ jro j ≠k}

6 etareneG. arg mm ER rof ra 0(1*0 + 01(*)1 m enuJ() - 5102yluJ )E ,T TF, FI E,   E T,T+   *T F, F  ,)E( Ia|b|c

7. P T.  . =Lneht,StebahplarevoegaugnalralugerasiLf I *6 - egaugnalralugeraoslasiL . (

enuJ()m8 - yluJ - 3102 )

P = ,}q{( ,0{ ,δ,}S,A,1,0{,}1 S,q ) hw, ere vigsiδ e bn y:

,ε,q(δ )S = {( })A,q(,)1S0,q

,ε,q(δ {=)A ( ,)0A1,q ( S,q ), ( })ε,q

,q(δ ,0 )0

,q(δ ,1 )1

= ,q({ })ε

= ,q({ })ε

f ot peD ESC , S BJ IT 92

}l≥

Page 31: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 31/58

FL TA 65SC01

8. T.P  . - *6=L,neht,6tebahplarevoegaugnalralugerasiLf I - .egaugnalralugeraoslasiL

8( m)( Dec- 3102 )

=P ( ,0{,}q{ ,A,1,0{,}1 ,)S,q,δ,}S r ehw e vigsiδ e bn y:

,q(δ ,ε )S = ,q({ ,)1S0 ,q( })A

)A,ε,q(δ {= ( 0A1,q ) S,q(, ), ( })ε,q

,q(δ 0, )0

,q(δ ,1 )1

= ,q({ })ε

= ,q({ })ε

9. T.P  . f I L is a ger lu ra l na gu ,ega os si LR

D()m6( ec- 21 )

mussA e L dsi e if ne bd y a reg r   pxer alu e .Enoiss

ehtonasier ehttahtwohseW r reg r alu e px er usR Enoiss c hth at

E(L  )R = (L ))E( R

naleht,sitaht g tsiR Ef oegau ver eh r e sa ol f ht e nal g gau e of .E

,ǫI eer hter aer ehT:noitcudn c sa e d,s epe nidn g ehtno Ef omr of

10  . nalralugerasiLf I g ohasihdna,6tebahplarevoegau mom ht,6nomsihpro en si)L(h

osla r raluge  . )m01( ( enuJ - yluJ -2 10 5).

teL  L = (  L R) for emos luger r a ex noisser  p  R. nI ,lar eneg f i  E si a r aluger noisser  pxe htiw s slo bmy ni ,E tel ) E ( h e b eht ex noisser  p ew niat bo y b ical per ng hcae sym lo b a f o E ni  E  by . )a( h We alc mi taht  ) Reh

nalehtsenif ed g au ge . ) L( h

aenasif oor  pehT s yastahtnoitcudnilar utcur tsy aek atewr evenehws noisser  pxe bus   E  f o  R  yl p padna h otti to teg h(E , ) eht al ngu ega f o h(E) si eht emas egaugnal ew teg f i ew p pa ly h ot eht al n ug a eg  L(E)

llamr oF y,   )» E ( h(  L  = h( » E (  L ).AB S :SI f I  E si  € r o ,0 neht ( h E) si eht as me sa  , E ecnis h scod toH tcef f a eht gnir ts € r o eht egaugnal .0,suhT ( h(  L E ) ) =  E (  L ). ,r evewoH f i  E si 0 r o ,01 neht (  L E) noc t snia r ehtie on sgnir ts r o a gnir ts wi ht on

sy levitce pser ,slo bm y. T suh h(L(  )» E   = L( ) E esacr ehtieni  . edulcnoceW  L( E C h ) )  = (  L E )  = h(L( ) E ).ehT no ly to h r e sisa b esac is f  i  E = a r of emos sym lo b a ni .:.! nI siht c ,esa (  L E) =  , }a{ os ( h L(E ) ) = h{ ( . } )a

Al ,os h(  ) E  si eht r aluger ex noisser  p taht si eht gnir ts f o s slo bmy h(a). uhT s,  )» E ( h(  L si la so ( h{ a , } ) dna ewc no c edul   )» E ( h(  L = h( » E (  L ).

11.  nialpxE lpmaxenahtiwFGC e. )m5(   uJ( n- luJ y- 4102 )

Is of a r lam gr nir amma cihw h  noitcudor  pyr eve r sielu of ht e mr of    V → w  er ehw V si

a el  g ni s ,lo bmyslanimr etnon dna w si a gnir ts r o/dnaslanimr etf o animr etnon ls (w nac e b .)yt pme A

lamr of r ammar g si co der edisn etnoc" xt "eer f nehw sti noitcudor  p selur c na e b deil p pa dr ager l sse f o ehtetnoc xt f  o a animr etnon l. tI seod n to r ettam hcihw s slo bmy eht tnon e lanimr si dednuor r us by, eht elgnisawlanacedisdnahtf elehtnolanimr etnon y bdecal per e bs y eht rig disdnahth e.

 bdetar enegsegaugnaL y txetnoc - txetnocsanwonk er asr ammar geer f - augnaleer f g .seetnoC xt- eer f sr ammar g er a tnatr o pmi r of scitsiugnilni i bir csed ng eht er utcur ts f o se etn n sec na d sdr ow

lar utanni ,egaugnal dna r etu pmocni r of ecneics i bir csed ng eht er utcur ts r  pf o o immar g ng gnal ua seg dnanallamr of r ehto g au g se .

f ot peD ESC BJS, IT 03

B :sisa If siE ∅ f o a ht, e R En = .E

.

Page 32: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 32/58

65SC01

. ugnalralugerf oseitreporpnoisicednialpxE a .eg )m5( nuJ( - yluJ -2 310 )

oT etacol eht r aluger l segaugna ni mohCeht k s y ar eih rch ,y no e seciton taht eve ry er r alug al ugn a egtnocsi e tx -f eer . ehT esr evnoc si ton :eur t r of el pmaxe eht gaugnal e oc n gnitsis f o lla sgnir ts ah v gni t eh

emas r e bmun f o a s' sa b s' si txetnoc - eer f tu b ton uger l .r a oT evor  p taht a al n egaug su hc sa this is tonMehtsesunetf oeno,r aluger y llih  –  ni pmu pehtr omer oehtedor e N g le amm a nom g ehto r .sdohtem [5] 

 powter aer ehT ler u y er enif edotsehcaor  p paciar  begla g lr alu ang gau e .s I :f

·  ,te bah plaetinif asiΣ

·  vodionomeer f ehtsetoned*Σ e Σr c nitsisno g f o a nir tsll g vos r e ,Σ

·  f : *Σ → M ehwmsih pr omomohdionomasi re M i as et ini f dionom , 

· S  si a tes bus f o  M  

ht e tn he set er si g lu r a  . r evE y nalr aluger g r aegau ESC .noihsaf sihtnis

If    L si any tes bus f o ,*Σ eno defi sen na ecnelaviuqe ~noitaler ( dellac the s tny a citc r oitale n) no *Σ sa:swollof u ~ v edsi f otdeni me na

wu ∈ L lnodnaf i y f i wv ∈ L for lla w ∈ *Σ  

ehT egaugnal   L si r aluger f i dna no ly f  i eht r e bmun f o iuqe v ecnela essalc s f o ~ is fi in te A( or  p of of iht s isdedivor  p ni eht citr a le no eht s tcatny ic m iono d .) nehW a al n egaug si re lug a ,r eht n eht un m r e b of

e viuq ale cn e cla ss es is e uq al ot   eht   e bmun r   of tats es  of eht laminim ted e itsinimr c etinif

a notamotu a cc e gnit p  L.

A r alimis tes f o stnemetats nac e b detalumr of r of a dionom . nI siht ,esac ecnelaviuqevo er M nalel bazingocer af ot pecnocehtotsdael g .egau

f ot peD ESC , S BJ IT 13

TALF

.21 .

Page 33: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 33/58

FL TA 65SC01

UN TI 5

otuAnwodhsuP m ata

1  . tf eleviG m thgirdnatso m sgnirtsgniwollof ehtf osnoitaviredtso)a 10100

)b 1001

c) 11000 4( m enuJ() - 5102yluJ ceD() - 3102 )

f ot peD ESC , S BJ IT 23

Page 34: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 34/58

FL TA 65SC01

.2   tcurtsnoC P :AD F ro enuJ()m4(egaugnaleht - yluJ 4102 )

.3   tcurtsnoC D ADP wh hci ecca p st the langu ega L = {wcwR

| w ,a{ ,*}b c Σ} (. 4m nuJ() e-

yluJ 3102 )

.4   DtcurtsnoC P llof ehtrof AD o niw :g (8m () nuJ - yluJ -2 510 )

labf oegaugnalehtgnitpeccA anc rapde e htn eses  . epytynaredisnoC( )sesehtnerapf o

f ot peD ESC , S BJ IT 33

Page 35: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 35/58

FL TA 65SC01

unhtiwsgnirtsgnitpeccA m sis’af oreb m nahtero numb re f o s’b

gnitpeccA { m1n0 | }mtn

.5   iseD g nn P nalehttpeccaotAD g au g :e

a{ ib jc  k | k , j,i   ro j=idna0 i }k =

a{ ib jc  j+i | j,i  }0

a{ ib  j+i c j | i  j,0 }1

ot peD f ESC , S BJ IT

m01( ) D( ce - 3102 )

43

Page 36: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 36/58

FL TA 65SC01

.6  snoC rt u tc P :AD For t eh egaugnal =L {a

n b

n2b,a| €n t (}0 ceD()m5 - 4102 yluJ, - )3102  

.7   tcurtsnoC ADP ot tpecca f i - esle f o a C p rgor am na d trevnoc ti ot .GFC sihT( eod s n to

acce f itp  – f i  –  esle - etatsesle m 5()stne m ceD() - )3102

.8   sibaagnirtsehtrof noitaivedtahtwohS am ib g suou  . 5( m) nuJ( e- 4102yluJ )

eL Pt = ,Q( b)0Z,0q,δ,Γ,Σ e ADPa  . CtnelaviuqenA F siG hw,)S,R ,Σ,V(=G r e e

f ot peD ESC , S BJ IT 53

Page 37: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 37/58

65SC01

V = er ehw,}]qX p[,S{ q, p ∈ Q a Xdn ∈ osnoitcudor  p,Γ f R c f  ostsisno

1. itcudor  psahG, psetatsllar oF Ssno 0q[→ Z ] p0

2. Le δt ( ,q a ({=)X, r k Y…2Y1Y, ) er ehw}

nar o0e bnack ,ε=a y tatsf otsiler ak r …2r 1r dnar e bmun es  . G udor  psah c snoit

.9   omohehtsihesoppuS m orf msihpro m d}b,a{tebahplaehtot}2,1,0{tebahplaeht e nif e ybd

h&ba=)1(h;a=)0(h (2 ab=))a ?)0210(hsitahW

)b ?)02112(hsitahW)c ,)2*10(LegaugnalehtsiLf I w ?)L(hsitah

)d ?)L(hsitahw,)21+0(LegaugnalehtsiLf IlehtsiLf I a (Legaugn a hsitahw,)*)ab( - ?)L(1 5( m () ceD - 3102 )

lamr oF l ,y f i h si a msih pr omomoh no te bah pla ,:L dna w = )a 2a ... na si a gnir ts f o s slo bmy ni ,:2 neht)weh = h h)la( ( "')2a a(h n .) tahT ,si ew p pa ly h to hcae s lo bmy f o dnaw anetacnoc te eht user l ,st in r edr onir oF - hf i,ecnats ehtsi msih pr omomoh ni ,31.4el pmaxE dna W' = ,1100 neht )weh = )O(h h( )O h (h)l( l) =

) ba() ba( (  l pmaxetahtnidemialcewsa, ba ba=)e e.,r ehtr uF p panacew l gnalaotmsih pr omomohay u ega by p pa l iy ng it ot hcae f o eht sgnir ts ni eht al n egaug

tahT ,si f i L si a egaugnal r evo bah pla et ,:2 dna h si a msih pr omomoh no ,E neht h(L) = eh{ w) I w is niL .} r oF ,ecnatsni f i L si eht egaugnal f o r aluger ex noisser  p ,1*01 ,.e.i yna r e bmun of s'a uor r us n ded by

elgnis ,s'l neht )L(h si eht gnal ua eg ba( ) ." ehT nosaer is taht h f o el pmaxE 31.4 evitcef f e ly s por d eht s'1ecnis ht ey er a r al pe c de by dna snr ut hcae a otni o ba ehT emas di e ,a p pa l iy ng eht oh momor h p i mstcer id ly ot eht r aluger ex ,noisser  p nac e b desu ot evor  p taht eht re lug ar gnal au seg are olc s de rednu

smsih pr omomoh .

10 ngiseD. a DP A ot a tpecc eht tes f o lla sgnirts of s’0 a dn s’1 s cu h th ta no p er f xi h sa more s’1

naht s’0 . (5m nuJ() e- yluJ - 5102 )

f ot peD ESC , S BJ IT 63

TALF

a ∈ Σ r o

() €

, €

Page 38: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 38/58

FL TA 65SC01

11 tcurtsnoC. :ADP eccA p gnit eht tes f o lla sgnirts revo a{ , b} w ti h e uq la un mber of s’a and

b’s  . hS o ehtw m ababbarof sevo . (5m nuJ() e- yluJ 3102 )

siegaugnalehT L w{= ∈ #:*} b,a{ a )w( = })w( b#  . H er e htsi e :ADP

12 tcurtsnoC. :ADP eccA p gnit eht egaugnal f o decnalab erap n ,seseht (cons di re any yt pe f  o

ap er sehtn e )s  . 5( m ceD() - )4102

1 .3 yodwoH o orFtrevnocu m ADP ot FC G. 5( m D() ec- 3102 )

Le Pt = ,Q( b)0Z,0q,δ,Γ,Σ e a ADP  . CtnelaviuqenA F siG hw,)S,R ,Σ,V(=G r e e

V = er ehw,}]qX p[,S{ q, p ∈ Q a Xdn ∈ osnoitcudor  p,Γ f R c f  ostsisno

1. Ssnoitcudor  psahG, psetatsllar oF 0q[→ Z ] p0

2. Le δt ( ,q a ({=)X, r, k Y…2Y1Y ) er ehw}

a ∈ Σ r o

 peD f ot ESC , S BJ IT 73

Page 39: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 39/58

FL TA 65SC01

nar o0e bnack ,ε=a y bmun er

dna 2r 1r k r … r a tsile of ts a set  . hG a ps r udo c snoit

14.  trevnoC P AD t FCo G. ybnevigsiADP ,X{,}1,0{,}q,p{(=P Z ,q,δ,} Z )) ,

itisnarT on func siδnoit de nif e ybd ( 5m () Dec- 102 4)

δ  ,1,q( Z X,q({=) Z })

δ {=)X,1,q( ( XX,q )}

δ ,q( ,q({=)X,   )}

δ {=)X,0,q( ( X,p )}

δ {=)X,1,p( ( ,p   })

15. htiwGFC,ADPottrevnoC )m01(snoitcudorp nuJ( - luJ y- 02 51 )

A,AAaoA - Sa> | Sb | a

S -> SS | S( ) | H

S - BAb|SAa> | ,Ba

A - BBb> | Sa | ,a

B - Ab> | a

,ESCf ot peD S BJ IT 83

Page 40: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 40/58

FL TA 65SC01

16. axenahtiwatamotuanwodhsupnialpxE m 01(elp m ceD() - 3102 )

tatsetinif mor f r ef f idatamotuanwodhsuP owtnisenihcame aw y :s

ehT.1 y r thcihwedicedotk catsehtf o potehtesunac a otnoitisn ta .ek

ehT.2 y r e pf otr a psak catsehtetalu pinamnac for nim g a r  t a .noitisn

nwodhsuP atamotua esoohc a noitisnar t by gnixedni a t el ba by tu pni gis n ,la r uc r tne etats , dna the s lo bmyta eht pot f o eht .k cats sihT snaem th ta esoht eer ht sr etemar a p etel pmoc ly d enimr ete eht noitisnar t hta p

taht si .nesohc etiniF etats senihcam tsu j k ool ta eht tu pni langis dna eht tner r uc :etats ht ey evah no kcatsot k r ow htiw . wodhsuP a pasak catsehtddaatamotuan ar met r  e f r o c cioh e.

agnimr of r e pf otr a psa,k catsehtetalu pinamoslanacatamotuanwodhsuP t noitisnar   . tatsetiniF e am c senihesoohc a wen ,etats eht tluser f o gniwollof eht t snar iti .no ehT noitalu pinam nac e b ot hsu p a p ucitr a l ralo bmys ot eht pot f o eht ,k cats r o ot po p f f o eht pot f o t eh .k cats ehT notamotua nac evitanr etla ly i er ong

eht ,k cats dna evael it as ti i .s ehT eciohc f o m noitalu pina r o( on )noitalu pinam si denimr eted by ehtnoitisnar t ta .el b

tuP :r ehtegot neviG na tu pni ,langis tner r uc ,etats dna k cats s ,lo bmy eht automat no nac lof l wo a tra sn ti noitatsr ehtonaot e, a noit podn a ll y talu pinam e ) po pr ohsu p( ht e ts a .k c

nI ,lar eneg nwodhsu p atamotua yam evah lar eves snoitatu pmoc no a nevig tu pni r ts ,gni emos f o hcihwyam e b gnitlah ni ecca p gnit f noc i ug r .snoita f I no ly eno c noitatu pmo stsixe r of lla ca c det pe ir ts n ,sg eht

tluser si citsinimr eteda nwodhsu p notamotua )ADPD( dna eht al n egaug f o eseht sgnir ts si a r eted m ni i cits

f ot peD C ES , S BJ IT 93

Page 41: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 41/58

FL TA 65SC01

txetnoc - eer f .egaugnal to N lla etnoc tx - eer f segaugnal er a .citsinimr eted sA a ecneuqesnoc f o eht evo ba ehtADPD si a tcir ts ly r  ek aew tnair av f o eht ADP and er eht ex stsi on mhtir ogla r of gnitr evnoc a DP A ot na

laviuqe e ,ADPDtn if hcus a ADPD e .stsix

I tsnisk catsowtotsseccanotamotuaetinif awollaewf ae d f o notsu j e niat boew, a er om ewo p f r dlu e iv ec ,

tnelaviuqe ni r ewo p ot gnir uTa m nihca e. r  aenilA dednuo b notamotua si a ecived hw i hc is m r  o e po uf r ewht an a nwodhsu p a ltu bnotamotu e htosss a nir uTan g ma nihc e.

ehT gniwollof si eht lamr of noit pir csed f o eht ADP hcihw ingocer z se eht gnal au eg y bnif a tatsl e:

ADP f r o b( y tatslanif e)

, er ehw

tsnixisgniwollof ehtf ostsisnoc ruc :snoit

,  ,  ,  ,  ,

dna   . 

nI wo ,sdr ni etats r of hcae lo bmys ,daer eno si dehsu p otno eht ts .k ca gnihsuP lo bmys no pot ofa hton er si dezilamr of sa ical per ng t po y b . nI st eta r of hcae s lo bmy daer eno si po p ped.

tA any tnemom eht ua t notamo may om ve or f m ats te ot st eta , elihw ti yam om ve mor f state to

ca ce nit p g etats lno y nisaf ostsisnock catsehtnehw g el . r ehT e  mees s  ot    be  no yllar eneg desu re r   p ese noitatn f r o DP A. H r e e ew have de detci p eht

oitcur tsni n  by an  edge or f m  ts a et ot   ts a et elle bal d  by ( er da ;

cal per e  y b .)

f ot peD ESC , S BJ IT 04

Page 42: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 42/58

FL TA 65SC01

UN TI 6

txetnoCf oseitreporP - segaugnaLeerF

1 etanimilE. neht - no - rf slobmysgnitareneg -om S - Sa> | A,C|A - B,a> - C,aa> - .bCa>

8( m nuJ() - yluJ -2 510 )A ,noitatumr e p osla llac ed na ar r a“ n eg m tne mun b ”r e r o ”,r edr o“ si a egnar r aer m tne of eht ele m ne ts f  o na

der edr o tsil S otni a eno - ot - eno co ecnedno pser r iw th S ti es l .f A gnir ts of htgnel n sah !n p mr e ut noitatumr eP/moc.mar f low.dlr owhtam//: ptth(dr owhtaM:ecr uoS a )lmth.noit

eB wol are ht e pe umr ta snoit f o   nir ts g AB .CAC,ACB,CAB,BCA,CBA B C, BA

r eH e si a nisunoitulos g ba ar tk c c nik g.

2 warD. deht epe vobanevigsahpargycnedn e  . nonsiA - f elbahcaer rom ileretf A.S m gnitani

,A G S{,}a{,}S{(=1 - ,}a> S)  . 6( m enuJ() - 3102yluJ )

eW uohtiwLFCr edisnoclliw t. I saee bdluowt y naotddaot y br ammar g y str atswenagnidda y ,0Slo bm

,V2A,xA!Amr of ehtf onoitcudor  pA:noitineD jS!0S [V(2x )T

si tf el evisr ucer   noisser  pxesuoiver Pel pmaxE. r g wr amma a ls e r tf ce visr u e !E. E+ T jT

T T!   F F j

!F I j ( )E

I ! a j b A pot - nwod r a p s r e dluow tnaw ot d evir e eht omtf el ts animr et l sa s noo sa sso p ibl .e tuB ni t eh l tf e

evisr ucer r ammar g o ba v ,e ni r edr o ot evir ed a laitnetnes mr of taht sah eht omtf el st ,lanimr et ew evah to

evir ed a laitnetnes r of m taht sah r ehto mr et i slan ni it. noitavir eD f o a+a+ b+a :si E ) T+E ) T+T+E )

+T+T+E T  ) +T+a T T+ eW lliw etanimile eht tf el sr ucer i no os t tah ew c na

lanimr ettsomtf elehthtiwmr of laitnetnesaevir ed a htoondn r e t r e nim a .sl

3 dniF. rgehttuo a ramm w hti Htuo  – P snoitcudor G = ( D,B,A,S{ }, {a} SaoS{, | ,BA A - ,H>

B- D,H> - b> } )S,  . 6( m enuJ() - 4102yluJ )

r edisnoC lla el bisso p of r u - pets deri .snoitav ssoT tuo setacil pud ta any ni t etaidemr e .tnio p oslA re evom

fr disnocmo era tsnoit r sgni hcihwAAAAsahcus al per (detaitnatsnie btonnac ec htiwd t r e nim a )sl

f ot peD ESC , S BJ IT 14

Page 43: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 43/58

FL TA 65SC01

tni(xni h )eer htesacsi r ewef r o .s pets hT e tnonf or e bmun r e slanim ta hcae pets tonnac ex eec d t eh

tsf or e bmun e ehtnitf els p d r e .noitavi

)a S - AA> -> Aa -> aa

S - AA> -> aA -> a A b -> a ba

S - AA> -> aA -> a  bA -> aab

S - AA> - aA> - aa> eled( t )e

S - AA> - aA> - aA b> - aa b>

S - AA> - aA> - a bA> - eled(a ba> t )e

S - AA> - AA b> - Aa b> - )eteled(aa b>

S - AA> - AA b> - )eteled(aA b>

S - AA> - A bA> - )eteled(A ba>

S - AA> - A bA> - )eteled(a bA>

S - AA> - bAA> - )eteled( bAa>

S - AA> - bAA> -  baA> - )eteled( baa>{ aa , aba a, a a b, b a}

S) b - AA> - AA b> - Aa b> - A ba b> - A b ba b> -> bA b ba b - b> a ba b b

S - AA> - AA b> - Aa b> -  bAa b> -  bA ba b> - b> a  bA b b -> b ba b ab

S - AA> -  bAA> -> bAA b -  bAa b> -  bA ba b> -  bA b ba b> -> ba b b ab

S - AA> -  bAA> -  bAA b> -  baA b> -  ba bA b> -  ba b bA b> -> ba a b b

4 etanimilE. non - yselbahcaer m orf slob m S{,}a{,}A,S{(=G - A,a> - )S,}a> 01( m eD() c- )3102

f ot peD ESC , S BJ IT 24

Page 44: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 44/58

FL TA 65SC01

5 etanimilE. non - yselbahcaer m orf slob m S - Sa> | A,A - B,a> - aa>  . eD()m01( c- 102 4)

k r aM a bair av le X sa "gnitar eneg" f i ti h sa a noitcudor  p X -> w wh r e e w is a ts ir ng of no ly ter im slan

lsuoiver  psel bair avr o/dna y g"dek r am e r en a nit "g .

r ehtr uf onlitnuevo ba petsehttae peR v r a ia mtegsel b a k r e g"d e en r nita g".llA sel bair av ton dek r am eg" n itar e n "g er a on n- gnitar eneg (by a el pmis tcudni i no no eht l htgne fo

der snoitavi ).

llaC a el bair av el bahcaer f i eht tr ats lo bmys ir ed v se a gnir ts niatnoc gni ht at .el bair av er eH si na mhtir ogla

ehtdnif ot re hca a vel b a l bair e nis a CF :G

l bair avtr atsehtk r aM e as " er ca ha el b ".

k r aM a el bair av Y sa "el bahcaer " f i er eht si a pro noitcud X -> w er ehw X si a el bair av p suoiver ly dek r am

el bahcaer "sa " tsasiwdna r ni g c tno a nini g .Y

onlitnuevo ba petsehttae peR htr uf er v r  a ia mtegsel b a k r e "d r ae c el bah ".

llA sel bair av ton r am k de "el bahcaer " er a on n- el bahcaer (by a el pmis noitcudni no eht el ngth fo

der snoitavi ).

lnodnaf isel bair avsselesuonsahGFCatahtevr es bO y r er asel bair avstillaf i eac l bah e a dn ge nitar en g.

ir avsselesuetanimileotel bisso psitier of er ehT a l b e mor f s a gra mm r a a :swollof s

dniF eht non - gnitar eneg sel bair av dna eled te ,meht gnola htiw lla dor  p u snoitc vlovni i gn on n- eg n itar e ng

v r a ia l b e .s

dniF eht on n- caer h el ba sel bair av in eht gnitluser ammar g r dna d etele ,meht ola ng htiw a ll r  p o cud it sno

nivlovni g non - aer cha vel b a ir a .sel b

eto N taht pets 1 seod ton ek am r ehto sel bair av on n- ,gnitar eneg dna pets 2 seod ton m ek a other v bair a l se

non - el bahcaer r o non - eg itar en n .g er of er ehT eht dne tluser si a r ammar g ni hcihw lla sel bair av er a

r ae l bahc e r enegdna a ,gnit a hdn e cn e su ef .lugnisr eveR pets 1 dna 2 ni eht evo ba al mhtir og dluow ton ,k r ow sa gnitanimile on n- eneg r gnita vari sel ba

amsnoitcudor  pr iehtdna y ehtoek am ir avr a nusel b caer ha l b e  . l pmaxE e:

S - BA> | a

A -> Aa

B - b>

er eH A is non - tar eneg i ,gn dna r etf a gniteled A gnola( iw th eht p or d tcu i no S -> A )B the va bair le B

l bahcaer nusemoce b e. oS ti tsum e b a us ssele r av i .el ba ewoH v ,r e f i ew dluow tsr if tset r of hcaer i ba lit ,y lla

sel bair av dluow e b caer h ,el ba dna tneuqes bus ly el gnitanimi on n- itar eneg ng sel bair av dluow evael us htiw

.B

6 etanimilE. yssselesu m Ssnoitcudorphtiwrammargehtmorf slob -> AB | B,AC - CB> | ,BA

A - C,a> - BA> | b  . enuJ()m5( - 3102yluJ uJ() n-Ju yl - 4102 )

7 etanimilE. orf slobmyssselesu m enuJ()m5(rammargeht - 5102yluJ )

P A,aAaoS{= - bS> | C,CCb - E,bba> - }Ca>

S{=P - aBa> | A,CB - C,CCB|Ca> - B,a> - D,ccb> - E,E> - }d>

BJS,ESCf ot peD IT 34

Page 45: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 45/58

FL TA 65SC01

P S{= - A,aAa> - B,BBb> -> C,ba - }Ba>

P S{= - Sa> | A,BA - ,Ab> B - AA> }.

ehT noitulos ot eht or  p b mel f o en gnicr of ecnedecer  p si ot udor tni ce es ve lar dif ef r ne t va bair les, cae h foner tsgnidni b"f olevelaer ahstahtsnoisser  pxeesohtstneser  per hcihw g .ht " llacif ice pS y:

1. A ca[ t r o si na ser  pxe s noi taht tonnac e b nek or  b tr a pa by any a jda cent ,r otar e po r ehtie a * or a .+ ehTlno y nalnoisser  pxer uonisr otcaf g :er aegau(a) I .sr eif itned I br eif itnedinaf osr ettelehtetar a pesotel bisso ptonsit y nihcatta g .r otar e pona

) b( Any ner a p seht ESC d ex ,noisser  p on r ettam tahw e p pa a sr edisni the pa .sesehtner tI si eht r u p p esof o

nimoce bmor f edisnisit.ahwtnever  potsesehtner a p g naf odnar e poeht y .sesehtner a pehtedistuor otar e po2. A mr et si na noisser  pxe taht tonnac e b nek or  b by eht + e po .r otar nI our ,el pmaxe er ehw + dna * er a t eh

 yl no ,sr otar e po a r et m si a dor  p u tc f o o en or more fa r  otc s. r  oF atsni n ,ec the mr et a * b nac e b r  b" o "nek fiew esu tf el ivitaicossa ty dna ecal p ha ot ti s .tf el ahT t i ,s 1a *a * b si r g o de pu l a( * a) *  ,b hcihw b sk aer

tr a pa eht a * b. ,r evewoH gnical p na itidda ve r  et m, hcus sa ,+la ot ti s l f  e t r o l a+ ot sti thgir tonnac k aer  b a

* b  .  r e por  pehT r g f ogni puo l a + a * b si l a + (a * b) ,  r e por  pehtdna g ni puor g f o a * b sila+ a( * b ) .la+3. nA noi s ser  p xe lliw of ecneh htr r ef er ot any o p s el bis ex ,noisser  p dulcni i gn esoht taht nac be r   b o nek by

r o*tneca jdanar ehtie an a a jd ec +tn  . r eter omr oenof omusasiel pmaxer uor of noisser  pxena,suhT m .s I -+ F -+T -+ E -+a I b I a I I b[ I 0[ I Il I [ ( ) E FI F *T

T  I  E+T

.8   AetirW lg htiro m lundnif ot l elba v ira a lb e .s (5m () enuJ - 5102yluJ )

I !Aek ilnoitcudor  paevahewf B htsel bair avwenemosecudor tninacew,EDC at a f osel bair avehtwolldo beht y .emitataenodecudor tnie bot

k ser iuqer k htgnelf oydo bA .sel bair avwen2

el pmaxE : I bEDCB!Aecal per ;GdnaFecudor tn y .ED!G;GC!F;FB!A

r ammuS y oehT er m

Lsetar enegtahtGr ammar gasier eht,LFCynasiLf I !Amr of ehtf osinoitcudor  phcaehcihwr of ,gf

suoner aer ehtdna,a!Ar oCB e ssel sy .slo bm FC L gni pmuP L amme

limiS r aluger otr a - augnal g tu b,LPe y nir tsowt pmu potevahuo g nir tsehtf oelddimehtnis g mednatni,

eht,.e.i( same r  e bmun f o c osei po f e ca h) llamr oF. y:

FC8 L L egetni9 r n

 jz jhtiw,Lniz8 n

xwvu9 y 0> jxv jdnan jxwv jtahthcusz=

i8 nisiyixwivu,0 .L

Pf oeniltuO r oo f of LP

L k smohCae ber ehtte y- lamr on - r of GFCmr of L sel bair avmhtiw  . iP ck m2=n

.

htgnelf ozgnir tsa,slo bmys2nahter omonf oseido bevahsr ammar gF NCesuaceB emosevahtsumn

v1+mtsaeltahtiwhta p r a ia l b e .s

Page 46: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 46/58

  f ot peD ESC BJS, IT 44

Page 47: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 47/58

FL TA 65SC01

e p patsumel bair avemos,suhT r a .hta pehtnoeciwt

☣ r aAFDehthtiwer a pmoC g nolhta patuo batnemu g e bmunehtnahtr e r tsf o a .set

9 etanimilE. H - orf snoitcudorp m )m5(.rammargeht ( ceD - ceD,3102 - 4102 )

S - a> |  bX | X,aYa - Y> | Y,H -  b> | X

S - X,aX> - X b|Xa> | H

S - X,YX> - Y, bZ> - Z,W b> - W,BA> - Z> A, - B,H|B b|Aa> - bB|aB> | H

S - BSA> | A,H - SAa> | B,a - S bS> | A| b b

eso p puS h seil p pa ot s slo bmy f o pla h te ba E: and secudor  p ir ts ngs in T .* eW osla emussa taht L si a

egaugnal r evo te bah pla .T sA detseggus ,evo ba ew tr ats htiw a ADP P = ,Q( ,T ,'I ,oq,6 ,oZ )F taht ac st pec

L by .etatslanif

eW c ur tsno ct a ne hwADPw ere:

P' Q(= ' 6,E:, ',( ,oq

1  . Q' sr ia pf otesehtsi ( z,q ) us c hth a :t

IADPdna,Qnietatsasiq)a( --- f I --- I- tce jer !t peccAk catSetats

lir assecenton(xif f usasix) b( y )r e por  p nir tsemosf o g stu pniemosr of )a(h y .E:nialo bmtahT ,si eht tsr if tneno pmoc f o eht etats of 'P si eht etats f o ,P dna eht dnoces oc m tneno p is t eh .r ef f u b eW

emussa taht eht r ef f u b lliw doir e p - laci ly be daol ed htiw a gnir ts ,)a(h dna neht dewolla ot hs k nir mor f eht

,tnor f sa ew esu sti s my b slo ot deef the detalumis P AD P. eto N taht ecnis E' si ,etinif dna h a( ) is fini et rof

lnoer aer eht,alla y Pr of setatsf or e bmunetinif a '.

2. '6 si denif ed y b eht :selur gniwollof )a( '5c ,q( ,)e ,a )X = ({ ,q( )a(h ,) })X r of lla s slo bmy a ni ,E' lla

setats q ni ,Q dna st k  ca sym slo b X in r. eto N taht a tonnac e b e eh r .e nehW eht r ef f u b si pme t ,y 'P nac

stu pnitxenstiemusnoc y a(hecal pdnaalo bm ) htni e .r ef f u b

) b( ,)'1, p(sniatnoc)X, b,q(6f I si ber ehw ni T r o b = ,e neht sniatnoc (P ,)x, .)'1 wla'P,sitahT a sy sah eht

noit po f o gnitalumis a evom f o ,P gnisu eht nor f t f o sti b f u f .r e f I b si a lo bmys ni ,T neht t eh r ef f u b m tsu

t pmee bton y t pmee bnacr ef f u behtneht,E= bf itu b, y.3. eto N ,taht sa denif ed in ,)1.7( eht tr ats etats of 'P si ,Oq( e j) ,.e.i 'P str ats ni t eh tr ats etats f o P htiw na

e t pm y f f u b e .r

10 etanimilE. H - rp - yssselesudnasnoitcud> m Srammargehtmorf slob - A,C|B|Aa|a> - |Ba>

B,H - C,Aa> - D,DCa> - dd>  . 01( m eD() c- 102 4)

gnir tsA y assi sehtf ixgnir tsehtf onoitatumr e pae botdi y f oslo bm y .xek amotder edr oer e bnac r oF

nir tsf osnoitatumr e peht,ecnatsni g W,011er a110=x I, a ,egaugnalasiLf I.110dn t ehtsi)L(mr e pneh

nir tsf otes g tumr e per atahts a nir tsf osnoit gs ni L. F r o exa ,el pm f i

L lno{= 'l I (mr e pneht,JO~n L nir tsf otesehtsi) g bmunlauqehtiws r e f os

O' dnas L ,s'

er af oel pmaxenaeviG)a g egaugnalr alu L ,O{te bah plar evo I (mr e ptahthcus} L er tonsi) g r alu  . J itsu fy

y ewsnar uo r  . gaugnalr aluger adnif otytT:tniH r e bmunlauqenahtiwsgnir tsllaer asnoitatumr e pesohwe

Of o 's a ldn ' .s

er af oel pmaxenaeviG) b g nalr alu g (mr e ptahthcus}2,1,O{te bah plar evoLegau L txetnoctonsi) - .eer f

f ot peD ESC BJS, IT 54

,) € Z ,o F {X )} €

) €

Page 48: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 48/58

FL TA 65SC01

r ever of tahtevor P)c y ger owtar evoLegaugnalr alu -sy (mr e p,te bah plalo bm L txetnocsi) - eer f

. a{=LtahtwohSib

ic

 i i|   Ctonsi}1 F .L

SAB I wor tsr if ehtetu pmoceW:S a swollof s  . dnagninnige bgnir tsehtecniS ehttsu jsiinoitiso ptagnidne

Cnisir ammar gehtdna,~lanimr et lnoeht,F N y ehtf onoitcudor  paesuotsiiagnir tsehtevir edotyaw

mr of A ~ ia .  AtahthcusAsel bair avf otesehtsiiiX,suhT - siiat a pr udo c .Gf onoitI TCUD N I  jwor nisihcihw, jiXetu pmocottnaweweso p puS: NO - htlladetu pmocevahewdna,1+i e

X' nis ht e r wole bswo  . nir tsllatuo bawonk ew,sitahT g l+, jaianahtr etr ohss ... r a pnidna, ja t r aluci ew

 por  pdnasexif er  pr e por  pllatuo bawonk r e f us f xi e htf os a nir tst g  . sA j - ecnis(demussae byam0>i eht

htwonk ew,)sisa behtsi j=iesac a nat y d vir e a ~Anoit aia 1+i . ,  . tsum ja oshtiwtuotr ats m A petse

}:::: BC  . edB,nehT r r  pemossevi e f oxif aia l+i ... as, ja y j<k emosr of ,k a"'lHai'a~B  . nehttsumC,oslA

or edniamer ehtevir ed f iaia +l ... ~C,sitaht, ja ak+la '2+k " a . j oceW n itahtedulc Xnie botAr of r edr on i , j

ir avdnif tsumew a l b e Bs a ,Cdn a tnidn e k r eg :tahthcus

1  . k :5i . j<

2  . B ;.xnisi

3  . k XnisiC + ' j,l4  .  A - siOB7 a udor  p c Gf onoit .

12 wohS. Ltaht ww{= |w *}1,0{ } Ctonsi FL  . ()m01( enuJ - ylu j - 4102 )

13 gnisU. up m lgnip me m Crof a F nalwolebtahtevorpL g tnoctonerasegau ext f er e

p{ | pasip r mi e )m01(..} (Dec- 3102 )

wor )tsewol(tsr if ehttcur tsnocoT I we htesu e sisa b r elu  . lnoevaheW y ot c ihwr edisno c avh r l bai e hs a aev

do bnoitcudor  p y a)CdnaAer asel bair avesoht(a do bevahsel bair avhcihwdn y b ( lno y B seod ). ,suhT

nidlohsnoitiso pesohtevo ba g r tneehteesewa y ,}C,A{ a dn a vo b e nidlohsnoitiso peht g w b e sec {B .}

44X=llX,sitahT = {B 22Xdna,} = 33X = .}C,A{=ssX

I ,21Xf oseulavehteesewwor dnocesehtn 2X ,43X,3 a dn S4X ' For tsni a cn e l, e ssut e si2lXwohe

etu pmoc d  . lnosier ehT y aweno y nir tsehtk aer  bot g ,2ot1snoitiso pmor f yt pmenonowtotni,a bsihcihw

ts bus r ni gs  . htdna1noitiso pe btsumtsr if ehT e se dnoc btsum e .2noitiso p I on r r ed for a ir av a l b e ot

do baevahtsumti,a betar eneg y ti,.e.i(}B{=llXnisiel bair avtsr if esohw g esohwdna) behtsetar ene

}C,A{=22Xnisiel bair avdnoces ( .i e ,. ti genera htset e )a  . do bsihT y lnonac y .CBr oABe b I ewT

cudor  pehttahtdnif ew,r ammar gehttce psni lnoehter aCB~SdnaAB~Asnoit y seido besehthtiwseno

ht,suhT e howt e ,SdnaA,sda c etutitsno .21X

l pmocer omar oF e l pmaxex e, c disno r e eht c onoitatu pmo f 42X . nir tsehtk aer  bnaceW g aa otaht b cc i pu es

uor ht2snoitiso p g b4h y nidne g ir tstsr if eht ng afte noitiso pr o2noitiso pr 3  . esoohcyamew,sitahT 2=k

r o htni3=k e d f  e onoitini f 42X  . w,suhT e disnoctsum er a ido bll es 44X32XU43X22Xni  . ssihT e f ot

nir ts g {U}C,S{}C,A{sis B {} B =} ,CC,SC,CA,SA{ BB .}

f ot peD ESC , BJS IT 64

11  01( m) ceD( - 3102 )

Page 49: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 49/58

FL TA 65SC01

TINU 7

TnoitcudortnI o MgniruT a enihc

elpmaxehtiwnialpxE sretupmoCtahtsmelborp enuJ()m6(.evlostonnac - yluJ - 5102 )

ehT eso pr u p f o siht tces i no si ot edivor  p an ,lamr of ni C- gor  p r nimma g- a b s de cudor tni it no to eht f oor  p f o

ice ps fic l bor  p e tu pmoctahtm e sr ac vlostonn e.

ehT r alucitr a p mel bor  p ew ssucsid si r ehtehw eht tsr if gniht a C ar gor  p m stnir  p si ,olleh .dlr ow A uohtl gh

enigamithgimew mar gor  pehtf onoitalumistaht dluow wolla su ot llet tahw eht gor  p r ma ,seod ew m su t i

ilaer l banigaminunaek attahtsmar gor  phtiwdnetnocyt y nagnik amer of e bemitgnol y .llatatu ptuo

sihT mel bor  p - ton gniwonk ,nehw f i ,r eve emos t gnih lliw r ucco - si eht etamitlu esuac f o r uo ili bani ty t

llet tahw a r  p o mar g does. ewoH v ,r e gnivor  p lamr of ly that er eht si no r   p o mar g to do a stat de task is uq ti,yk cir t dna ew deen ot poleved emos lamr of em c .scinah nI siht ,noitces ew evig eht noitiutni he b ind ht

lamr of .sf oor  p

ylf eirbnialpxE gniwollof eht gnitlaH 4(..melborp m () nuJ e- yluJ - 3102 )

r aehnetf oenO nitlahehtf os g nir uTr of mel bor  p g otr alimismel bor  pasasenihcam Lu - tu bER sitahteno

er ton cur vis e. I ir oeht,tcaf n g nir uTlani g nihcam e Af o . M.  bdet peccagnir uT y bton,gnitlah y .etatslanif

stu pnif otesehte botMMTr of )M(Henif eddluoceW stlahMtahthcusw g vi e er ,wtu pnin ga fosseldr

hw e or eht r Mton a cc e wst p  . nitlaheht,nehT g Hnisivttahthcus)w,M(sr ia pf otesehtsimel bor  p (M).

nal/mel bor  psihT g gau e r ehtonasi exa l pm e nof o e tu bER sitaht ton cer evisr u

3. xE p nial rgorP a imm ng t qinhce u se f enihcaMgninruTro s J( nu -July-2 310 )

ehT ir uT ng enihcam am t lacitameh ly sledom a enihcam taht m nahce i lac ly etar e po s no a at p .e On th si  pat

er a s ,slo bmy hcihw eht enihcam nac daer dna w ,etir eno ta a ,emit su ing a e pat he .da noitar e pO si luf ly

ed denimr et by a etinif tes f o atnemele ry snoitcur tsni hcus sa ni" etats ,24 if eht s lo bmy se ne is ,0 w tir e a 1

f i eht lo bmys nees si ,1 ahc n eg otni etats ;71 ni etats ,71 f i eht s lo bmy s nee si ,0 r w ti e a 1 dna egnahc to

tats e  ";6   te c. In eht   orig lani lcitr a e O"( n  tu pmoc a l b e e bmun r ,s w hti an a cil p p a noit to  eht

,"mel bor  psgnudiehcstnE ole bsecner ef er oslaees w tonsenigamignir uT,) a ,msinahcem tu b a nosr e p mohw

eh sllac eht ,"r etu pmoc" ohw setucexe eseht citsinimr eted lacinahcem selur hsivals ly r  o( sa ir uT ng p stu ti

r otlusedani" y r ennam " .)

ehT daeh si syawla r evo a r alucitr a p er auqs f o eht ;e pat no ly a etinif hcter ts f o ser auqs si .nwohs hT

f ot peD ESC BJS, IT 74

.1

.2

Page 50: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 50/58

FL TA 65SC01

tsni r botnoitcu e r e p formed ( 4q ) r evonwohssi seht c nna e r auqsd e  . D( niwar g eneelK r etf a ( ).573. p)2591

,er eH eht lanr etni etats )1q( si nwohs ni s edi eht ,daeh dna eht tar tsulli i no se bir csed t eh at pe as e b ing

etinif ni dna er  p - dellif htiw ,"0" the s lo bmy s gnivr e sa .k nal b ehT sys et m s' lluf etats sti( el pmoc t

gif noc u )noitar stsisnoc f o eht lanr etni ats t ,e any non- k  nal b s slo bmy no ht e e pat ni( siht il noitar tsul 1" 1B")

noitiso pehtdna daehehtf o esohtotevitaler s my b slo gnidulcni ,sk nal b e.i . " 110 B" iwar D(. n r etf ag Mi sn ky

)7691( p. .)121

cer  per oM ESC ly nir uTa, g am c enih c no ostsis f:

A ,sllecotnidedivide pat eno en xt ot eht ot hcaE.r eh iatnocllec ns a s o bmy l mor f emos etinif ah pla b .te hT

te bah pla sniatnoc a ce ps i la k nal b s lo bmy (h r  e e w nettir sa '0') na d eno or er om ehto r s slo bmy . ehT e pat i

demussa ot e b ir ar ti br a ly netxe el bad ot eht tf el and ot eht ri ,thg i. ,.e eht Tu gnir m nihca e is wla ays s l p pu ie

htiw hcumsa tisae pat n dee s of r ti s oc m u p t btonevahtahtslleC.noita e ne nettir w ot of e b re a er ussa m de ot

e b dellif htiw eht k nal b ys m .lo b nI emos sledom eht e pat sah a l tf e dne dek r am htiw a ce ps i la s my b ;lo ht

letinif ednisir osdnetxee pat y htotel bisnetxe e .thgir

etir wdnadaer nactahtdaehA s othgir dnatf ele patehtevomdnae patehtnoslo bmy n nodna(e ly o )en lec

a mitat e. I sevomdaehehtsledomemosn a tehtdn ape tssi a r anoit y.

A etats r etsiger taht ser ots eht etats f o ht e ir uT ng nihcam e, eno of etinif ly man .y Th er e si eno ps eci la rats

etats htiw hcihw eht etats r etsiger si ni iti a zil .de esehT ,setats setir w r uT i ,gn r al pe ce eht etats" of "dnim

nimr of r e pnosr e p g tu pmoc a dluowsnoit nidr o r a li y e b .ni

A etinif el bat (o lanoisacc ly dellac na noitca el bat r o noitisnar t uf n )noitc f o snoitcur tsni lausu( ly uq int el pu

5[ - ]sel put : aiq j ,k d1 ja1iq→ tu b semitemos sel pur dauq [4- )]sel put ,taht nevig eht )iq(etats eht ma enihc i

tner r uc l ysehtdnaniy m ehtnognidaer siti) ja(lo b tner r uclo bmys(e pat ly u r  edn eht )daeh sllet nihcameht

niwollof ehtodot g 5ehtr of (ecneuqesni - l put e dom e :)sl

saetir wr oesar er ehtiE y (lo bm r l pe ca ni g a ,)1 jahtiw j a htdn en

evoM eht daeh hw( i hc is de bir csed by k  d dna ac n evah v :seula 'L' for eno pets tf el r o 'R' r of no e step ri hg

 N'r o ' atsr of y ni g sehtni a l pem a ,)ec a htdn en

saetatswenar oemasehtemussA r  p es r c (de bi g tatsoto e 1iq ).

4ehtnI - ,sledomel put gnisar e agnitir wr o s bmy ol )1 ja( dna gnivom eht he da tf el r o thgir d( k) er a s deif ice p

sa etar a pes cur tsni t .snoi lacif ice pS l ,y eht el bat sllet eht nihcam e ot (i )a e esar or w etir a sym lo b r o  bi(

htevom r r otf eldaehe i nehtdna,thg )ii( emussa t eh as me r o a new ats te as er  p cs ri ,de b u b t on t hto b ca it no

)ai( dna ) bi( ni eht emas cur tsni it .no nI emos ,sledom f i er eht si on tne ry ni eht el bat r of ht e ner r uc

sf onoitani bmoc y tatsdnalo bm e ht e htn e am c enih hlliw a hto;tl e domr e sl er iuq re a ll e e botseir tn .dellif

f ot peD ESC BJS, IT 84

Page 51: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 51/58

FL TA 65SC01

eto N taht eve ry tr a p f o t eh enihcam .e.i( sti etats dna s o bmy l- )snoitcelloc dna sti snoitca hcus( sa printi gn

isar e ng dna e pat )noitom si etinif , eter csid dna ;el bahsiugnitsid ti si eht laitneto p ly detimilnu a tnuom o

ta hte p at g dednuo bnunatisevi a otnuom f ar ots ge ps ace.

4 ngiseD. gniruTa m hca i atpeccaoten P .emordnila 01( m ceD() - 3102 )

5. aezingocerotMTangiseD mrof ehtf ognirts anb

.n2  

ceD( - )3102

f ot peD ESC , S BJ IT 94

Page 52: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 52/58

FL TA 65SC01

iseD g gniruTan m hca i atpeccaoten P .emordnila ceD()m01( - 4102 )

tilibarisednuenif eD y ytilibadiced, . 01( m () enuJ - yluJ - 4102 )

eW nac won ti bihxe a mel bor  p taht si ER tu b not ;evisr ucer ti si eht ugnal a eg Lu' iwonK ng th ta uL i

awynamnisi)egaugnalevisr ucer aton,.e.i(el badicednu y r evocsidsuoiver  pr uonahtel baulaver oms y aht

dL si ton R .E ehT aer nos si taht eht noitcuder of "L ot htona er mel bor  p P nac e b us de to wohs ht e er is n

la g vlosotmhtir o e ger ,P r a osseld f hw e ER siPtonr or eht  .  f onoitcuder ,r evewoH L lnosiPota y l bisso p e i

P si ton ,ER os aL tonnac e b desu ot wohs ili badicednu ty r  of esoht l bor  p e sm aht t er a RE tu b ton evisr ucer

nO eht r ehto ,dnah f i ew tnaw ot wohs a el bor  p m ton ot e b R ,E neht no ly aL c na be desu ; i.11L s esu les

cnis e siti .ER

hT eo er :6.9m L tontu bER si.11 cer visr u e.

:FOOR P eW tsu j devor  p ni noitceS 3.2.9 taht uL is R .E eso p puS uL er ew .evisr ucer nehT by Th oe rem 3.9

,uL eht el pmoc m tne f o ,uL dluow osla e b r r uce s .evi ,r evewoH f i ew ah ve a MT M ot pecca t ,uL t neh w

nac tcur tsnoc a MT ot t pecca aL (by a dohtem ex denial p .)wole b ecniS ew aer la dy wonk th ta aL si ton ER

vahew e a c r  tno a onoitcid f r uo a htnoit pmuss at L er siu cur vis e.

f ot peD ESC , S BJ IT 05

.6

.7

Page 53: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 53/58

FL TA 65SC01

8. P elborpecnednopserroCs’tso m uss1dnas0f ognirtsaezingocerotMTangiseD c ahth t t eh

un m saeciwttonsis0f oreb aht t s1f o  . eD()m01( c- enuJ,3102 - yluJ - 5102 )

f ostsilowtf ostsisnoc)PCP(mel bor Pecnedno pser r oCs'tsoPf oecnatsninA owteht;E:te bah plaemosr evosgnir ts

f oe btsumstsil uqe a nell g ht  . W=Aetir wdna,stsilBdnaAehtotr ef er yllar enegeW I ,2W, . ,.. X,lX=Bdnak W 2

... osr of ,k X, m k r egetnie  . .r ia pgnidno pser r ocae botdiassi)iX,iW(r ia peht,ihcaer oF

isr egetnier om'10enof oecneuqesasier ehtf i,noitulosasahPCPf oecnatsnisihtyaseW I ,2i, ... i, m ,taht w neh

sexednisadeter  pr etni asehtdleiy,stsilBdnaAehtnisgnir tsr of m .gnir tse T ...2iWliW,sitah iW m iX= I 2iX ...

X'im .  ,liecneuqesehtyaseW i ,z  ... f i,PCPf oecnatsnisihtotnoitulosasimi, .os

tsoPehT ' el bor  pecnedno pser r ocs m :si

et,PCPf oecnatsninaneviG• hwll e ht e ihtr s in ts a ecn h losasa u .noit

enif edsae bstsilBdnaAehtteldna,}I,O{=E:teL:31.9el pmaxE d ni Fig. I itulosasahPCP,esacsihtn o .n r oF

3,1,1,2tsilehtsinoituloseht,.e.i;3=4idna,1=3i,1=2i,2=li,4=mtel,ecnatsni  . W tsilsihttahtyf ir eve i as

wtehtr of r edr onisgnir tsgnidno pser r ocehtgnitanetacnocy bnoitulos o .stsil =3X jXIXZX=3WIWIWZW',sitahT

euqinutonsinoitulossihteto N.011111101  . 1,1,2,3,1,1,2,ecnatsnir oF , ulosr ehtonasi3 t noi

f ot peD ESC , S BJ IT 15

Page 54: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 54/58

FL TA 65SC01

U 8TIN

ytilibadicednU

1. mrof ehtf ognirtsaezingocerotMTangiseD a

n

b

.n2 ( )m01

( enuJ - yluJ - 3102 )

2. f It.P L asi evisrucer l ,egaugna L- sruceroslasi i ev  . 01( m enuJ() - luJ y 02 41 )

FOOR P : emosr of )M(L=LteL T tlahsyawlatahtMM s. tahthcusMMTatcur tsnoceW I ehty b)M(L=

nidetseggusnoitcur tsnoc Fig 3.9. . Mek iltsu jsevahe bM,sitahT  .  siM,r evewoH m f sadeif ido o er cotswoll a Met

.1 amer aMf osetatsgnit peccaehT tlahlliwMsetatsesehtni,.e.i;snoitisnar tonhtiwMf osetatsgnit peccanoned

tuohtiw a ecc p nit g.

.2 3,r mor f snoitisnar toner aer eht;r etatsgnit peccawenasahM  . tatsgnit peccanonaf onoitani bmochcaer oF e f o

MtahthcusMf olo bmyse patadnaM stlahM,.e.i(noitisnar tonsah w noitisnar tadda,)gnit peccatuohti ehtot

tsgnit pecca a .r et

lahotdeetnar augoslasiMtahtwonk ew,tlahotdeetnar augsiMecniS t.

tonseodMtahtsgnir tsesohtyltcaxest peccaM,r evoer oM a ecc p .t MsuhT acc st pe L

f ot peD ESC , S BJ IT 25

Page 55: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 55/58

FL TA 65SC01

3.  ngiseD 2n1n0ezingocerotenihcaMgniruTa n  . eD()m01( c- 3102 )

4.  nialpxE ylf eirb eht gniwollof gnitlaH ceD()m6(melborp - 4102 ceD, - 3102 )

ehT gnitlah mel bor  p si a ed noisic mel bor  p ba o tu seitr e por  p f o r etu pmoc r  p ogr sma no a if x de gnir uT -ledometel pmoc f o ,noitatu pmoc .e.i lla smar gor  p taht nac e b nettir w ni emos nevig gor  p ar gnimm

tahtegaugnal si lar eneg hguone ot e b tnelaviuqe ot a gnir uT .enihcam ehT mel bor  p si ot ,enimr eted neviga r  p o adnamar g n tu pni ot eht r  p o ,mar g r ehtehw the r   p o mar g lliw autneve lly ah lt wh ne nur htiw ht at u pni t

ar f tcar ts basihtnI m ecr uoser oner aer eht,k r owe ehtnosnoitatimil f otnuoma omem ry r  o emit iuqer r de rofoitucexes'mar gor  peht ir ar ti br aesudna,gnolylir ar ti br aek atnacti;n ly mu hc egar ots a ps c ,e er of e b gnitlahl pmissinoitseuqehT y ehtr ehtehw g or  pnevi g .tu pnir alucitr a panotlahr evelliwmar

s pni,el pmaxer oF e or  peht,edocodu g :mar

elihw ( ur t )e c unitno e;

lahtonseod pooletinif ninanir ever of noseogti,r ehtar ;t  . htnO e hto er ha ht,dn e or  p gr ma

tnir  p " ow,olleH r "!dl

r evstlah y lk ciuq y.

nidicedelihW g or  pesehtr ehtehw g hsmar a r om,el pmissitl e l pmoc e px r psmar go r vo e pr mel bo a it c.

enO caor  p pa h ot eht r  p o mel b thgim e b ot nur eht r  p o mar g r of emos mun b r e f o st s pe dna cehc k if it tlah sor  pehtf ituB g utnevelliwmar gor  pehtr ehtehwnwonk nusiti,tlahtonseodmar a ll y ver of nur r otlah r e .

gnir uT devor  p er eht tonnac tsixe na mhtir ogla hcihw lliw syawla co yltcer r iced ed wh ,r ehte r of a nevigar ti br a ry r   p o mar g dna sti ,tu pni eht mar gor  p stlah nehw nur htiw taht in ;tu p eht ecnesse f o ir uT n s'g foor  p

natahtsi y lahcus g er ehtdna,f lestitcidar tnocotedame bnacmhtir o fo er c btonna e cor er c .t

f ot peD ESC , S BJ IT 35

Page 56: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 56/58

FL TA 65SC01

5. tilibarisednuenif eD y .ytilibadiced, 8( m enuJ() - 4102yluJ ) r( taepe e )d

6. P elborpecnednopserroCs’tso m De otMTangis er zingoc e a s thcuss1dnas0f ognirt h tta he

un m saeciwttonsis0f oreb aht t s1f o  . eD()m01( c- 4102 )

7. iseD g gniruTan m hca i atpeccaoten P .emordnila 7( m ceD() - 3102 )

f ot peD ESC , S BJ IT 45

Page 57: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 57/58

FL TA 65SC01

8. etirW )m02(:noetontrohsa ( ceD - 4102 aeper() et )d

a. tilibarisednU y, diced a ytilib

eW nac won ti bihxe a mel bor  p taht si ER tu b ton isr ucer v ;e ti si eht gnal u ega Lu' wonK ing that uL i

el badicednu i( . ,.e ton a evisr ucer )egaugnal si ni am ny wa sy er om v el baula naht r uo suoiver  p ocsid ver

taht L ER tonsid  . htsinosaer ehT noitcuder ehtta el bor  pr ehtonaot"Lf o m nacP b esue d twohsot h re

si on al mhtir og ot evlos ,P dr ager l se s of htehw er r  o ton P is R .E ewoH v r e , der u noitc f o La to P is onl

el bisso p f i P si ton ,ER os aL tonnac e b desu ot wohs ili badicednu ty for esoht or  p smel b aht t er a RE u b

r ton ce ur vis e. nO r ehtoeht ,dnah i ewf sottnaw h wo a mel bor  p ton ot be R ,E t neh no ly La c na e b desu

L susi.11 ele .ER sitiecnisss

 b. hT eo er :6.9m L tontu bER si.11 cer visr u e.

c. :FOOR P eW tsu j evor  p d ni noitceS .2.9 3 aht t Lu is RE. eso p puS uL er ew ucer r evis . nehT by Th oe r me

,3.9 ,uL eht el pmoc m tne f o ,uL dluow osla e b re .evisr uc ,r evewoH f i ew evah a MT M ot ac t pec uL

f ot peD ESC , S BJ IT 55

Page 58: Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

7/23/2019 Cse-V-Formal Languages and Automata Theory [10cs56]-Solution

http://slidepdf.com/reader/full/cse-v-formal-languages-and-automata-theory-10cs56-solution 58/58

FL TA 65SC01

neht ew nac tcur tsnoc a MT ot t pecca aL (by a dohtem ex nial p de .)wole b ecniS ew aer la dy wonk aht

L tahtnoit pmussar uof onoitcidar tnocaevahew,ER tonsia Lu r  si e visr uc e.

b. Ha gnitl rp o lb em

ehT gnitlah mel bor  p si a noisiced mel bor  p tuo ba seitr e por  p f o r etu pmoc r  p ogr sma no a fix de gnir uT -ledometel pmoc f o ,noitatu pmoc .e.i lla smar gor  p taht nac e b nettir w ni emos nevig gor  p ar gnimm

tahtegaugnal si lar eneg hguone ot e b tnelaviuqe ot a gnir uT .enihcam ehT mel bor  p si to ,enimr eted nevigr  pa o mar g ,mar gor  pehtottu pninadna ehtr ehtehw r  p ogr ma lliw autneve lly ah tl wh ne nur wi ht ht at u pni t

ar f tcar ts basihtnI m oner aer eht,k r owe ecr uoser nosnoitatimil omemf otnuomaeht ry r  o emit iuqer r de rofylir ar ti br aesudna,gnolylir ar ti br aek atnacti;noitucexes'mar gor  peht mu hc egar ots ,eca ps be er of gnitlah

l pmissinoitseuqehT y ehtr ehtehw g or  pnevi g alucitr a panotlahr evelliwmar r .tu pni

eht,edocodues pni,el pmaxer oF or  p gra :m

elihw ( ur t )e c unitno e; pooletinif ninanir ever of noseogti,r ehtar ;tlahtonseod  . nO ht e hto r e ,dnah ht e or  p g mar

tnir  p "He dlr ow,oll !"

r evstlah y lk ciuq y.

nidicedelihW g or  pesehtr ehtehw g om,el pmissitlahsmar er l pmoc e psmar gor  px r vo e pr l bo ema it c.

enO hcaor  p pa ot eht mel bor  p thgim e b ot nur eht r  p o mar g r of emos mun b r e f o st s pe dna cehc k f i it stlahor  pehtf ituB g mar r gor  pehtr ehtehwnwonk nusiti,tlahtonseod a llautnevelliwm y ha otl r r nu f .r ever o

gnir uT devor  p er eht tonnac tsixe na mhtir ogla hcihw lliw syawla co yltcer r ediced wh ,r ehte r of a nevig

ar ti br a ry r   p o mar g dna sti ,tu pni eht mar gor  p stlah nehw nur htiw taht ;tu pni eht ecnesse f o ir uT n s'g foor  pnatahtsi y lahcus g er ehtdna,f lestitcidar tnocotedame bnacmhtir o fo er c btonna e oc r r ec .t