You are on page 1of 46
3 1) find the set 5 1 Accept all strings without two consecutive 1's. 2.At least two 0's and at most one 1's, 3 Each block of five consecutive symbols contain at least two 0's 4 Set of all strings starting with 01 and [W1=3(mod 4) 4.Even number of 1's 2.0¢d number of O's 3.Even number of 0's and even number of 1’s.also show your DFA accepts the string 110101. 4. Odd position is 1 5.00¢ number of 1's and any number of zeros. 4.Length divisible by 2 of 1's 2.Divisible by 3. of 1's 3.Number of O's is divisible by 5 and number of 1 is divisible by 3 4.Contains at least one 1 and an even number of 0's follow the last 1. 5. Starts with 0 has odd length or starts with 1 has even length Start 1.Start and Ending with different symbols Start and end with the same element. 3.Starts with aa 4.starts with aab/abb 5.Start with aa or bb End 4.Ends with ab/bbibablaaa 2ends with a 3.1001 4. Ends with aa or bb 5, ababab 1.aab 2.01. draw transition diagram and corresponding transition table 2.aababb 3.Three consecutive 0's 4a Sab /ba Jab 6baba 7.001 8.1001 9.contains aaorbb 10. 0101 LEFT end: 41.10th symbol from left end is 1 Modulus ‘Alphabet ->0,1 COlwl=2(mod 3) Giw|=3¢moda) (iijjwi=1(mod 5) (iv) Wal=2(mod3) (W)Wa|=1 (mod) (v)Number of Os is divisible by 3. (vi contains odd number of ab DFA for string length a)exactly2 bat most2 _—_cjat least 2 a)Wal-2 eyWal=>2——Woj<=2 Doesn't contains: 1. Doesn't contain 110 2 Wand 111 #Transition Function and extended transition function NFA for string length : ajexactly2 Jat most2 chat least 2 d)accepts all strings if the form o where kis a multiple of 2 or 3. Start: ‘with a 2.with ‘ab’ 3. Start and ends with same symbol Substring/containing 1a 2.ab 3.1010r11 4.0101 5S.aa 6.bbaa 7.can recognize sets of strings: Aabe., abd, acd B.0101,101 011 Caab,be,ca End 1a 2ab 3aab 4.00 Sbab From Right: 41.3rd/2nd symbol is a From Left: 41.2nd symbol is a Start and End +.with same symbol NFAwith fixed number of states -—> start in page no 28 NFATO DFA conversion “NFA to DFA conversion/subset construction algorithm 2 Epsilon NFA to DFA conversion 3,Fin the epsilon closure of each state 3. Ben nuabere. of O'S and 4A. Nomberc of A Is Aivicible by 2. f A ‘ dirs al yt | wee ay oy are 3. The set of shrangs such thaf numbere of O'S is divisbe by Fe ond number of 4s is divisible by 3. 4, contoms ar leon one 4 ignd an even nummbere of O's bolls the last 4. BG ing with different sym. 4. Zedarel stent ond, endi 2 Zedorbh.,, srackiand,.end with same. aymtal Sorts with abb. A. Ends with ab b g. ends with bb ri) vee ie, o } ‘i he ee \ — a db == aby, substring aababb- hye GAO de oe? woe A 3. Three. comecutive O'S i So baba ‘ | a wor z 004 | Ae 6) yet | | 3. 4004 od Ao} —— i | a). © Q eontainy oa oe 1 F S arb ps peo Faber) eo fol Lf! a. sth apr rome Ko mdis 4 Ont. Di toga DA. = Modis + 4. \wl= a\rod3) 5 ZF zd ovr} sz can ba hie o 3 ne ant nuenbert , Wenen=3 2 romain’ jas Arb oi « s vo \ig aaten 9% possible, 0r4eb 2 l= 3(mod 4 | oa Me + [a= Seed | ‘ee | fo Oe {Pn = x sok dh arene: ty which Seti bas. C — , A 4 et ‘| ie +i I of Os is dive & seh oP strings starting [uith OL and (1) 3 (madd) BY lI @ G2 OF Qa OAD % seb of strings containing odd number. of ‘ab 5 Sprite Fel 4 EC (Wla = 4 (mod 25 ve a lo OY - /* ee oN Oa 4, set of sheings ok bamgth 2 > Juif=2 6) Os ag (2-0 Tot », Abe! of. strings ‘of Wie Di yt atleost 2. 3. abot Ae op ae 4, ak of ra of Mar? [two a) Gib 5 sa of — of nee - 3h + df OF - a sng of wl 4 go a GSE sh Af” 4. The language | of all iedogs consisting, of n O's bolloned by in Ais, Weare nz0- h { g, Ds, 0044, 000414, + ‘| a ate at aig OE an yo) nunibert of each! { ¢ 01 10, 10, ond, «+ { yobs wits 3. The att of alll Dar a prumoctie _tahose. value is prame' . COTE chepinieapsey ( No, 11, OL, WIN , a 43 53 W L véakeafortmare 5 4 0i\ orething / obouh 8P Wir nray : We at of oll sireings consist idowed by vn as where N24 4 04,0044. ads, + Yt ng, of OS Gi) 4 fs] 0144} some scaye ents of mi ot 7 valiwed: hy, of Idoap as wrong. * gis. (essily' 9nd) ay aos) ’ it 1 Fy tH { g, 04,044, OF | B i |! ren : Check. tore. SC od) | d LLLOpD Solution « H sire $ (8,9 = 4 i. Ati Sleds | 4 hag [Ext : = S (age e MO 5 rror (y Tee is an. oceupiy gore | nen, this string, wil] be qocnpted.s i i‘ 2 @. Design: DFA te acetph J Laqulw ends in ‘apo } ond | ptzove. hak (4, 0144004) = 44, Sol Soe : 4 "| Ae v6 2 ye ae DIN100) thee 0442004) $ (1010) = $ (404) 241 Slade, ty 8 (ud Pa ; vo flak Gi (41,0) =e ; $ (40) = % $ (4d = 4 tho fino) store, %° string is accepted bs 44 © 6. The att of all strings such that each bbek, of five comecutive Sfmloks contain atleaa}— tno Ors, mer = CSSERLO | gt) 3p / Reavis None. ee 2 260)() { ww contains te substreing- ojo] «e— fore some and ¥ . 2-7 O Nh : A my S be j 6 bay OS G Ree > f Gi) {| every oad postion > is 6 PIR W= Olly aii) Jw[W stares eith 0 and has odd length or starts with + and has even ea er Aq GAC prttinesk feces ee . . 1 fq sie ang. 10. 1 yw doesn}. comeun ‘shes Lew is any string exeept 44 and 444. 2. = The. forema) deseriphin of +ho DFA fs’, (44140 dap, dard}, 64 544, 42s}). Gy “J b —>@) he ae a nr “eC Mf The froma) deseriptiony OF the OFA Is! (444.2214 4a}, ford}, S15 U» 444.44 }) . The rema) dasorighion of “the DFR IS < (deat ae}, dobby tr I The ‘soremal desoriphin oP o OFA is CA 44,442 4a. 44,45), drab, 5, 4,443 })s Where & is given by the following tole, Give He state diagram of this machine, ew d G |) |) ||) \) wm \t 43 th Wilne ok og ye ty ‘ar sist hal Ai: Is Here the stark state is 4 4, Fir) stote is: Adah | sa | Give © DEA fore Z=4O/A} and shringe trathave on Odd number of ats and any number of zos, 0 4 C/o a) Gy eee! ~ a E a Vit ass Try. bollawomg are the stale’ diagrcam oP “two DFAYs,m and My. Answere the. -fallaning _— aleout- + qwse eeschilige aadyat a. Whit ie the slareting cote? Ars Fore Ma! 14 forn My! 14 b, Whod Is re oth oF prov Poem AMY Yor Ma: Aaa *4} e. Whak sequence of stir gh on. inp aobb? Aro fore ML" Arar? PM isn “for mpit Lae, 2 4. coupe alates? ‘states does!) “tht moching "ge As Door ey “odin ecnpt | Sha ting. “gal?” Av, Ma NO My? Yes. 2. Does the macling aceepk the ang <7 “Mi >No! Bruck oPhanf My — Yes serud i 3 == Find the language Lim) fore the DFA me desexcibed_ bg the figure below 4 b QQ? F®) io & f Ki Be Be I An } Asoo comets any string, ended re She * Le, We xXab tore/ one fs pefine alDFA tr asiest he “Vatigsege L=4 wo ends in ababab ) and- preove: -proft » a aa ( 40, aababababat) =p fre Ns’ Dimi whert d p are pho 'starct and; (Fina) stake wp a = 1M t MM $e. cotva boababal) Sled =4 $ (4420) = te 3 (ay) = @ (A * oz) NEA neste lay g) length exactly 2 Ge ab i atrost 2 - eo © Ar leo 2 av gy poo OO ge fe, HE Me of where Kis oO 4) accepts al tre nut of 2ored- ay asa 5 day: 7 Emme } Joh on At aie Bagg oO" 2D 1 Pon, & 5 over 1 A. abe» ald» aoed a mR as, A @ y Oren 101,01 . oll? u VA) oot ° ) aH 1 ab» be, oa Sa~ 0 rr fe ‘ ®) Vhs as 2 ty 7 tema : Z =e ee CONT I te {eriom \ A.PRHS secon syrnco) 1s 0" 2. Pb AHS 3nd syed isto’ Eg Oi >@) ae A. From Us and symnld] is Ov 3G) DO" Stare ond_ene-: 4, ‘game soprabol a Co a (10 ZA (Preaicus” ea —_———_—_———_. 20 wer |x contains at least tuo 0's ore “kath dw sy with si sates. 3 Anette soved bgt Eat dy © The languoge jwee"| Awevet|e eonrains, 0 sty with five states! | ye wo enas with 00)~“9ith,3 stakes. I) i.e W=XOlly (9 Hm Languog? wore some MVS 0 4 =O o~-3 rw @ The lenguge def with one stole, @ Tr language oFstotg with three sabes. f { Fm s m “| (be) The language a (004% with Three stotes. A +92 a Gy Leqwhm contain only Of sith sets > O-@ © O stot with 3 | states 0) ar(cost)™ with 3 shakes 8 o o { 4 7 i ey IS on } Vasa 4 } ‘i 'n So e- closxeo. of (A) (8) © o 4A, BD, GFP {Ber} 1 erry . { 0% FP 46 ap i 4Ft 45 - doswiea of A) 4 A,B,%d F@HP @* AB} Or (ORG ht wy 4 erd, Fem ©: 4&4} wD. APA @ 44} cay APY. O—= fo,a,82) 4} | @) 2} ABS} (2) —> 4st . | ( 7 4e} (Hal tg (y — ABF @-> {EF (D> {Ft () > 444 | ee @—aiAt () > ABER SY () > 1 BC, FG} ® > A>} © > le ray cg iF (6) > {op cH) > AR. (A= fay > 46,0} (<)> 4ey > Pt © +) Bapet Fo AFP pgm Conversion @ L={w]w ends with abl 2+ fete treanstion tole) fore NFAY “(ea\ ea S TT bore DFA a b => Sobsel- construct i) ato aA {4,3} Tay : : : 8 cae Ae ; a aces fo itera eH : = = - si (NFA) ST DFA a b a'|b afer er| ahectet ay |. 49a} | 4a, d5p c= “al diab Peat *itodgh] Ao} | 440-42} *Gl doa |g —_—1+— “|. 2 2 we tolls NFA ta OFA ond inforemally. desecibe. Convert the the longvoge th acces 5 ° 4 —p dea ar} Y | Arosp rp te | dpap | Ath eT ee ca ee a 5-TT force DFA ins p | 44} at patos} | ery | apab | Locnquoge 00 on 4. iE = tot |e ends sith 00 or 04} i rth This language accepts al ctreings Thar ends © a Qik ab 1 trp. >t | {Aah * Fuad | WE | ha heh | fete | ft} fast Mell rt wat ew 40) ati) design & transition diagram bore an NFA accepting. gil sratngs “that end, 14. Conyact (is Nea 0 Oe using, The aieeer eon ral runfenes fail -aq Cos B Psy Le ST-T bore NFAY —- ; >A | {Ay | {aap (By | Act Fe lg : PN 209 31. emstuct the tolling | NPA ‘ino “equivalent DFA subset construeho “olgorei thm: Qe-cosvre tor al) sate : e@-closune (4) = {4,2} e- dos (Y =42h e- dose @) = 43} poe? convent he taljacing NEA to OFA () € ebsum.’ ed) = 4.04849 O= { oF] () = eet @ = (zt () = 42h = 48h Q= 43, &F} «= 44y @ = (= 45/6) uo = Avo} 6 TT bore DFAT" ere ee aa 2 oil petal we oA 245] h2.6,F 8h] 4 SebFP| 437 G Fey A8y 42 45,67} 4s} P ay | oo Ht ae PE g Firat— 4. 40/4, ZUR a gin Toray eon I, Hy value —> 4 38} 9. 4% value Sard closure e-cf 38h= 4B brFeh

You might also like