You are on page 1of 43
SN a a | } Name: Manas! Raliesh Bonde i Roll No! 206 piv: B/TE Tutorial Mo- 1 1D [context free gttaMmmans Are oan = grammars. Ans! prupe 2 A Z 2 a port on re Tp using Me _hog-+ = functiont and expressed with ’the ang: [Ds ;# ! waka SOLUS) 9th da fede IGE tohich ot the following + fatee® in ; lemma 1s Qof used fo chect whether tho lan iD _Ane. | Pampiog de requiad ‘ aan pte i . 1 Y { il yp SS ->Taaat, T-=p aT, T--? bT_ T--> 4 then the, bun—| guage genetated cen be given af i Aig: Deows aaa Cab)¥ ivy ss D the pwduction étrammey } s.0Bbb, $~> abbot is Ane: Deype= 2 grammes. vin © toleminge pring 'p ab. anata? ig eonhole principal: Vii) Which statement tc alee for Turing machine - Ang: ©) Two . i commmlicattonnie-posshpia henalusé: input yo sna cu al -then_ahe language inthe coos ANB! lOc oth>* : 2 ge is uch thot ever ene eaEns ©. the type A--2pAR then the Geammoe ts in AMA! Qliceibadh Newmal form. | © Momosi Bonds X)_| Two Lovie stoke, roachings _ are said tobe Zquivalene lit “Hoes. AM: PRecngniza tne came co} of to\eens ££ x) ist pavduchione ane of A--3a,0R AD BG typerthen [it is -- aI Ams: Mthomstaiy's -Nowmet Form + XID tohich of the reguiat expressions covresponds 40 this Grammar SAB /AS, A> ao fan, B->b Ans: bDaatb aii) [The pzpblem whoce language is recursive \¢ seu'd ito be Ang: Dpeci dable- one Aiy) yonich senience can be generated’ by Sd #2 deca, Ana: Db ceddd. 4 Descriptive ype 2_Que sions: t ‘ : 1 ot 1 : Qu: Faneeae i NEA fot Sotiotnitig: ns Exprescion! Manasi Borde Cathd™® ava (ate) SS Jan : oe Decewibe the following _ language in Englich. Case>* q Care )* The language» 1 “thé stsing containg at lone oa. 21 a Caro)* Dab O== Oi The language i¢ * the atving he'ging toi th: a. Q:3- | Wertte Pamperties Of Fem: Ls —++-EsM_indicates pesindlerty ———}_perlodict}y — no memory no storage -for ip. —2-l€quivalent classes of sequences. 3-| State Determination: * 4 iisy 0 ts reco: S-ltmpessinility of Multtplicates ne sm can PAULL ly, tong _muttiplication- 6. of i 4 Geel nate vex ‘i ceian of aaa chinn +O Meaty Machine . ie : Ans: H ‘ * tal (Par Alp: > PConetden?'<'t siase: i s - Yo a | 4s \ % 4% | a | © Qn Ye -| Vs ° | 4s 4s. ! | Cocker ttc Ol p associated suo ep 2- faisiraun. of rinimization of trivial meaty marhios- ——The_trancition of 9, and 4, are distinguishable uncer ——Stotec ace groupe A ‘to! input. Hence states gq, and %, are AIEMO quichable 1 99 he bosis of ofp 1 C4) 0 4,,4.) 0%) L | i. The na} Mealy machine I's given Gatve DFA for cet otal) sivings edhich end cotth oo- State -trans{H'0n diagram : : SATE Se eye is : oie eal : Store Transit’on “Tatole: : ] saares | __i/ ° i ws ta | Ea : 4 4. | =@, 4... |-% ist M be a detoxminisite_o Pas. S$ 4ebt y Qe BaF s Puen Te : As shown in State transition diagram - L G05 28,5 Example: 10100100 Start | to loo loo 1a, ] oteotoo lo %,] tootoo 1014, | o0100 toro 4,} 0100 lotooy loo Lotoot 4%. 100 loreoted¢ jo Loreot oo 4,1 Q-6. Design £SM to add tWo binary numbers of equal (yp = Pouh i ‘there are two fun ctione : STF CSiate Transition Eunuion) MAR(CMachine Function) ° No Cony ctake CN | carry stare Cc) Yo 4 i lis | state /outpur | state (/6utpur olol w/o Go J 1 oll tof 1 uf} © t}o ef) ay [OS rit 47 0 4/4 | State Transition piagram ¢ EsmM) + Manas Ronda ) re Qt. |esign fsm which checks tohethes Whe given numer _| is even. - ees Numhew = | 0752196 |_| number apto | current disik | sicte | t l odd | lo ° even \o7 = odd 1075S 5 odd | 10752 2 even 10752) i odd 1075214 q oad | 107521 36 6 even State Troneiton Diagraro: odd Ste ye Lage ETS, \ a1 Tey mrab® lo] 3151715 o. v : | a Shona . 7 even.stare . ' Stote Transition Table : £ stare ile 012,416/8 | 135,196 if ‘(ee sehesle Mandsi Bonds jx) lem=2@,¢ £4, €% Q =F 40, %, 925 3 = 30,1,2,3.4,5,6,7, ef |_¢ = Ae shown: in slate transtvon diagram = 3 Vot ope $a 8 | Examp\ 12376 % 112376 Lig L 2376 ling, 1376 123 q Lvtée= [i237 saeles fiza76 ade. 8. i) [Differentiate between’ Moore and Mealy Machine. ANS © z Moore s uMeoty + ) lolp-depends only upon piel) olp depends. ob: precent ciate | sent stare. aS voll at present ise. 9 iat UR chionges; ofp does not|2-16 1p changes, op aleo ihange 9: = changes. » 10) i ore. {s’ number of states are | _ required. required. Dithere is tess hardware requ-|i) There “is more hardware iwement fox circuit implemant--lrequirement fox cimuit imple-|_ tmenotaHon . S) They teact Slowex to inpuss they react faster to inputs. [Synchronous Ul pul_ ahd leu. generation, generetion. D Foutpar is placed on stele) owipud te placed onranetiton| © | Easy to design > A ‘eynchronous oulp ik [misterensiate_| ot DEA D Trensition is cletesmioristie. | NEA D |transition_is_Non-determinisiic._| > INFA_has_ fewer _number_o4—_| ——__ states 2) More, Wf NEA Conjaing Qstates| _ hen the corresponding DEA | oill_ have S 2% states. 13) DEA (sg as powerty}) a3 NEA 3) MEA Isa poner) os DEA. Easy io design due +o pon = _ ) Re lokively, more ditrteue | |ko-design as transitions ate. | [alerearninistie: 0 ___ WEL as there. are. sevorn| palhs!. | Bark=trocking_is required to_| explore _,evenn|_poaaliel paths. IS) th fs: easy 40 tind eohe-thes | WEL has -+rans\4ions are deterministte- a Q.9. AM Explain the closure prmperHaq'of CEL. _ 4 content free language is_closed tndem following Operations: Union 2. concatenation | 3. Kleone stay ‘context free language fs aot Closed under intersecti’en- The intersection of a context-free Janguoge with a reg is 1 ro Ntex, 2 iats a} Jon om mentoke the co losed 1. cet fe dosed under Union. lthearem: ff -),and ly ore const -froe languages, then ! LUG is sa cel: . Pxoos: ies be o cf. tt is generated by ‘a context fe grammren” Gr = (Wi. T, Pi, S))- Similags . ics another CFL generakd ‘by 8 context-free grammar = (v2, 6 2 by i romars and 5 one atammor G +hattoill generate she union Of +he tao Hang tages | A new start symbol g is added to Gt. 1° Two hex. preductione are added to &- $5 S S~> Sr The armmar G can be written as: Ge (Vv, Uv, U$st TUT, PUP Ufss Sls ys) S$ con generate a stoing of tesminals either by soleching start Surmbo\ S CFG, or Stast symbol! S2 OF Gir. Thug .¢ Can genera) £ Mores) Bonde | | | a_stving fom t)or from by. 2 (Ws Luly cer ts Closed under Concatenation: | Theorem + th Liam tare cel then yb js a “Fl Proof: boknsc eta ‘ le} ti we a CEL pith the grammar Gis (W,T,, Pi Sy) be a Oi. = Th Po |S. eb i. ins ae ‘corobing: qrmmmars @1 and @2 into one grammer G thed will aereroto 2 2 Lani [+ A new start symbo! 3% is added to &. l- A new preduction 'is added to G: - | | S 5,8. : ! os 3 Le oi) ists tne vert |= Aw) = “WhW5" 4) where “Wy @bes and Wy-Eily z. [The gammmoar CG can he tovitien as: G (WU WISE WV Py VPYVZS>-SiSTS) «Ki S lrhensem 2 Tk 1 is @ context free language, ‘then (* is 9 cel r | Peppfi ps 3 1 a Manasi Bonde (er lel Loe ot CEL with the grammax G2 Quit Ps) Tenors “A New Stoxt Symbol S$ is added to the GAAMMA~ Cy OF L. ———1m0_ new pmdurtions are added to Go S> SSr S>E “The pmduction S$ SSi| € cof ll generate a string wW* tohere wo CL) set 5 “The grammar GI can toe driven ag > G@= Cv, P, USS ss) leh s) Oe is no: intersection: Jarerc™ [n, mo} =fa™bde® fn mso%. | | | i j 1 | | 1 | The language Lisa CEL with cot otspynductons given below: > aB A oblée on it B—cBle Ith. @ language ica CEL toith ced of paducting given below. SAB A> ah\e B> bBcle + A String 16 bi containg eg uol number oF a's and b's. +A sting wo, EL, conte nw of bis and cls. A string WEL, At, wil) conta'n equad number of ats io fof b's and ats. Thaus Liat, = 7 a7] nso . From pumping lemma tor Cel a string of the form abc? can't be genemred by oO CEG. ses uit theretowe , the clase of contert-free languages is not close osinte eae Z 5 CEL is not closed under complementation theorem + the se} of Comtext-free languoges fe not Closed umdesr cormple men tation. Pook : fi 2 {ted ws assime thot cel is closed unden carpiememtetin —__|14 1, is contest free hen 1’ ie also context free. Now 1, Als can be woritlen ag (t,) UL) rohich should | alto be A context free. i i S[ since, Lats % wu to es ‘ L {is Closed under \ jon_LS. wFDNS - es intersection of _Cel_and Rt _—_Htheasem! Z Pies is_a cetand g js a requiae language then RAL | LX O CEL. lpmeoe : le} us assume L ts accepted by a PDA [om = (Qe. 7 $,%),%, F) and & Is accepted by FA. M, = ( @) $24, Fa) ‘ fe can combine mM, and M, into a single pp & ims (Qe.r cy £). The PpA M will acepta leiring wif it accepted by the DA M, and eam, loth erecting tn porattel The construction ot 'M is given below: Qe Q, XQ, the cartesian product of State of EM. 42 2,04, a ce 4 = (4.,9,) Tes Fos Ei RES ! The transition function is dened, oe: £ (cya. 3,U8) = (cme) ,4) + feransitfon for oy TE and onty if $04 a e)= Cpu? +o: Ltransitfige for WJ fond C4, uw) > (pe) Mo | Manas! Bonds __laatnen 11 pasces fmm shabe (4%) to shote Ct), lm. pasees fmm State 4, to P “|e-since, Ms will read one cymlbol at a times it req— uires Jul steps to reach the state p, feorn 4,_ Thus Mis a PDA for intersection of LCM) and tims) L cra) =k CM) Ob :Gm2), wro9e A} Cey ic claced under Revessal 22 Theorem > inh b TE pis “a context free language then @o je 1%. Ponok : alimeney it Lek Us pecume thot “t= -LOG) for gome- CRE Tq: Cv,t,p.s) A qrammax generating revesse ts given By Gas ICM i PS ez) PR can be obtained from Pp by Trewerrsing | +the rig hs lnand side of the pwoduetton. ___ | ft A» & fs a prductton in P then sa KS. is of pysdaetion in e* \ tL. Re can be canvemied into NEA and Nea info equivalent DFA. f RE_already used in UNSx Opesoting system. Cems -|-Can ahs Pt elle epectty the gapup_of characters using a a of square brackets C7). Lf o-9) dig tt _ trom 0 to 4 Ca-21 stands for upper- casi: terre | Ca-2] siands jor: lower case ether | [Le-9 A:2 a-2] stands fow letter ov a digit. | farep _outitity ip unt fouod- 4 grop president erp. tet: 2M 1a( 4 '*' matches zewp ers more ocr urances of pacevitous Chane *@ motches a single character: [Arar] - st wit) mater 210g) chaos whe ie pot Py dows wy pris xte A:pak — if maith pattern pot a the begining Of <-the “line. = 2 pots - at the end of the line. Example: fer (0) The on ard Car wal jt sand (oo oD o* ctande tov rem ov more occurances ofa. $grep “As % -thokue' emp -tXt will loot for a pastero 4 tarting toi th A and ending eo tth Haku Lin tine fille em pi txt- ‘ 2. | Lexical Analysis: —_= lexical amolyste ie an t ort & ithe lexteal Anoluzest aCahe the souste paogron and conver tb inte a'steam of tolesn A. tokep lic a sting of emneecukiv yroloo| defining an entthy- leg:- xs Vie has folipwing tokens. A= An identiHer - : = Aesignment opesotos LY = fiche ti fterr t= Awithmelic operrotor Z = ident tr ere keumosd identifers, and: opewotors. are . common | exc ple ot foleens * 1 The DNIX wbility tex cam be “uged for worsiting of ___ ta extra! analyst . a © Of regealar ‘expression fox each type OF bole land outpid of tey {so ¢ papgram sox leaicod— analysic. | Qu-| Give CEG) ko generate altesnare sequence ofadn ANB s2 Jabt ee Marnasi Bonds T= iarbt Pp Pssaa/ bee A> bBIe BSaalé S = start! Symbol. Qa. | Give CEG tov generaton of étving Which don't contain conserutive — a's - f = = Faby L= 3 Ga, bab, abb, aba, tab, bba, P= Fran jos fat le A> ws/b Observe +he derivation S —> &S Here He Sting will begin with b and aqain the non —— i c cane used several {mes i\\_tme generate non terminal & => bbs o> bobs => bbbas Ars? cio} of ugenemtng AA we Would nave generoded a,b and tne pyvcese Would have stopped: From Awe can gen ente only b ag the first Symbot and sno oO can he generated Manasgt Borte => bbabs {oS bb abaa, } => _bhabab ~~ | Pavse tyee t 3s | oN | 7 oe —| + ae i » Ss | Z 3 - T A | b Ss 7 1A | ‘ 2 2 6 x Sequence ts 3° bbhabab eF@ = G&= CviT, Ps) ve [sat T= Za bt p=] s=as/ps/albjen: A> bS/ by S= Stort sy mbol- Q:\3:| Define the following terms: D [Turing machine: Definition: | ATuring Machine (TM) ts 9 merhemeNca) model which +o 40. pe aivicded Into cetls on consicts of an infinite lens, consists of a head Wich which input is given. 14 reads the inpube tape A broke registe’ Stores 4, istare Of turing machine Astes reading an input ——_symbo bus. in othe um. internal state ic changed and it moves from one ce to bright ov lett TE the TM reaches the Hina) state, the irp string is accepted, otherinise resected. ole faljlalela ™ = (Q 8.6, 8,4. ,B,E% Qs nite set of stores [T> ft ts Mite set of tape symbols B-> symbol of F tor blanit => sek of TF Mot including B 8 > Qxt way OT xFurry LeLbest R=Right Y= Stow} stare z af F = Cina) stete. Moore and Meaty Machine: * : Moore Machine + A_moore machine is an FSM whose outpute clepends on kx . = Machir ‘ en! by a 6 tuple. m= (@,5,0, 8 %, 4s) Qe I's a tinite set ot states. = Slt is a finite set of symbole called t1p alphabet _——pAzite is o]p transition funciien &! Q20 | |O= it vs a finite set of symbols catled ofp alphabet S= itis i/p treinsition function + @:QkKs>Q Yo = initial state (4, 6Q). Meaty machine » : A_mealy Mmochine iS an fsm tohoce oltpul depends On Ane present stare as well as preseot input. Tt cor he deecaibed by a 6 tuples i Me CQ 2,0 SK 140) = \k ts a finite set of arabes = \t is a nite cet of gymbvol catled the ie alphabe = 1s o Hnite cat of &ymbol caties| the 0] p.atphabel . = Ib tg the ip tvansitton function 8: QxS%@ 2 ot te the -6/p trangidion Funettoo KV Q XS > O Tniwol store (4,:60). 3) | Grammer.» Erma eeaiaeivical oo Metrer’ aele , A grammat is a eet of prypd.uction males whieh are mule +Hhese oy Parpiag Lemma): weuvew such thor tuvicen & ivtpet Teast Valid Shs Manasi Bonde NEA and DFA. Lain DEA fox each inpur 64 Mbol one can determine ithe state ts toly¥eh machine will move: Hence it ic = L caved DeterminishHe Automaton. As ib hes Hyite_ inumibes af Gates the machine Is catled pererminisic finite Machine os peterminisie froite Automation. DFA =T @Q,8,5,a. EF SEs tinite ger of Symbole catiect alphabet: 2 et ao i war inprik. achhine Con inath' ° ten i machine. In Other loose, the exack state to Which we machine moves Can't be dekermined. Hence, tkuis' catted Non- Ideterminisiic Automaton, AS it hae tHnite number ~ bot atazes: (4 ic! also catied) at Non-detemmintctH < -Teinite Machine" o¢ Non- dererministte finite Automaton. BEA =F QS, 8,4, FE Q = Sh is-a finite se} of tates: £= ty ito ainite set of symbols Sz st te we transition dunchon: 2! QAS 9 O Initia) state (4, €Q) Final stobe QCFSQ). 6) | Applicators of EA: {fer the designing of texica) analysis of a compiler 2: |fow recognizing the pottern using regulap expression —_3:|fox tne designing of the Combination and sequencia) —__iciveuits tring Mealy and ‘Moore’ Machines. =e tn text ealltoss + S fe lc 2 Qty. | ws we Oyon i OF gram’ y | Z/CNE ( cChomeky Nosmal Eosm) | The given grammar ‘ecard 4o-be (pn CHOMSKY! Normal form of CNE Tf every production is of type ADO oF A> Be. Example: consider S > bA [aB AS AAS LAS ao! BS aps | bS|b Boll A& tne RL o4 game produstron contain both the tewpi- mols 4% well os non terminal and she given gromm- Or is mot CNE- Any uth grammar. winith produces thé terminal strings ow the one whieh is 19 the poduced’ fom can be : 0 can Albo be converted tO CNE | we hove pamduckioo_, & bre Now \b willbe generated from the non teeming) bul is not the unique production fmm S- Hence we intmduce O-new Mon terminal Rand tne paoduction rules are + S PA Pb Both fotow the rettricHon bby CNF- similarly, S — QB Q 2a A = bAA gay anothey non tewminal 2,wil) genewmbe AA f RDAA A > pR* A can be written ag A >a A> as ADa& simi lacy, Bo aBBt {| 84> QT T= 68 12. _ B bs So Be PS B>»b | Hence ithe: CHE: fosrm of Grammar {s SPA . pAb & > QB Qza R >Aa ~ - A >as ~ A >a. — — al | _s 3 @t _ | Bo + pe ~~ ee | T— BB | Bob | LG = {NT PSF where Ne S12 RTA, BS T=. Jabs P= JS>eA, poy, s>QB @2a/A>PR,ROAA, &> QS, A»® Oo, B51, B> O8,T> BB Bab} @ue Careibath Normal form): lot tne qenmenad is uth thot Qvury poduction vis of -the type A> aB where a is a terminals . enhich ¢an-be ond Bis a string of non tesminals tohich CAD be empty | * orn Example! Convert the following grammar to GNF. S—> ABC Rute | AO Rule 2 Ab : Rule 3 B => Bbie- Rule 4. B-> 90 Role © e¢7at Rute © Ce ec Rute 7 C >ha Rule 8 where N= 3 8A, Bt | T= Jab} Sol): Now the production cules 2 » 3,6, 1 are following the —____| rectricttons of Grne and fi fox the others convewtion ic nececsnay Rule 1? S raAaBe Now ill tay to replace He reading non teeminal by it, eemina) An: Seqi this we should consider atl pyndustion rules. = Ns tre “Aigc OB by oils productions, ro teadin 1 208 Dage Tes 7 os 8 > bBS because A a ot A-b Rule 6: B-> Bb Lies} letle date tare Of trailing b ou dodendadog 2. non= ltesmina) ‘Zax p. 2. P= b- and ths given Tule eit) -be changed tO B eP. | tewminal, 1 —> acp | i — tule again is ‘nel'Valicl and alo the genexaton is Hous: ow ate aabb ia} out AS bb can vepeas. Joy's have Q>ba a Q» oumbex Of big: Hence the producto wit! be B—> aaQ : : LBut_again itis invatrd Let's now indenducenct jothen Pula: Ro Hence BR > aRQ Rule 6: Baa can be B>3aR ule Zi C > ba can be C >be Hence the given goaromar: in ne: tit} be SD abe S-> DRC Ara ‘i A +b 3 > ARQ Ru 25) Baar E Danae t @ > cl re vis € > bR | Convert the grammar in GtINE foto. 1 NS: S— ABC , A>, Ab, B>Bb, Boaa, cxa0¢ ect c > ba. ER RIS SRS ee NS cs ANS! ‘ not : F $PABC: «Reale ; 1 AD oe Rute 2 Aab Rule 3 - ‘ 4 4 B> Bb Rule 4 | Baa Rule 5 ere ACs 56 Raves OP cbrye “Rute 7 - + Cc => ba Rule & where Ne 3 $,4,8,¢F Hs FQcby + C my) ———+Naowd_ the pavducdion cules 2,3,6,7 are followin voy ——he_restrictions of GNE and for other embverelon ie Netecsavy + laure. Li s> Ape ——_1Now oll dy lace +4 adi ——lts_panduction’ to get the teaminal at dhe begining & ; : , : : S$ ape or $s > bBc because SSA OF S>b Riale O! BS Bb Lu . ws trawl on termi 7 + Pb and the given rule will be changed to 8>8P. Now) 40 replace fixst B by 4s productions +o get leading texminat B-> aap: Jain ts not val als. eneratton is oy . io! 204 eran] aa from B A only aab. AS 1b can repeared {ets have Q> r@ : Q-> b [Thus then ever @ is Qenevated we can qeneratect by be. BD aag. Bet again it is umwalid. tetle ‘poi lotenduce anotner rule. Roa Hence RB >aAR@ 7 Rule 5: BOaAAq can be Boar Rule 8. ¢>Bba can be CDbR Hence athe given grammar {n GNF wlll be SDABC S$ >bBE AS Oo | A>b B>aRQ R=a Bo2aR ow at Quz eased Cc >bR Design Turing Machine to genetate. 2's omplimen* of La given inary Suacahes. srr be tt. =p BBD GY Oo Crt7- Coo Logic: 610 from right 4411 1 leave Hrot |_ and move to Jeft and then mate je complemen} of tk eq: - Bitioolotooos + Fo Move right 411 B BliyoototoooB ¥ 4 Move left HI we gep | BlittoototooosB x Manas! Bonde ot 1 _ _ ( ) 4 Move left ti) we'get Band change Oto | and too B lie@ooitttoooeR . * 7 Bit@oool!ooogR ‘t Bii¢golotioooB $ BitelgoltooosB + BikepntoolioooB * Wao olootto00B ti B-0004 t = Transit'on table? o | a | 8 YoRO- LoRl 4iLo Vahl GLI 410 Q = 34,4, , 4,5 1 Be: J-O% URret Cisanfeog st 2B goo $2 Q@xr > Qxr xf tp} to 4x = BR = Blane £ymbool FE = 345 Q.Ag- —Ans* | Pesign Turing Machine for the string O71 The stsing wil! be ot’ the type oooll! coco tts t et - let the stxing be ¢tored on the tape and read /wrie heccal_athe fixsi symbol of the String. B ooo O11 B Cte) + The state coftt Ga cot! read thie oand replace ft by & and contsdl tc taken towaryds sight: BY COONIIB Ct) Now the move head towards right uu weget } Brooo tie + ceovete Vt to * and againmove left Ht we get oO. BRK Oco¥ tit B ca) ir Sicip avo ti we ger x B*000 * M1R~ Ca) move ight Bx 00x 1118 C4.) > Tt we get o then repeat tHe process , B AIOO X11 B (4) t SKIP) Bix OOK 1LUB + skip *A Bxxoo* 1B 4) t Bawa x* OORT B C4) e 5 BAR OO KHOI B 1CaD t ees Bux oom % It B D Bx x oOmK Nt B x. C415) 6%) OxxyvyokxXit B x BaAxK OX KIB * Bx * ¥ Oo eH I t Bw x¥ Oo x Bx ## 0 T x ¥ 4 1 ee ve C4) ch) 8B C4) B B C%) * Bex eH Heme A * 8 CU) Bx ** xe KR | pr Bx AK AH HHH t BKK te p BSrAKK KH HM ~ B 2 8 Bs tt) C 24,5 Aeco-p +- Steps 4 \. Checle the Fixst cymbo) LP ook) make ite Foro: move right ttl lt mate it * move move nigh € Cone place) - pole VE x: move MAht Hl) You gy. Goto 2. 2: 3- left HU you gerx eb Ti ¢yumbo\ is 1 ys Goro G n: Halt. Stare Transition tate: a Store o | 1 * Ba | ew | 4.e% | exes | -- 25,4 % | aeo | a,ix| aex | exor | 4, | ato | --~ | @,c% | aues |- 4%: ee Yoee | --- | te ric | Emr | | ams £4,8,0-9,9., Bye? Qe 3, U4 4a anv a= {ok Ps Jou, %, 8% “t §&= Oxv est eT uky B = “Blane “‘Symbo) ‘ —fa = Lo ple. Fan G- | Decign the Turing Mathine for the smmire conta’ ANS: 1 12010) murohers of o's and I%s- bins ctxing containing qua! numosy of hand t's. ithere iS ho addition on the position of a candt. land oN the folowing gisings Me acceptable. Oo, of0}s -ol100! =,ek. Pemrediuze t L Mo | Booitoirtork Baollollos Baoiltollos . | | on Leg | f | | | 7 Baoltlotbo8 + Baatlolbos8 + Baallot bos t Manasi Cond. (ee a Baa 1100 Bo —————————__ [ Baal) o bboB x QBaatlabbos® * BaalbabboB + Baalbabbas T | Baab bakbbag t @ a4 bbabbaB t 5 inn Baavwbabbhas = < Bo aapwbabwboas in. 7 Pct ne Atgept The pains ‘will be ‘removed “as shown betow t Oo e©-1 Meo: s \ oO Stote Tromitfon Table? | State | - oO 1 ao 6b) 8:7 ao | dar [ oie | eR | topR | wor { [a |oar faim laae [ape lase ay la,ol [aso | Gael --- ono 4, | ol | Att [doar |'~-- | Aear Ay | Reject | ReJeee | Ayal |Aube |Aceept- lam: O57, 8) 4,8, 68 Qs 3 414,42, 45, aut Zs Joo wt f= io 46. BF f= Qxf > Qur x PU eT Foe In B= Blanic symbol? 6s 34h 1 | what is TM € whey are its type U Give the ‘od vantages Ard disadvantages Of TM torn its pormeRr oilet ESM. Turing Mlachi'ne2 "4 Entinije tape Read /uowite: Head: = = iTS Syn oot MAE bstere {| srat 5 She lun ee 1 ! tee ee qa at aboaal ee Detiniton + A Towing: Machine (TM) is' a: mathematical mode) cobich aI o On i ( fon tality tne 1 Ossst |state of tae TM. Afted reading an !/p 2ymibo) — lik tc repleaced wlth anotnen gy mbel, 14S internal State ie changed and it moves from one cei tote right ox 1 efb. 20 the “TM teaches tre tina state . ea —__thhe_input _stving__is_accepted_o-tenolse rejeeked. — Tra cansisas. of 1 dtrplet 7 | am= [e.4, FS; %, Bi FS 1 | Qs Finite set of Stopes) « |S = ge} of F not including B- : c= ff is tHortte set of tape symbole § = QaT to QO xr KA Jr.ef | Go = Thit'a) state. {| € = lnal'' gtate. Turing Machine has SB tunctt'on + 1. 2. STE >3- DIF MAF (Machine function) 3 _elp table} 3 state sable} C wirection Function) JT move left oz mighty The compiti'na of TM consists of * (state function) Idnitializing Har fapeand the Stabe repeated ty exeetq Leg S O& directed STF and DIF. 2:| Turing Machine consists of 2 papits! ue Can rea i+2 mbol mov. bo lett 2 wight O& ctay in position. 4 LAO infinite tape marked ott into, squanm cells of rohit symbols can be toritten. pee imple opesations of TM! lee Claange the symbol in the observed equare. 2-|Changet of one of tne square tn another square - -|Poscible change. of symbe} wlth passitle change of — state Ol mind. Possible change of observed b | Srxaroman_!__.S=> 5 AS S>b A> ba _ ne A >b For generation of string“ bbabblb at". leftmost Derivation! S > SAS 4 ~ sig ol = bas abit : => bbas => _bbasas —>_bba SASAS- —> ble ab ASAS., —> bhabbsAs > bbhabbbas => vsbabbbbas = bbabbbebab “The derivation tree. {is \ PTO. Manas\ Bonde wf ) Lot) na Ss ] SA S _| YN ZAIN ba Ss AS ZAIN ZN S4s bab ite b&b bb Stving is: bbhabbobbob Rightinest Devvation: S —> SAS = _bAéAS | > b ASAS > _bASAb —> bASbKOb —> bASA-SbAb — bASAbDbab > bASbbbab => bA bhlboab => _ bbabbbbab The desivotHon tree iis + Ss 1 Ss A Ss 6b 6a \ Ss A £ t S L ac ea © ee) be Stving is. bbabbebab

You might also like