You are on page 1of 78
je ELaT me - @ ly Alphabet - farb} arbre} {4 fo,--ay = = [> Stateg ~ En: @/6,do,ab, be -__ ‘i is lady the Alphabet set 3" contains ’ alphabets ve the movof alps | i ' Lat inthe aek axe 1’ (denoted by 1ET) the ‘the nod, poste “bI9g4 of lengthy possible over = ip [yy” + Language = collection ct aio? let, Se by 4 | farb} then Lag sage ce . = feet of on alaings qf length 2b? Piste Cooqueg = faa, ab, ba, oe tar Lact ofa shings of ogi S} —m Finite Larquege = face, aab, a all, baa, bab, hha, Ub} | ta facto aur abtogt hee each ating aest cola} | = fa, a0, a00.,ab,abb ,aba -... | > Sofrite Leogeye Russ of & Le the Alphabet get be Zs i Aaehh 3: fed 4 al atings 4 Length pracily one | -, fare} Lo 2. SF: Sad of all seis oy Length emaly 2h: foa,ab, ba, bb} EL SS-S - [eet of aut skvings of length erat 3 foce, cab.aba,abb bos, bab, boa, bb}. 3, Ee {sd ofa abings Sh Megine! i. 1) dotn, ssi] | 3" {5% s!us*----} + {feu fa,bhv.haa, ab, bab}... | 2 feck of posstble stings - over (a/b) of at length } j sf Usiversal ack} PRACTICAL SCENARIO © et! Now, comider the tang wage Ee fab---2 -AiB-. 2, 0---9, Fmt Now, Noid mainc) : 4 : Peper in ‘'c’ byt in Tor iki ating int a,b: : t Now, ¢- Preptanming large a Fat ef all" vaiid” Preqramt} 1 Se da mh eb @) No Gen any ing ard te fed cul whether the abing beengs te te language. oo heawg task if the Leng wage is Sn finite | CONSTRUCTION OF FINTE Aton? ® ty fat of an stings which stast with ‘a’ - = fa, 00, ab,aca --. } Stakes = [V%y%e} Now, Given sling = @ab apne Eee © pina state Scanned witn GamScanner WM Felting, cell pe Ge Adiacsta G6 (akghse gk classification og the flatts Automata. ® the jute mate Finite Automate Tt FA sith ood pat 7 ales s OFA . NPA e-NeA Moors Meal v Delermintstic Finite Automata pr BE PEA= (A.E,8,%0/f) i Q= fact of ant tater}. [4.8.c} Ue 2 f sctof alphabels f= [aby = Metab, $5 8h Now, |S: Qxg 3 @ {Aree} x farbt ® construct a OFA that accepts act of al abitoge oven fab} of bength 22 WWwl-=2. BS) = sar} | L: faa,ab, ba, bb} aseaGort 2a ie @ © ab By wiz t u O> ben Pinal Stake Given Shing Acceplance + Sean the ertive stanglely, wr Peadiaitnal > Shing . from the inibial alate then the string accepled “> laoquese & eet A Finite Acitrmata 12 Aoid accept a anjucy, if tt acepls all. the abings available in the egee s and Binet, te abingt that ase root in th language rmoutt be. aejected by the Finite Automate : (22 CONSTRUCTION SF MINIMAL DEA Construck a OfA for set 4 all sbings over farbl such that lena Sf the Abie it atleast 22 lee pol Now, =: fab L= faa,bb, oab,aaa, bbb, baa ---} ad ab O——@ ab B low, conskruck the DA for which lwl< 2 2+ farby ‘ b L? fé, arb, aa'‘ab,ba, bb } © ab © ae ©; or Now, fer the Above problems “the, ceoclutiore thak can be dawn cate fale bo} So juts 2 4h Wl" then (Wlen then mo of halen the no-of- No-of sabes = (naz) lates in DPA tA (nei) Aiases + (42) lOl< n= (+2) shaker (ee) | Go Wwl= = (nea) staber| lol 2 = (nti sabes! Ee 7 PO”) << eannad wit Camecamet ‘6 construck the minimal pFa over fab} where. [oimod2=0- @ The Sepak Aiphabek Zet ta Z= fash t- fe0, abba, be} and ‘e’ Bay AN? Remainders eshen © ‘ divided by ae aio © construct the mictmal OFA over w+ fa,b}¥ here judlmed B+ O/aIZOMmeds The Soput Alphabet net is B+ fabt 6 2. pastble Remainder | bs free, bbb, ath, tos, ata, tab j neg = are fetlyy Tf bl med m=0 then the op haa “av abalys @ cmoFA over farb} ewhere . in wwe {corre} L= faa, baa aba, ab, cabbb-- The Sppat Alphabet seb S- fab} Rode G25" fax Bala | | Fer cod ea HG © CoA eshete Ly querer. NYQ(w) Mad2=O 07% MAlw)Bomedl 4. a Jao, Qoaab, baa, aab ,aba.-- f The Spat “Aipobe ack is 5 fab} f+ \ |Wimed m2 K mod N then the DEA Contain N atalge | and each state ‘epresert the ible Remainders (0, -- N-1) Scanned with CamSeannat @ cmopa over: fasb} wheie mad) BO med n,) 20 mod, The Snpak Alphabet = farb} Ls flaa, bb, aabb, dana bbls, --.and ef i ‘i above | can be chasified ] entice Grup 4 biog for the ; wong ; j WtO + categuiet. They one | ogos nee ue © > both the no.of o's ard nds 0} Hs aoe even © 5 even no-of als and add roobhe € 2 cid» » wn events © ops wow Oded oon N There fore the DFA Contains 4 alates Ss aaa | each colepory “oe (ht) ae b 2 CROSS PRODUCT METHOD ir Conabuct @ DEA that accepts sabes oven fab} whee. To of als ard ne of Us both axe even? i x Te Sopot alphabet = far we Gopyr HOO) ® omed, 60) 2 omod2 Now, conetuct the pea or souk als J Stent looly the DEA fer count ie] the BR ait be je a ®@ —-©)—_ b Row. the C1088 meslucl Of the -hoo Automaton will be fal x fen} = fac, av, e, aot - Now, ACS 7 ABZE Cm3e > Ac BeBe Ac Pet = ant CPD 2» pc boa | i" the Ist DPA has “n’sbate: and end OFA basen plates then the cross pockuct of PFA, and DRA, hx (MxM) slates. 4 aa @Demopa over fab} whee Ew? = omed3 and mpl) 2 © med 2. The Sopa alphabet z= farbl w+ Caiby* —nglesl at Omedl ond PCa) E omed 2 §f mgGo) moda > 9,{00) mod 2. then firal alades oe fio,20, 2,1} Sf pfsodmed 3 = nybsdenede The n-0f' the aede ve On Diesen tho) fo reach That Arab e we thald Gor ala and tbs. | : foo, 1} = Final states. ————————_aP—SSSSSSS. rar a anna ®cmopa over farb} shore yylww) B omed 3 t 3x3 States 2d States no) ZO med 3 The Snpuk Alphabet sek - far b} > Of rw medB=4 AL(w) med 3 = & the Fnal state {ial > Sf! G65 mad 3 i fo) mod 3b oc dhe final aleubr 42 foo fro,20, 215 Ga) > 9,0) mcd 3 Whe Seput Alphabe zck~ fo.'t i Une a now, (lo), = (kako =2 Binary - OF! IX240=2 Ternary oye axati= 5 Decimal 0.19 Hexackdimal-o.1-I15 @cmora over fol} which tater preted ax ,Brosry number is Fle by 3. Te Spat alphabel set = {0,1} The “Transition table % Shomt eat method Lo @ cmopa over fou} which when interpreted a4 BFacary eameer want | Te Spat Alphabet set = for!) Fe Transition table tp 1% : nn) ey Shontcu® (od to ce aft IZ | b WZ” aye finalsite now if 22 forv2} CTernony ournber®) then, the Fansthon table jp. 6 J ee a) MSO Scanned with CamScannet ® © compa over =: fark} and ali the abving Stent wsihla’? L: fa,aa,ab,aaa---} | @emopa s: fab} each Abing endiog witb’? iy Scanned with GamScand@t vies, i Qcmnre => faib} , Bach Shing contal ning fab} ® 5S" “Ee B eMOFA Zs fib} eoting echih fabh ee ap Se | @ cmopn =-faib} Alas: cotta’ and end edith ‘bE . arb, . L= Alert witha: = Te ft, fey Ceae a Ls eed with b + S$ 1 o ete @emopn =e fab} - Ahieg Aeaxt and end attih different Axgrebol 2 ie tte each ckhen chen Laie bh ome defined OH ame SEs = Scanned vntn CamScanner 1) COMPLEMENTATION OF DFA @ Re The Complementation method is Applicable only for DFA > ©5504) PB (5,5.45,9-F) L+20 3) cmMppA over fab} where every ‘ar ts foiowedd by eer 40) Qe | & Ls e,ab,abab,-- .b,bb, bok -- J , & \ o : a. MOAI i ® cmopa over farb] cshere every ‘ot te a follaweel by ‘2 Lanquoge L= faaaaaa,--- ba, bac, boca, --- bbbbbb... ,¢$ qb a 6-6) fies @® crropA over Jar} whore evetY 2 has tobe -fotourd by be banguage b= feb, bbb .-- abb ,bhabb --- f oe | © coop” over fais whore every ‘a must pot be followed by bb" # | Lae i Larguage L= fe, bbb, Lob. ,aaaaaa -- ab, oab-.. } b eo b Querb o $8 < AH CMOPA shih accepts the Laauape: b> fo 8" any > =1} © Tre loogege fab,aabh jcaabbs, acsatbhs----} ath, 7 20-bb , aaabb } QeMopFh exrich accepts L= oY? /nmz =0} The banguage L= fe, ab, aabb, caabbh, abb, ac-c,oaa-- bibbbbd---} 26 | cM whieh atte Le forum fam, Let} Ee Te languoge L= fate aabe, abix, abce --- $ “2 nye! r @ copra cohich accept L* For ure! /nm) 20} b,bbbbb --- ,¢,C¢,Cce --- abe ,aalebec, | The Loy L: J¢€,q,a0,a0a --~ cay ' 9a bb; aace -- ~}- Qe fe A eee in Loe © Bem; over fai} seuch thal the 2nd symbol from the Lia tsa + The languoge Le faae,aa, ba, aab-,ba---- } 439 ® cmopa over fal whee Stings ee OF the foun oP bwaP whore | WH any ing over farbh ¥ henguage L= fadbwo? /se fany* Le febbead, adbacd oth bol, baad} The min. legs Stilt: = aaa baaa 32 @ cuppa over fal xuchthak » fa® /nz0 ,n 42} : »{2%/nms0, naa] | 0-9-8 Scanned vntn amsicarf@t pe ao stra} ae GS” ®' Le J containing ahs ~S* e OM trferds wiihay + QS? = bye 4 plaxt aotth abt» 3684 x ss Lg Aeontains abl. act Oz 8” lg LErd wth abh > 8620 NFA- DEA ConVERTION we iS 23 I Be FAME The powerfalness (Expensive peas’) of beth NPA and PFA becunse @Nery NEA can be cooverted to OFA. (NFAY DFA) ' L= [ateots with a} a= farb} ab NpA for L, 4 )\-H1@ ab The Slate Transition table Sr the above NFAiR AB go B/a 8B The slate Tramition dale for pA will be ab sAle © *2/B 8 plo D The tamition fanckon -frnpa , ‘Scanned with amScanner re ~ © Language Ls fending with a} =. faub) a 6 oe Ma ee ape p NFA = 6s © BA, 1A ¢ Transition table will be [AB] >a - @sa)u (Ba) > faint {9} hn By PI>b- 6-b)v (aos + Lauer tal | Leas | C= fan alstegs usher the 2nd symbol rm Rus ta) = fave} | NpA> Le faa, ob,aea,aab-. - } Tramition datble Qaie ake b ore @ Sal Bf de} hey *)6 ¢ | The stole Transition able fe DPA wil be Al a “BEI |B) Gey * Tape] |Eaae] [ve] * 0] | cagy aq @] te] te y -38 i Le fall Strings tern eshich Sed aymbol fiom Rus ¥ of ® Or NPA + (a = OXOL@ | Tre Avantition “table by DPA oT be b — [4] {Taeq Cae) |pancy” faci” ; Drecfancd~” facg (ec) |TAer}~ [an] * [Beco] Fawcn] = (Aco) * acd]! (400) [Ab] * (Assy) TAec] fc) ‘ * (iol | Las] Cad é Nolé -Tf afe micjepal NFA Contains “ny alakes then the .asipiead OFA moat muro containg *2 “slokes (Gsintoum) NEA or sbtngs of leogth exoelly 2 b> Atmod 2. © Atleast 2 , > evactly 2 L=fae, ab ,ba, bb } -0=>-@ ob. © » ib. atleast 8 1+ faa, bbb. acyeb,babb--} 3 (ASP ay EX © Almost 2 tn {€,a,b,abba,bbaat > -©53 ab | > -O ©2460 | Li | ws Noe! The minimum pod tales D A Cora tea) present tr the pinite Automata (NPA) an((pra))) = m(CxFn) atichacteps eck of all Abaiogs of lagth When we compliment the bp A the. language will also ¢ compli mentect ai £> when we compliment the NEA the language Way/ ‘ Jab [ns the Nea _,(@)-S ® @ hak te the compliment of language accepted by this NFAY L= fa,aa, ob, aaa -- -} Y= Le, b,bb,ba, bbb-- f , Disab tr the language octepted by compliment of the pn pen NFA ome 08)" Ls faeaabaaa ---} Te OS wt Scanned with Camscanner ‘gl, MINIMISATION OF DEA ; idl, MINIMISATION OF DFA | fo stakes iG ard @! axe Equivalent ushen Thput Alphabet S(prwol ee => SC) €F Spade > SGWEF OQ) axe Fapilont if If wi-o > 0 EQualent INES => a’ & quolent faen «at Kauivalent The Transition tabe oP Bawivelet = Te 9% % 1 Lag 4 Equivalent = Cay 4 %] [vl Ll 2 Eeuvalent - fo. I Lod [4] l Fame 40 Atop Hore 3 Fauvolent = (o%] [ul [5] OJ Note: The states that ie not reachable from the initied stale mot be Removed: Ahey ane, qrny tb fame slater crnat | a 4, hey ade mot Efucel, now Cheek SeSened wn a : ea - ® Mint mise the fotousing DPA The Transition table wit be o t 7% 1% Ve i MW Ve my, Rly ay | Tefal By GIy vs . Ysley % 7 Wy I nck Reachable fiom Initial stake | k ° Glee a i la, ty, . i © Feulvalent atte [a 9, a, ag 4% 44] Le] | 4 Rauivolent states Ea, % 2 [a a4] [5] bd GI 2 Equivalent states By %1 [ue] LY 44] Bs] D4) OI { Zarne. soshp 3 Foulvakeat alates [ay %] Ld Tn 9,3 Gel O47 1) yo Ww - ‘ Y ips? (anre) @ mimise the DEA | The Tranwhen table % © Eguivalent states [a] [4 9,1 1 . fame , here 4 Fauivalent States Ta.d & 4d { ae ob SS _y Not ReAcHaABLe FROM S Pe Intirter STATE TeTronutsontaiie © Fauoknt Cte ow? Ce] le soe 4 Equalent [4 1 Cv] Cy] Vol Ne” : 4Egudlent [asl (yd 1 Cy] vo Me i an | alas y ee EE Mintenige the pen Les MooRE AnD HEALEY Hj O eauoknt states [a b ¢ dl] (el 4 Eeualent sakes Cal [bc dl fel i 2 Equakst sates fe] [b ¢ dJ fel [Fintte Awtoraka with culpa | @ The Transition table jp. =O) ! welb J” ble e* clo e* dic e* \ Aame TE uw give “OY length ope ther, He Outpab will be (si) length abi G@z,8,%,4,2) Q= Foite Set of states Oy GK tio Ate ZeaIp Alphabet (%)—3*-(w) §¢ Treasttion Junction : = Initial state. A= olp ‘lphatet A= alp function. Mealey Machine, on A! Qxe SQ as" Groat) Qh) > 0 C410) > 1 Gib) +0 ay A way 4 (0) [To] TF ue qe on length Snped ther Outpt esi be "at length bia 19 Mealey Machtoe ‘Scanned with CarnScarSet Vet as 79) se cootuict A moore machine that taker Zeb of all shings over fork} and paiols 1 as culpat for every ocearance of Sab! as substi. i Z- fad} aefoup [i combuct npa entry cath ob} 43 counting the occunence of Aubsbing! kaa, combust Moore Machine? | Z: fab} Arfoi} [ consbuck ppA endiog with’ bao!) on Censltick a moose machine thal takes 2ct of all Absirgs over fort} . ond produces A’ as culput Ho tnpab ends with 10” or produces Bras | Oudput ip Vp ends wih oi othenoite produces 0’? Sefony | As {a8,c} u-B, N Leet. o % oe L=50 , on Moone Machine) Residue modulo ‘n’ | : : coratruct a mooie machine thab takes btnooly noe as Topu and Produces Stexidte modula 's! ax output. Ee Gory a> Ton} | Gentbuck a moose machine that tarer base ¢ da as Inpu and produces sesidue modulo's’as cutputé = fou} + fomse} Z ‘ LS MEALY Mncuine construct a mealy machine thal taker Binasy. umber o# ‘ip, and produces 28 Gomplement af that no as ofp. AasuMa the shang a Read from Least Significant bit to most significant bit and end coony i Aacendedl? i | = for} farsi, 84 oneand her, Component 0. 109 Grog) ge Ttonf Sher a GS al i 7 NOOO IZ A t= 001 | Te % 24> 0 100,(ts +4) 3 ° Scanned with CamSeamer ‘ Sy y i — phot is the cutpat pocduced by the “Folousing late machine © Xap liror Xb> to —00 a bite €> Aur of present arc) previous d> NoT opin a,b ase falas beaiase if We give H/to input the outpab must contain 4 bils. Ba they have gine bre. option €: f Me a ey, “G49 = 2= (10; ' 1 y pF yf ee, eer lo of OF fojiy 7° ie wine To MEALY MACHINE Moore Machine ard Mealey Machine ole. equal in Pose] Convert the moore machine show, Inthe moore machine Go 18) t2 going to qoard the Outpat axracaled ustih gp 810°") y. -abe Nowy gj, ona! ta going to Sand olp aarsodatedaky, jot se etude Mealy erchine). > Stenitasily continue for other Atades foo [/ (ee ee ee ae MACHINE ESD CONVERSION OF MEALY MACHINE To MOORE MACHINE ® Nolet Th the conversion of Meore Machine to Mealy Machine othe No-o} states in the both wachings ame Zame & Mealy» Moore Che roof Aakes will Sneverse) i | | be (E} Diy B Set eo" Gs sai)’ 1 2 Sarma Sal Now, € - closure (a)- fa, BD} Enclosure A) = The stolen that Reach ate €—clonure (8): {Bro} € ~chruste Ce): {c} Troen %9" on necing Epalh €~ fosume Cn): {of Poe) ‘Scanned with CamScanner xt th Slate LraniGen tabse oO 1 eo Me es ay A [fareoy (PY A & SS on nfferp 4° p> ——p—S cf ha} 480 [oa oe | %| fob Ko} re = ho} tees Te Woof atakes in -te Coupa co > ef NPA ame Equal NE-npa)= N(upn) B-g.— ee ° [Convention of e-NE® 40) ‘| NEA | uk P. > No-of Fira! poles uN intrease PHD C-NEA to NEA conven Gon FP on which uu Can veoh fral stale =e fan Eloy Hewnnite ase alee -fine) stele a yb e The S22 8 giake transition table 1s b € Affasct fh keh pliet Seek Aes A en HN elie Ash deh a os FAMILIES OF FORMAL LANGUAGES ® 39 Sooo The DRAK canna Le contlyucted far all the Language ond One Auch cxomple, eB L: fork? mort > L: Jab aalyaaabbhb----} The Tap in tht PRA 8 that the Abing “@ab" us| ako be accepted 1 OU ate unable +0 counk the nds fo Omni before Wi 60 the Memon oreguired) of fey sale be Shiite. Bub FA Camo have infinite: memory REGULAR Ex pRESSIONS AND CONVERSIONS ies eee euiaechisllsted Lgo Generaton Reqalarn wees , gular Lerquage}—Aéceplor / r Repretertator [PeplaciGromare ean gules! Exprensione . 8 re Region Expie*slon cenlains three cpeoticns yy Union G) 9 Coxaleration (+) a> Kleen closuve (>) a) @- ft . : () 44% 1 € he} (Ss paimitive Rex ee foe ako RE as a= 4a} We ae Now, of » Lé,0,00,000 ---- } ots ao* Gwat.a = [a.ca.c0a,acae -- } (wo €psien) ; eat +" = fe,a,b, aaah tabb---}= fad of all aking? possi ove abt és. fab} © Lz {set of a ating cchose Length 1 cxadty tuo} = faa, ab,ba, be} : , 4 > faatabt bat bb} = fatate) +b Gt} = Jasbauws, * Lect of all absngs choot Length i aileast: two} = fa0,ab, ba, bb, aaa, bbbb --- } {Gr erbyarby* }o~ { Con Carryarh)} on f Goxbyarby* Cathy} —~ Ge All the abriogs oven fab} Lean two Length Stvogs Ohe (se of an sbings hoor Length i atmos: 2} 0” » he fe 9,6, ab,ba, bb, aa t Lit [e+ arb+ abs bat bb+aa} Le { @+ore) Grbre)} Analysis: (exares)" Le {even Length slsiops] _ ques = §e,00,2b/ba, bb --- } = tb) - even. * Exe)" ; TS Even Lenglh shins diepeated cing no-of times gives aby Of even Lents. le u- Tadd Length atrigs i Prati @unyrr! . jen te = @¥? (ain) = fe, aaa, Arb, Aab, baa, bbb - -- } -(ve))* reas) = {@+Be4b))* +h) ), « le L= { Leogtn ta divisible by 3 “Aralysin: any s@rb¥” thy” L+ UG length strings, 3Ls 6Le,aLs--- : % "t ° j ivVarirnarb)earren Arsene” j a @L= Flesh x 2 mod 3} - se | fe bYa+b yar wo) cen ' s, ® b+ exactly zak} — fateas 2} fatmat 2} =f Ba tha ut {ba el ean} {eray i“ Grane ee a et oe a, Tg ee @ur fals wie even} faa, cab, bbb, bbis- --} i | ' {bejbata.. 22-6 a ne) b— (hb mkan*) PN F = | Lobb bata} © > Cabo +b) + blab)ta + bean)* = @btere) + ban Ore) = @b* xe) Cb+e) & O PrR= red=R Ges eer. epke - © ba egd © quits Gta). ore ®eR= Re=g = @rs)* / Oct le , = Gatb*)* - at (rok)* - est ©) gt. 163 Regalos Expatcasion te pinite futomta gy? o: On. >a: (2 otb: | “> a Oat® ; 1o@)*: | t lor ExpPtcesion conven tion ay Ioteraty edge BY fue Zz &3 ape Fol Atate should nok have ony outgoing edge. cand theze should be enly one final aleite -0--©)--®©) ore © Ress \ Ree must be only One fral state and now eltminate the other states except the Srital and final stakes in ang order yor wbh- 2-@ - + © Exoomplet a ® es DCatb+e) >) wo “r Here the dnital stale ta having incom od ing incom 2a frat vad a fon eulgts gor : |-O2-85@ ~& Ou & ® 4 The inital slate hos incomenting edge 40 crake a Tew intial Atate L f Or Oe 7 ~©2 80 G10 C= ac (C+ab) > -©+ $6 --©-870 ab. > 1 PE- ais} “oO f RES bCcsastd (ac ad SB }~ a, at. Se, G8 ; (OED -O*@ ba. @l+ ba? zZ 6 7046-46 ©“ @Re aaa Og ae 1oft > (or Dy Scanned witn Camscanci@t “TESTING WHETHER A“LANG" IS "REGULAR" OR NOT is soa' oe [=f the Language: te fiowe thers the language Regular | thor AIofinite ba ofirte PIE MY S maynot be Regulorr Ard the 190% dat is used to fod whether the given lengunge B Regalox Or tot is called " POMPING LEMMA” > Pumping be umping Lemmra, tates tak if an ghfinite language bas tokocecied fy the pinite Automata then theve has bo be a loop tnside the fiorite faforata, and ux should fre a aepeoding patie Jo “he Languoge | which when Kept cn the lop pote: ‘an! the remaining abnlogs th | paler then No DFA can | langage Ts Tot Rag aie: at he: Lenauegs yilf) (cos do nck find ang Auch d be Constructed) fy that Language and the > pumping Lemma the Negalive teat sahich means pump Lermena. wail tay thal language % rot Regulot Hf we are not abe tp find Buch a pater bub pumping lemma decant fay whether the language’ is Regalos if qe fied such a pattern. \ " “m 2 W nse F “i . 0 © Mime: 20% ‘ys Dpa possible = Requlon Larquage OP /ymzi: —O* ey 2 ©: ‘Requlas Langtoge ™ ole t Omit fang gs” + Te, Longuage 18 FoiteG: value of 9 14 bounded) £0 tbe to ge * Regul Oar jn + not Regalo be cusse of tain before “bY but FA hor ploite ‘memory #0 4 “ targenge ta ret Regular: ® unep, . aaa . 7 /vwol= 2 , 2 (a8 * fee ~ Fielle lorguage ny Rguan language A ae xe need 4 count the Infinite occerens, ‘Scanned win y & ® ww fany* 2 fact of ait palindvames} = The Language 9 Tot Reg 1 | beaane the string “wy can te of ang bagth om » thal must be compaced Against we ond the worst, us can be Infinite Length Hence FAbas no capadty fy Alore Infinite Length abings} @ Nek~ Reguiest banjuceye DOwre’/nmest = Regaalt Language [so compaizions, abe generated pry) Yeas . Leaot biter? j® AW /ijz = Reguleot language « aa* bb (bb) Now, fat et & 6 3=AD > ZbIngA ove in AP and the Comme, J”, * a a oe! | @ an it even = fetiatot of 8. -- } iference can te kept leap of . 1-3-6527 DPA a%n odd = fobiol of at --- Js Requlert Language ’ 1 a) nis paine = Sel, a8, 0, 07,00" -- }+{not top aNoRepeaticg pattern} ot faz «fact chao'5.-- f+ {potio dps nek PLE & e/a! + Agha’, at, Ba'--} = {Nol in ap > Noe eu} a Bw Aa * Even the a,b one geno Trade pendently | to §* there is not Repeating pattern tothe + Language acd hence Not Regeston = alcan be independently qreistond wee @ a er/insi dhe pour 9)! hos FO. Repeotting pattern: oadv/r = bP cannoli bee generated ane) No Repeating palin | ; _ ; Sec) -nyteo) = 9,0) . ; raid ey = Not Rpgiadeor bang uae ¢ counting ais need ryt 2 Pr Snfjnite Memo} yee! Staiviea wien Camaarttll , gw 3

Reuter Language (OFA con be coostrucied ar mead 3 counters) @ © aijnzio > Requlan Lang wage (opA can be constructed) © wow oe Guby* Nok Regalos longuege Qorwcy nz = Not Regulaor Language OLOM eM] msi = Net Requlan barguoge Ep w bp © wre [wx € Giyt : Regt Language «w= tol X= loo wh tol RE= 1 @4d*t + O@HN*O @ wauk/ WE Grits ye Regul banguege (27°! canna go beyord Ss tergih) Inte 5 aw so X10 to ido obit ® Wy / <9 €Cot + ray a ay wW=100 » [Reqs Language] w 001 © PRED Grn 00 (+0 cor OF uy Gan © Kwa /x,00 €Con)? + INok Regular Language ® WRy/eayeConyt + Nok Regiskor Language = ber ch Ol and to ia Regulars. jogs having Guat our 3 ® sof an shiny 5 OCHO + I (ot? 1 +140 Scanned vita CamSeanner bce Ne Vewbices A Greenest ‘Taiquueraiy. supecanted by Cutie’ { le tn generally step iy , P= production, S- Aloat Apmbct Po sase vefsay Pe [S7988] go py | S3aB ry Ts fab Rab | Bob } [*: main tntention of the qromenn te to qe all the abinge thot | ome prerent tn the language 1 I pensation: Deriving the shing fron the gone using the stoskaymb! Sas Deivation of aabk S a8 ~ Sententiol farms ( Sequantal forms. G36 sS>ase =>aabB Left most dativation >aabB. saqabb CONSTRUCTION Of GRAMMARS ° OL= focab,habb} — SP aalal/La/ be (a4) -(o+b) A 4 SoAA Aralb © t- for/nai} -L- faraeaaa,aaca—"-} [e>ade] @o @ t= Coy” oo fear, abjta.ao, bs} 8 as[bs}e | Sanne vith CamSeamnet Pack of al Aevings of Length akon 2} =me ch gt “Er = (ab) @4b)@+* A> afb B—> apleelé 2 f Length almost Ob: Steg messy S—An = @tbreKa+bte) Aa [ble ' A a | ©t> [alert oth O end ussth' bf = acts b @ b: fates ard end cath diff agmbols j = alath)*b + bath*a L=f zame ymeals} S> ata. [bab /a/ble A-7 adloAje S>aSb fab Ls Font naif Ot-fuuFy oarstfvsbut} [83 a8a/ bs b/a/ble , we Gt%)* Le feck oftan atiings ob even engh sane Sau iis Roan | * (areyoxe))* Aral , a 4 ' 2 arb" 2" fy, ms © ferns} ee ia A> atblab B= cB/c \ ro © Lefanem yn] mma! SaSb/enb] ' ‘ A+? cA ! 4 4 Ss AB A> arhbfab Bsa fee (@e- forirer ge fam 2] i i } aa bebe @Oerforrer watt 9 aSbe fabe a ea'(te)” x For th yang we conret ge Auth roman Gwe give Ser for tis langucge ®u forrerme if § 2 aShb/a bh . sa soaSd And © & faremeran /nymai} js Baebes DL: fare end /nimat} > Not powible to give FG roa i 7 © Le fol EMM] nena} ®© Le faramyment | SeaSe/aac Aanrbjab = aia file \ Ufo em nna “far nmerch fei} —L-6 a Le CLASSIFICATION of GRAMHARS ——_———— according te chomnty the Grammars ce classified inlo 4 type ty Type 2 / Regulen Gramm mar a> Type a> Type” 4> Type © | Tec 2: ; TEL the Guatmvrcet bas Ql the parduetions of the form Lege Hreo™ Right Hoven Gramman Grane wai (Lee) fr Grornnats Abostd be ral LAR GRAMMAR CONVERSION OF FINITE AUTOMATA TO ajo The Trt alake Mhe Acomta % zame as the =O Slot slate In the Grammar RL Lzfarae,abpbab...} tant eotth’A’ de nae Lg Ls fa,barbata ---} por el thle Ending wih a! pa Bs pa —> RLG Bsiig ao -@ Ofer ‘Sead wh Canaan A—ab/ba/b B-rac/e C = adAlb6fa 1LS —7 FA CONVERSION = Types 2 Grammars / Context prec Gamma ~ CEL- pon tte 8s erg = pa S&S ro w ae) = G2) we jf the Grammar hak all the poeductions Of the for } j joo The Gramman ty the Grempk i called Content pace Grammar beoiose we pe ose A without ong Content (opdition) that Vemuat be preceded by a likewise. Type 2# Content price Graromays = = : frrbigions unambigiows| |Delerminishe] [Non Deteminianc! ‘ cre CRG , : | | | | } | | ’ Left Recursive Rit Recarvaive { I Gammoy Grammar Scanned witn GamScannet §—aSb / Ab [SSase S asblaabla S on \> Ease . By siti . No precectiies! Wate Gh g sae Mallade stakes + LA,2,3$ A—> addle =2]tohi u 25 che ENevet the stant atate fa nullable then the tong uoge Cont ons © and it must be present In the stark slalz produclicn. 3s Ab/B/a/e A aAafad/a > bea /eB/b © s-7 Abac Nuttane symbols: { 8c, a} | A> BC | GB Ble BOF Ababa /'ea/ aC | Cc Oe A Be /Ble Dd oD (Coo add epsilon eventhough &¢ an nuttable (-' Unced to add it ELIMINATION OF UNIT pRopuc TIONS [S407 bb/a [be © sarafa Step! @ B->bb/a/be A ‘ |b L A albe/pb. 4~ albc/e, JO 38 SK + S2B bb Ce - 2s—> KAP => A> KS bb & be q-sbe © S48 S—ae. Azo Aza Box 20 VE So B> bla | a : B2C/b core? CPO 1 Upetess regenbols | Csp Dea j 5. Not Reachable | DoE XK. E34 “fom slat share | - aed Exa iy ELIMINATION of USELESS SYMBOLS “ i Now, the orefal aymbols (ohich asl | ® ssadja Ts fare} qererele Zone Lermninals) archer, 5} A> Bjb ve fs,aitrc j => Be ie not useful aypnbols( G could not generale, any abtog from Bye i = Bed here ‘Al is not Reachable Ahexfove the | Ab D toini migeed Gramercy evil! be |s=e] | © 8 40m T=faybh csefulayntols Lore A} A a Ab/bha/a tau} NE 4s,a,8.c.0} | B>LbAfaB/ap, | C—> abca/a Db! San | [enna A Sahb |bAala . , °B bAfaB/an, | © S> Anc/eaB. T= fab} Osefl symbols -faib,B,A SI} | | Awaa /®7€ ean. ve pneie} 7 | B-> bBb/a C7 cAfac| K [> Not Reachatte > |S> BQ ea . B~ bBHa we ooo ee ODUCT ION. WA TRODUCTION [cHomsxy- Neem FORM] s [—Teentent poiee Garonne | ent Po}ec [——Teentent paiee Garonne | [ciety ret For] a cNF: au Tf all the Productions ase of the form [A=>2c] of 47S whore AB axe Variables and a’ in a lemminal- Advantages : Length of cach prroduchon ia Restricted 2 Poivation Leice (om) peste Luce ohlained fiem CNp & alengt Binary tree 3> The noo} Ateps Mequiced w derive o ating of [length tua] ** [ead] 4> Tes easy to apply cyt membership Akgorithe Q(03) Kene, z Jing toto CNF2 ® convert the following 9 gn a/ne 7a SoA Ae tel {No 7 ya eee Ne A 1 GO/ 65 be a s 8 aPe/pS/b B= N,@e/N, 8/6 Na Ne Ny So NA/NB A Wr /mS/a B > nap /nS/b Scanned witn CamScanner % ALQoRITHN (MEMBERSHIP ALGORITHM) © 98%.) Deheck Ushether the string “baaba" te a valid member ofthe Pras, loonteat fee Gramman? | S-> abl/ee | A> Béla B—> cclb Cc 4Bla * The C¥K Algoatthm tm usct te check the eg et | language generated by the Gramma or et. => [Te cyk Algorithm can be applicale for only Cnr Ben | | Garay, Giver Grommay = S—> AB/ac | “A> BAIA Given sting | Be> celb PETS j CAB) | 7 a ; ee ee ee | 5| Ac | Cell mo C103 : Now +the G1) siepriesent the Vent . fe SERRE Neotiatle “by | Th the yeqyuired Str | [4 tor) "4 | SB” 70 dhe value of cen G3 | Seannac witn CamScaner i a (Blast usth 2” and = Nalue of (2/2) th the given abiog t ia @ (2 bee) oa outset & now see which vasiable cenives a’ < {ae} cen (318): The Alphabe to the (33) ta SO faye} vot generate a fac} st :@a) cen @) Gell 0 (96) GA = b> Generated bg 'B’ Gsis)= = fae beat reo ™ «2)3 45 . Gin 02): |bdaba ‘ (2) means tant with 2) and end with ‘2 -> “bat GO = GD Ga) ia Pe Gerla ci =fbpcfach = faa Be} = fa, s} VC Gengeaded by St ne Giz): (232) = (2) x (339 TR. Jac} x fac} ws fgarag carec} = 4B} “Gre dertvediy any of the agmbols: Sell mo (24) + G5) (44) xs) 3) x (4a) = fac} x{a} = 4 BR x fact mal ewe bt {Aw cep me =.4 BA, Bc} se\x! aad = 4a, s} fast Scanned witn GamScanner (id = a] @ 3) te 0) (rsahse = 123) 45 a3) = (003) EY DG) " efatxtap: — {as}x{ach = {oa} : + haa, ac,sasc} = fot e{x «x x}eSg} (a4): (22)*%@4) @n (@3)xCaa) i = Asprisch Go {B}x (oh j = {aa} = {as,ac, 88S} . a {et Similealy continue for vernal ning cel = fot Now, Gis)= baa ba Gz Baab as)=(00 (2 5) -fas} (la) = (2) (2 s)efsch. @) (5)* fa} (4) (55)° {gt : + {s,Ac} Gis)= 2 3 45 (u) @ 4) = B8x @® (3 4) = AS, AaSS SC X OD 44) =f} = ( @2) (35). pace = f5.c} @e)- | (2) G5)> pres - day (24) (45)= Ba, pe =fas} TD) abe cell Clast cent) (16) Contains the atcoiting aymbsl “S) we aan gerne dhe Sting fron the given Gromman Now, whal one the Vootious sub abvings thas can bk -generated fron the Gearemoot é Of the given absing Wow Check Whee the ateonting agmbole @le prerent in the table ie tt * present at celle (2) (374) (4S) (215) (5) + 4 a Given shing boa be {hay fob} {bay fata} ~ fea araata i 4 poge enc! LORIE Poea(ane? 4g oe aN the preduc tons Cf The Grammas oste of the fem azar uobete. | govt then tS called) GNF - DE eye Am aBbe ATO adantages, b Te Toro} Ateps stequbied tp generate a Atving OF length bo) 1 hel iy ANE & Useful inorder to Convent a CPG te" push dow fudomata! CONVERSION OF CEG To ppp: 0 Ruth the stant mapa ee cole see SGue 2 GA) > push Ris ob 4’ as Plows [EGrat= Gd] ij baz *2 nec 3> Add Fal state with SG, 1b) A= Gy, 1 PD] y [A>bp is To Gramm SANE, %)= Gy €) © S- aSb/ab —> Not in GNF Ie GN (biB/e) tlt 5 Gas/e) (aS/SB) 6) 62 (82) * 701%, © ) PUSH DOWN AUTOMATA L468 Push Down Automata finite Automata + Stods R Yeh Pour aedormta : (@, 5,6 Ay) Z0/F 1) Se pinite set of atoter Zo= Boltorn o}, the Stack E> dopul agente! F = set of final totes S= Transition function PP? Stack Alphabet oz Initicl Atate [eater mint por}_ts= axizvcfer > exn* | : [Poa j j INon- Deterministic POAL |¢ - See i L= fare /nzi} ! Leb the ating be aabb (a,a/aa) TAIN & a" (bale) Acceptance at 8) cep ter . Sate eee) e242. $y29,%)= Cyy/02,) pon by Empty siace 8 10) = (@,aa) | | S@orbsa) = (,€) SC rb+b) = (ay,€) 8% % )= GD mED) =e) Acceptance by slate “Acceptance bay Emly See ot Acceptance by stale oe , PDA s\ Acceptance by Empty slack @ Ww EG) /-7(4) = 9,603) Let the avig be abbbaa @ fe) paras ‘qub/e) (6.2, fro) et U va Zo @asoc) 2 J (bib/be) "> push als onlo the Stack » db Yoo bee b pop ome a! & vice vere. | 3 dy our Alphabet ie! G “Bolton ‘eb Soest ee btu Stack, © bs [arb e fame 8 i | ames) ee (ci%m/26) (6) 2/0 te) oak) © Y Sis Led @ bs for uP frm} @, sofa) ga (ciavé gary’) & es od laos) Ou: fomtn EP fone Canis ) gee gg bn bes (bave) Ones en {> L: ho BO fom si} t : 2. Grzola%) (ba) Ghe) Q (a © & (EAL) | (aajea) (bre0/%) | (6, b/ bb) ‘Ou fan one [nm>!} (aja/oa) (elas) ae D 5 bang (baja) Gare) (brb/ bb), ® Le farb™e I” foun s 1} > context pree languages | ib fan bm em™gn Jone!) i | pcs '@-- fon EM EMA] mim oth > Not cee \© Le fan 6 (ma i} | The arg vage acceptect 18 Ls fabb, Aabbbb,caabbbbbb- a => The aolution bo Constwct ppa-for the above languege is instead Sf pushing om a on tothe Black we push kodak aml pop them ogpinst ‘B's which means Wb Fee a al, tusill push 208 Onto 4he Stade (a,0/oaa.) Q@aloa7) Gao , . Li 6) (bale) @) (€,0lz,) a ¥ & The other Adlution for the above problem 18 for every two Us ux 1 Fhould pop Aol. which mecink we push all the ols and for putting "b’ On > the stack we pop ta! agains the cceavence of 2bs . © (aafaa) (a.2ola2.) Oi foreren/nait => Not Reg FL @ ve fweew* /wwe Gay? } (ada) bJode) 5 ‘) Gala) & Gol) @,blb) wr @) (b76[b2) @a/aa) @b/ob) (bea (ta) ' (bb/b) Le fow® we acy} gs io I No"ppoA” for “Hie. Language wehave -to constavet’ NPA (b,Zo/b2) Cbvb/e) i (@,7ola%) (aa. (a @ak) a oO (ble) €,70]%) @b/ab) (ba jab) . (aajaa) Non- débermniniinn: , NDPDA isnot as powaf! az pppA

You might also like