Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
41 views
50 pages
Toc Notes Amresh Sirs
theory of computation
Uploaded by
kkiru8225
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save toc notes amresh sirs For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
41 views
50 pages
Toc Notes Amresh Sirs
theory of computation
Uploaded by
kkiru8225
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save toc notes amresh sirs For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save toc notes amresh sirs For Later
You are on page 1
/ 50
Search
Fullscreen
4. Tntnoductfon to 4. Set 2 A set fe a’ \collechin of -well-cletined,. unique abjects a ‘ ‘ * AN the elements of a ‘eet should be enclosed. between ‘{? and ‘} y seperated by Commas , Fb Note t- ae : The mame of the’ eek Ic novrhally ifn capgital lettens. Ex :- The sek of positive fntegens gqnedlen -than zeno bub less than and equal to. 25 and. divisible. by ae hax | x Set :- 45, 10,13) 20/25} s- {5,10, 18, 20,25} 2. Power seb it Let ‘a? be the set. The set of all the eubsels of set %A? fs collled “Power set” : 0 eae of A. and is denoted. by “play on ah % Dae fh253} pla) = {tay fey, fat tad, {13}, fa} {02 22}, £64} 2) A= { $)10,15,20,25} \ ‘ om pla) = { {$3 15} feb, st, ree ; {5,25} 11944 10,20}, {10,25}, { 20h, L125}, £5515 {20,28} ,f5 016k, {s,10,204, 11% nh, a 27h, {s,15,254, {3,20,28], {20}, {25}, {su}, f 5,191, 15,20}, @ scanned with OKEN ScannerBg aritstatetn and & is defined as axe = { (ab) | ae ond beBt (a,b) t- -ondened pain i ; of seb A of sek e Hene , a fe an element bi te an. element Ex + Ax farbse} po TL 7 Be fost} Axe = Fcas09Carn Cho} lbs 1), (690), Cot} by, Union Union of .twe sets A and Bis Te as’ ‘follows: : wn A / Ave = Sx | xen on xeB Tt is a collection of elements - bolt in seb 5 as well as set B. Ax={1} B= fede} ma ss a AUG = fouerdet “od 4 siedlec, 5. Fates The ‘Intensechon of two ces fh antl ferou . @ defined as ) AnB = fel LEA axa xenp \ Th iso collection of “commen : clement bc the sete A and Be Fim hi fst £4 a afabs¢} - Laraih. fess pe fed,eh Tore By ane ={c} ' —_d @ scanned with OKEN Scannerf # Lanquages and = Stninags An alphabet fs defined as finite non — wet of + symbols» Ra alphabet is denoted by the symbol és *- fo, 4 The membens of 8S" cane called ‘Symbols’ on € Chanactens’, s = fo, a}: “denoles the eet ‘of alphabets of machine langvoge 2. Powen of an alphabet 2 + The powen of an alphabet Is denoted by ie fo the set of wonds of length er ATSTE dene y ; " E Ex == fe} “thie is null eet in Automata. ve te the eek of length 0 =e fo,a} is the set of length 4 = {00,01, 10 2 is the eet of ‘length 2; s?= ha 001, 010, O11, 100; 101 , aio, til} —® the set of length 3, be Note :- S [The vaniations 1. Kleene Closune set 2. Kleene Plus sek t of powen of an alphabeE ane t s— The Kleene elosune 1s 4. Kleene Closune set fi est’ js defined as follows + _Tepresented os st. sustus uz ++: which js the set of Words of ang length . Each stoung js made up of symbole only from 2. © Scanned with OKEN ScannerPF Ex:- S= fo, 4$ ste Busts Pustuztie'n - {ele v{o4t wf on,o1,taytit u {000,001, o10 01 ee lo, Hey tuh toy se-fe} — set of” Vande of length o =fopr} -> set of words of length + “52. fv0,01 10,17} > otk of words of length 2 ={e,ot, bo, ol, to, ti, 800, 001, wee} coon 7% y hys T ts the set of obnings of o's and 4s of any length . 2. Kleene Plus t= Kleene plus ws a vaniation oF, . Kiem, Closune opencitor” 7 Kleene: plus is denoted Tr ee and ‘defined ub chp Fo wt = stuxus® ust. Which is the sete of * wonds :iof 4 length _ except oll sei: one ie BE St Ex: sie, ayi ste stus*us’u.-. fata [2,1,00,01, 10,11, 900, 004, + wah where , Eek ioe : sts fo, 4}6 o> sect tok Words of length o = {[00, 01, won} —- set of wonds of length 4 " @ scanned with OKEN ScannerSte st-s*e 4 Stonings t A stning is defined as” Finite sequence of mbols from an clphabet ‘57, ¥A__shontest etning is empty oting andi it js denoted by the“ symbole’, t 7 7 ¢ The set of alll pecsinle, stings a oven’ an alphabet ‘5s? is waitten as 3" eer )=S=f+5-> *,/} >z= {o,4} + Funchons of strings Length of a string 2 Length of a ‘stnin f10? fe denoted by ~* lw]? is the numben of sym ols tn w,. -) lel=o'. a \ ar laeea i ee \ * Note = # (wy = 4 ; The length function is defined as’! “tt, (w)’. Tt netunns | the nvmben of tHmes the symbol | ‘a? appears: in the stning fw’. : ve Sienilasly Hy(wy= 4 Hf, (aabb ed) = 2 2. Concattnation + The concatenation of 2 cknings 7 and ‘vy’ is deénoled’ as -% uy?" Tt js the stning obtained by’ wibing all’ the lettens fiom string u? followed by all the lettens of string env @ scanned with OKEN ScannerEx i U = “computer” > | v= ©scrence” Uv= “com pulen science” tov = Jul lu = 8+7 eo levl = is * Replication :— The preeess © ne ia % Ping io? by a specified no. $i? is called reg fh and i denoted by‘ w!? y Ex :- Dw = € Dalt= aaaa 3) b’a* = bbbaa 4% adic? = aaabee - 5S) @b° = aaa oe , ©) ab? =, bb . 7 — 44, Reversal :~ “The ‘srevensal of a stwin a is Tey R7 Wo by 6 wR? is obtained by waiting 7 the: aj string *w? in nevense onden, Ex i- W = Bajdeds vee Any PWR = Anyere Az 424% )Nwee 2 Wr =e ot 2 wa > WRea ad weba > wReab a 4) w=aaabb > Ww : Relations on __Stnings 2 4. Substring :- A stnin 7 fe a subst nin of etnin % C a only iff. stting 6X? , occuns Dorinvovsl s a. pant of 'w?, @ scanned with OKEN Scanner 1: We bhacahab sw aaa bbaabab bob xe ata fe mol ce sebstning of We b. Pro sen substning A string ‘x? ik a Poropen substnig of otning $2? HE storing &X? occurs conbinvovsh as a pont of Sw? — bul xX pw i Ext «x = bba whene, we aabbbba Wo owe aba and we aba then x te nob a prepen _substaing ' Questions i- of 4. List alt the sbbetnings and propen — substoringe given stoning we HELLO” 1 repre Gol": Substring t~ x -ffe, oH, (7, L) SL, 601, *He? SEL? *LL?, Lo’, © HEL’, SELL”, *LLO?, “HELL” SELLo? “HELLO” Propen ebbstning x= fer, He? 0,67 60", HE? EL’, cre €Lo” , SHEL”, SELL’, “LLO’, SHELL’, ‘ewo’} . # Prefix e- A substring tx of a Glming "xy? Te called prefix . The poetic always oceuns, fom. the beginning of a string, ¥Nole NE is a pret of eveny storing « 2) Eveny sting fe a prcfix of itself, Ext- We computer Prefixes ane t- © COMPUTER co e com comr compu comput @ scanned with OKEN Scannerft A substan” Vest Cie SRA gy - "110 gre . eo & Propen phen fie TE and only ia yee! * “a proper pre ee w= comPUTER La oe ' nc COMPUT ° fees ane 7m ome Properr pre co Compute (COM. cotpune comp ’ _ “ compu 7 z : SO of Laing’ \tyxrr 2 Sultie t- A substning far oF a simieg dG a | The suffix always occuns ‘atthe a a. stning. Se ¥NoK I DE fs a ‘suffix of, every stning . a > every sstning ts a; suffix of itself, _ Geri WwW = MYSORE se SORE = Suffixes ane: ‘ ; 1 : é YSOREY OS RE. Mysore ORE vi * ot Propen suffice 1 Ae aabsening > ok a Sting ys a proper suffi TF He, “= Neke DE fe a proper suffice of every string : Ex: We MYSORE Propen suffixes ane i~ € € Re - ORE ee Sore YSoRE vi | @ scanned with OKEN Scannerk Lanqvuage #~ A danquage is a set of sinings oven Fyoitt alphabet oss ad Formally, & IRegqvage “L’ is a sybset of oa - Lés* ex :dA language of stings consishing of equal 0» of zenoes and equal ner! of ones. Then the given alphabet set fon given language te Hl-fe, 01, C011, 1010, O101, 1100, ve} 3 Z-fo4} Ec:-D> A language of starings consisting ob nos of Zeno followed by fn’ now of ones z=1o, 4} L=& = n=0 me Ls fos} e L=foon} L=fooditif n=4u > L= oooollt| > L= ooooolltt| y Language that \contatns . oie ae ful (if consisting of any no. of fa’s and bs, Tk y e Langoage that \ eonbaing Bidas fd oo , : - eya ‘wh of avs and ‘b’s endin he L {ww garter ‘ “ I y= oub) } a. 1 va » Language with empty string Le fet 2 i B vy = 1 w v Fonmal notation _ A. language consisting of a's and bls which do not stat L={we| w (a,b) * 2 ‘Ww’ with b. mefire should not stant with 67} @ scanned with OKEN Scanner5. Lan guage that contains storin of a's and b’s where all a’s prerceed bs * Note t- Camdinality of language fre. the no. of membens of a Seb tsi called Carding, Ex lef} 9 [bl-o0 Lede} D> tele st L=faa,ab, cd} — ? Lengih of language is leg % Applications — of theony of computation em i 1 Tk is used to design languages enabling machine 40 machine communication and} “man to machine communication, Esc i Netwonle communication protocels ' 2. Tk fe used design and, implement compiléns for medenn programming languages, 3. Used to design vending machine and tn” building seevnity devices, , a y, PNA. molecules can be analized. with . the help of * Finike state machines and contact - free grammars A Heinanchy oF language classes “Tyres oF languages -—> 4..Regulan language ee 2-Context free language’, Fs 3. Decidable “langue Ls yu. Semi decidable language @ scanned with OKEN Scanner¥ Requlan language Fs ceceepled by Finite stake machine (FSM). H Context free language is accepled by *Push down Automat ( PPA) + Decidable language is _accepled. by © Toning Machines”, + Semi— decidable language is also accepted by “Toning machines”. (1M), 4, Requlan language im “They ane accepktd 6 clunts from ‘Stant’ stale, and accepts one chanactes at a time and changes the tute biased’ on curmert the state and wenent z/p sysmbol,. alten scanning i& the machine fs in ‘Final? state , then athe etning is cxccepled by the machine. Otherwise, the string ic srejected by machine. —The langdge accepted by Fsm is called ‘Regular Fom. TE entine string , language”. 2.Conkxt fnee Langu‘ Je s- They Ee:- For non negulan languages , of balanced panenthesis on language consistin followed by fn? now of b’s . Ht is mot possible to esm. in such situations, we add “Stack” to some sgembels ane accepted by PDA, such ag ithe language ab ‘n? Re of a’s constrvet the FSM 60 that UE ie can pememben by pushing on +o the stuck. he sm with stack iS called PDA, The PDA's ane vsed to accept only the non-regular languages such as ‘Context-Free’ languages. > 3. Decidable language t~ For non context free languages Such as a%b%c?, ik is not possible to construct PPA. Ip such situations, We go fon * Toning machines, —STretna machines can coeeret abl the tupes’ oF languages @ scanned with OKEN Scannerincding sregulan language and © context Thee fangveges N at Note = j The dlecidable languages ame decided by the p ts. Toning machine . that culeays hal tr Semis decidable languages ir “They ane semi—deudej seme fuming machines “that halt on all the cu. & in in the language * Finite State Machine (sm) i iN TE is also called as ‘Finite Avtomation”, is a Computin device which accepls & shning as - TIP and produces the o/P ac ‘Accept on Reject, Automation is a gneck word and ft means a ( Avlomata is a machine Which vice, i machine. a string oc Te and predures Ihe legical diagram + \“olp as “Aecept? on a) v Trp Outpht Accept] Reject © Control oni (Fm) 4. Input s- The string to be pricessed is stoned in inputs 2. Control unit JE consists of anumben of states. 7 states ane identiied by 4e2 44 upto qo stale. 2 Tathally , the machine will _be in stamt state “4° @ scanned with OKEN Scannerand the machine will Rave atllease one nna stale. Based on coment 2/P symbol and. cummnent stale of machine, t may cheinge ib stale. a oviput i When thé end of the ale is encovunlened and. Gf the machine is tn final state, then the Z/P storin te accepted 4 the frachine 1BuE tohen end of the I/p is encounttned and T6 the machine ts net in Arnal stale, __ then_the HF string is nejectecl by “the machine, > Slant shake] (A cinde wilh an annew whic fs nok oniginahin from eany Glale sepresenls ‘Start stale (2 etneles ane used to represent Final shale. Heme Yt is final stale) An annow with label 4 ares fiom skate 942 to stale 44. his fndi'cates that thene ise transition From state qo ap symbol 4 to state 94 CY’ § (4. 441 ) ® / @ scanned with OKEN ScannerA “Types of Automate t AN (pray (08) prspy Peotte — Aotanretet Ae Deterrrtovont De Nene Delermiarstc Froite Aelemalee (NAD teith e = adam tn > i component — cleseaibed 4 : y By Neo a Deleminatic Pintle Aete ry valor (© -wen) \ irorf picsroningeht Eve ctuppls name of the machine se} of skates foile non~ empty a toransibin Fonction mepmeseated a. §(AX SISA Joh finite sek of ingot ctpbas Se nen ~ empty v fe the stent stale, ree a set of accepting on fintle d ( S(qese°—> Yo S(qed— Va S(% 59> aL Sq Vt ) = ={oa} 4) Te * Vo JF se VL Be @ scanned with OKEN ScannerTwo ways of fepnesenting DFA 3 1, Stake transitven chiagham 5. Stale teransition table.” Exe = +.” 5 accept string stoings o4(0,4)* 000 1(0))* 4 ol 010 > Sauk transition table :- ° 2 sbnt [=p la. | a, Final | 44 [4% | Ue s Gate trans'hon d Viagem (ques piftenence bla stale transibion diagram and table) Question == 1. Design DFA which accepls card Q- 14424 (2 stakes) 3 x-ta} 2) 8(@x Dre 4) q, i % 5) e e- 44 a ; odd -numben of avs § (4,04 $44,942 Stant gr ©& j ; Acceptuble _ stninys Rejected stnings an @ scanned with OKEN Scanneri 11 D-—Gensiden an cuceptable string J I a Analysis : § daakadaa DSCq.,0 = 4, D8, > 4a, D8 (40, a) ty D840 > 4, 2 $42) > ay 9 $4,509 > Le ” §0q0,.0) > oy Afles: scanning the stale “qa? + Hence this string is accepted, entine stning, we Ahe ak fino by DFA. 2) Rronsiden the string aaa ) $4,041 2) § (41,0 Ve a) §(4)a) > 44 4) §(41, D> Vo the entne sting » since we the nol Aften scannin the Final stale “Ya? , this string not accep by DFA. “The vanious types of Problems to constyuck a DFA we D Pattenn recognition problems 2 Divisible by ok problems 3) String lengih med ‘k” problems [lw mod k] 4) String length med. ‘k? with Nelatvonal openatons (lw) mod k with selabonal operatons ] 2) N,lw) mod k J Nw) mod ke @ Scanned with OKEN Scanner9 N,fe2 mek S toh Ngee Opematons * Pattern Recognition Problems s— ». Gonstruck PFA to accept string Consisting of atleast one &- got: Za tat Acceptable stooings Rejected stnings a b an Oa ALLA aat* ) Consider Saad S(qe, aaa) H@1,a2) a “2G @ ES (4,0) & £8(q,6) M=-{4,2, 8.494} qu ic the nal stale and we have scanned all the alphabets Venificab'on ?- &— {40,44} 5 2 shales in the given sbring « T=fey md Tn Go (Stank state) “. oThis string is accepted qe Yt (oat state) by the. machine , os- La xEpee Stake transition table i =o te *4 | 44 Pow 2.—Gonstnuck @ DEA bw accept strings oF as and b’s Wilh atleast one a, @ scanned with OKEN ScannerSol": S= fa,b} NN Acceptable stn ings Rejected strings = b bab bb aah bbb bba. ahh bbbb aby bot The strings of as and be with ateast one w can be stated ag :- D String consisting — of any no. of b's denoted by be followed by one ay PH followed by any noe of a’s and b’s nepnesented. as“ (a4b)* ‘ b¥a (axb)* m={8, 2-89 % ve} tc = L444} 2.36 La,b} 3, S(axzZq 4. in de (Stunt skate) 5. 42-44 Final state) Grake +nunsition table :- a |b > | 44 | do 4 | | 1 @ scanned with OKEN ScannerConsider S(qo 7 abb) cz) $e bb )—= oy S Gab) 4 qy is the final stale and we have scanned all the alphabets fn the given sthing. ge Given elming 7 abb’ is accepted by the machine onsiden » S(%,bbb) > Yo ae ) S (4o;bb) > Te $(4eb) > Io YW not the final state and we have scanned all the alphabets in the given stning. ene : “. Given string, bbb’ Is nejected by the mathine, 3. Construct PFA to accept strings of a's and bs having exactl one a. Slt = Lab} Acceptable strings Rejected. stings ba aa* bba bta*b* bra beak abt aotb* btab* @ scanned with OKEN Scannerm= {82,554 46} i BEN ge} 4 = {40,%> ta} =) 3 shales 22D = {a,b} aS (axz)sQ = VE qe (Stunt state) 5.44, (final state) Stak transition tuble x | a |b Venifation t- i) -Gonsiden $(4,bba)—> 4, G40, ba) > Yo $ (4.9 > %q q, © the final state and we have scanned all te alphabets in the given ctning. os Given string “bha’? is accepted by the machine. | 3D) Bensiden (4p, bhaab)—> /q, & (qo, baak)—> 4, 5 (yp, aah) y S414) > Ye S42, 6) > Io q2 ret the final tate and we have scanned all * alphabets in the given string . “+ Given string is inejectecl by the machine. @ scanned with OKEN Scannerae Dy Gonstnut a DFA to oecept sens or AS ANE OS gtanting with the sotning ab. x= fab} gol” Acceptable isthing Rejected storing ab atb* aah , ba ab aatbt ,a,b abak, abt, ablo~ 4 1 (axz)>a 3. 4. Yor Stant, state 5. 9, Ie (final state) a,b Stake tnansition table ! al 40 || 4, - Verification te 1 || ta Decnsiden € (qo, ababb) 44 4%: | %| te , $ (4a, babbO— 4 Slaz, abbh) > 4, 4, | 4s] ; $ (92, 6) > da is the final choke and we have § (4256) > qo scanned all the alphabets in the given Storing . ot Given stming , Fababb? js cecepled by the . "machine . 3 Coensiden’ S(4e, 44> gy $ (44,06) > 45 i (43,6) > Vs qe ® mots x -Final state and we. we have scanned all the alphabets jn the given stwing- 2, Griven sting » aah’ se accepled by the machine. @ scanned with OKEN Scanner2, —ons| 2 med a Dra to accept stnings of a's ON ending with sting ‘ab’ “ Sol” 3 Accepted. strings Rejected strings otab athth , rb b¥ab aat ath ah beF ob abba , brat M=18,=,8, %, qe} 1 a= Dx} {41> a} Venification ) Ceonsiden the eau 2. D= {a,b} 3.55 (Ax d)-3Q “each & (40, 4a0b)> 4, &q, 8 . i Yo fant state. S44, cab) = Uw Cay, 4b) > Ue 5. Ve Ve (final state) | $l4,6 = 45 State_tnansition table = - ane q. ® the’ final state and we => have scanned all the alpholt ie || in given “shorlag «t+ Griven 41 | %4) 4, String accepked by ¥ machine . te | VU} te J Bonsilen, abba § (qo, abba) > U1 lta, bba) > % final skate and we ¢(q,,ba) > have scanned all the alphabets in $ (qe, 9> 4 given shai aoe iven tr re ie 4 ing + 2+ Griven sting fe mefeated by “the machine qs fe not tthe “ @ scanned with OKEN Scanner6. —keonsthuct a PFA aw accept suing of = a’s and DS nok ending with the shning “ab” J Aad also show the Sequence of moves made by DFA fon the string ) “abaaba” “abab” Negate the nevious diagsam. Inox Final el 9 athe <> Rial stale Final stat —> non final stale b m={4, 2,5 44} 3. @2 Lae trte} 2, D=fab} . ? 3. §2- (Ax2)-@ - 4. de s—stant shite 5, Je ta (Foal stale) onsiden , (Ye, abaaba) b (41, baaba) (q1,bacba) + (42, aaba) (42, 2eba) b (41, aba) (41, aba) F (4q1,ba) (qiyba) F (42,0 (42,9 & Ge) 4 ss; the final stale and we have scanned gil the alphabetz fn the given stning *. Gaiven string , fabaaha’ fs accepted by the machine. @ scanned with OKEN Scanner» Cte, abab) > 4y C44, bab) 4p (4,00 > ; (41,5) 4 and we hove scannecl a | GT. 1s not the Final slate at pha bes jn the given shoving : Thenefone, the” given sting is rejected by this machine. i 4 Gonstnuct a DFA fe accept sbvinge Foe and py, oe @) having & substring “aah” a,b Sol” :- 7 . m=46, 25) de, 44} Aco Rage Q= {40,41 %2,%} (4 states)! -Stnings Sar ataab ooh ft = a ‘ aXaabb¥ (ab)* €: (axz Pag we a 4. — stant state ae rd i abb* qe 4s (Final stale) a[b Gute transition table 2 [Soa la, Ta | % | Io 1, | % | 4a #4 @ scanned with OKEN ScannerVembicano is a3 scanned all the alphabets in the given stain VY Xfonsidts = abaabb S(to,abaabb)>ay (44, baobb) > 4 (4. , aabb) > $ (44 ,abb) > 4 &(a,, bb) > 45 §(4s,b) > 4, the Final stale and we have g.Given string is accepted by this machine 12) -Gonsiden “ ababa | | §(42,ababa)> 14 Sl 42, baba 4s (ae, aba) > ay $ las, ba) > 9, 8449 > the Final stele scanned is not 4a and we have all the alphabets in the given staing. seGiven ctning is nejected \ the machine. fg. Genstnuct DEA te accept strings of we and be nok owe a substring “gab” b Sol" 2 mM 2,2 3.82 b =18, 28,4 de} 4, Q=14%0, V4, 42, Ua} = {a,b} — (Axz)>e kL, Yo t- Stant state 5-4e= {40544424 stant Final states State afb transition |p 40 | %4 | Vo diagram s-| Uy, '| Ia | To *4, | Ge! Is Vs | 2| @ scanned with OKEN Scanner+ “ababb | 2) MAYES 1) ida §( qe, ababk) > wn een aaah S $(ae, acaabb)—s, q 8 (44 ,babb)> qo (aa ,ctbh)s . S(q0,tbb) > qy 1 (qa pabb—> q S(qa, bb) 4, |S (ae bb) gy Slqe,b)> Fo S(aa b> 4, Ge is the Boal state ancl we have | Is is net the fina) scanned all the alphabets ih the ff and we have scanned given string. the alphabets in it. veGriven string is accepled by the Shing - +. Griven steing 15 ge machine: a d fey by the machine, a.—€sonstruct a DFA to accept strings of as and 2. ending with “ab” on “ba” Sol" s— b Aecepted Rejected m= {42,8 40, de} sstnings stings 1, @={4%e, 41, 42, 43,44} aaabaab aaababb s-fabt aabababa | babaablb 2. = J (axe) atbtab ot a 7 3.8: a oh ba ra 4. Yo i Stent stale a avin 5: 4p fede} final be Ap state. @ scanned with OKEN ScannerState transitien table :- Verification ) Gronsiders § (4, aactbaak) 4 2) Coonsiden SCaahakaba) 6 (44, cabaab) 44 EC cvetbeua ba $C aq, aback) = 4 §(qe,aahababad)—> 4 $(q,, baab) > 42 S (qa, abababa) = 44 S(a2, cab) > 9, 6 (44, bababa)— 9, Say, ah) = ay S(a2,ababa) > 4, . $(44,5 > 4, Slay, baba) > 4, q, is the Fal state and wee have S (a2 aba) > 4, ecanned all the alphabets in the $ lay b> 4 5 $(%2,9° 4 giver string. J. Given stoiog ie Jy © the final state and we have $f scanned alll the alphabets to the given toring. ¢- Giver aed is accepted by machine . auceptd by the machine. 2) Gensiden (qe, aaababh) 4s 2) ~Grensiden 8(qo, babaahbb)> 2, 6G, aababb)—> da § (45, ebaabbb) > 4, " § (4a, ababb) > 44 § (ay, baabbb) > Is 6 (44, babb) > Is S [42 aabbb)> Ty $ (42, abb) > VY § (ay, bbb) > Va $ (tn, bb) >= 4% 6 (a2, b> De $ (42,5 4 § (42, bby > Fs ° 6 (4s, > 4 qe is not the final state and we ay 3 : is. ' have scanned all the alphabets in qs is nok athe final state and the given stor Pec en | eens oelaees nore cs calphebst given ateing« fs Given oe I iven String | tne given stning- (2, Griven is rejected by the mache. String & rejected by the maching @ scanned with OKEN ScannerPr \ to. —Gonstrwet a pra accept strings of ov having 3 consegetive =e Sol :- M ~ 14,5, 8,4, Ve} string ty A= f 40,41, 42,43} 111000 2. + {0,1} lolol! looo 8: a(S @xz)36 4 otooos* 4. do —> Stant state ° 5. d¢ 2 43. (final state) A(eoo)* to = . . 410004 (40)* + Stale daansiticn table 2 4100 Oo 1 2 Fel as | te : | % |] 6 2 | 4s | #4) % | % Venification :— )Gensiden \§ (142000) Lifer (qe, 111000)> YW $( qe, 11000) Jo § (40, 1000) > 4, § (de, 00°) > 44 $(41,°0) > 08 (42,9) > 4 ds b the inal slate ond we have seanned all the ath aiven — chelae La a Scanned om OKEN Scanner> &onsider 1O1o1lo § (de) 1o1elD)— Ye § (Ye, O10Ne) => A S$ (4, 10110) > Vo 6 (40,019 > Ma 5 (44,110) > §(%,19) > § (40,0) > VL qs is not the fraal state and we alphabets in the given string . E. Given string is oefecked “ty the machine have scanned all the 11, Gonstruct a DEA to accept strings of 0's and Is having no 3 conse qutive Zenoes , me BONN bet 4 ted stenir Rejected m={a, 2,8) 49, Wh Recepled Songs | A mings 1 &=140, 44, %, teh 0 11 1000 2. L= {0,1} 4 Lololltooo a. $+ xz) > a 0*o001* 4 Gey H 4p 2 start stake oa* 1#(000)* © Ueto 1d, 14, 42} Final + ot , nn ales. ot"o 4140004 sox o |hi 00410 > ‘10)* transition Fle |u] te (40) - + | eq, fa] 4400 table 40 FH]! 10 10n0 1, | ta] ds i @ scanned with OKEN ScannerVenification 2 1) Gonsiden “tor01to7| 2) Gonsiden “44.NX § (qe, 1010110) 4, | §(4o7 119904), Q & (4, e101 4, 5 (4607 10004).5 , S (44,101 4. (qo, 0004) > 4 & (40, 2110) 4 $44, 0°) 3 b §(44,NO> Ve (4,19 4 & (40,0) > 4s qs ie the Final stale and we have $C, > 4, $4, > 4, W is not the Fira oh, and we have scanned 4 scanned all the alphabels in the ! the alphabets In the given string « iven thing. Ss Given dering Is accepted by the |. Given etning ts hay machine . by the machine, / to, Gonstruct a DFA fo accept stings of as and i having ot mene than 3 as. ( rato) <3) {rats wel, Gol: b 6 m= fa, zo, 4, % } Trap. shat 1.6 = £40, % 42,43, 4uf (5 states) 2. B= fab} Accepted Rejected striys 3, $2 (4% 238 —stnings buoan b 4, Ye i stant state ba! bacaat = 1 te, Ya, V2 " 5S. qe = [tet %erte} Final baa aad bapa? facthsttts baa Fle | 44} 40 abe State *U | 42/1 aal transitien | 44, | 42 | Vo table :- | *4%2 | 44] 4] Su | dul ta) @ scanned with OKEN Scanneriden = Daag Veniticakion + wo S(te, baad te | §(4e,ho09) > ae | (qe,eaaa)-> 4, § (44, 200) 4, —kronsiden = baaad 5 (41,29 > 1 64») Is is the final stale and we $(42,av > I S497 qa is cot the final state 4 pave scanned all the off alphabels string. i d all accepted and we have scanned 4 in the given a Given sthin is the alphabets in “the given stwing. Given stning ts by the machine by the machine. 13. Gonstnuct a PFA to accept stnings of as and be having exactly 3 as, 4 Sol" ’ 2 “ “Tap shale M={@,=,S,4%0, de} : Retected ec te = £42, U1, Va Vs, tH} Avcsplatie alate _ (5 stales) stoings ser 2. Z= {a,b} + ac Cae 3. § 2 (AxE)>@ : : baadab qo —> Stank state : a . ab 5. 4¢ 1-4 (Final _stale) ge ee a |b b* State Yo} V4 | to Lb kK tnan sition | 92) eee table :- de | Ia] Te *43 | dy] Ia qu Gul Te @ scanned with OKEN ScannerConsiden “baaab | 2-4OM daag Sl qo, baaaays 6 Veniftcahon :- §(%e,baaas) > Yo Sac) 22> 4) 6 (qe) aaah) > 44 6 (44,04) > 4, S(qy,a0b) > 4, § (92740) > te §(%,ab) > 45 $ (42,0 > ty Sas, > 4s qu te the Final stake and | dy Be net The tin we have scannec all the state and we have alphabets in the given sty cane all the alpheb . . Given stony is accepted in the geen staring. : by the machine Given, sting Be nies y : by the machine, ju. —Gronstnuct a DFA to accept shrings oF as and Bs consequtive chanackens ane same, uth that no two Sol + Rejected strings Accepted ‘strings ab : oa ~ bb a M= 14,256 Wott 4. Q~ [5% t,t} ' = b 2. S= {a,b} ae a @ scanned with OKEN Scanner-— LAX 2)%R - Stant state 4. Yo 5.4 {41,22} Goal states) Gok trarsiben [q, a | table s- ¥u|a.] 4 “4,1 4/4 43 | Val Vs Yenificablon — ) Gensiden fababa’ S(qe, ababa) > 94 5 (42, baba) > 4, 6 (42, ob) > Yy ee F $ (43,9? Vs a. ic the Final stale and 1 7 have scanned all the a\phabet= in the given string. 2. Given string 1s accepted by the machine . 2) Goonsiden ‘acbabaa’ § (qr > actbabaa) > 4, § (44 ababan)— 4, § (q3 , babaa) de § (43 ,ebaad > 4, $ l4s,bad—> 4, & (43,2) > 4 § (43,9 >% 9, is nok the final and we have the alphabets in the given state scanned all thing « w. Given string is rejected by the machine. Aid @ scanned with OKEN Scannermer OM NS Roonstauct acs, BRA,,.48 recepl SIRINIS of oN zeno , followed and 2% beginning wilh a eat of 4’s and ending with 2, ‘ SIPs 4a q Trop state 0,452 Accepted ‘ Ju © m={f4,2,5,45,4} renee Fy . Me a DQ ~ fae 42,42,45,44} (s shales) 041442 oot, 2) Z~ {o,s, 2} 0111212 4 ‘ty I = (ars) 1 9 4 2 slant state 9 4% Y2 Cfinal state) < ~~ Stake transition oo gieteg table 2 yb Ut da ty tay dn Vy 42 ay we 4; *4s 4, Ty Uy Ty dy de ty Venificaton :- @ scanned with OKEN Scanner16. Vaonstruck a PFA to caceept alnings of a% and We 2 with — ettmest consequivue b's, Gol? =~ Trop slole Acceplecl strings Rejected slings at athbb ae a*bbb* a M-fa=% wet Stale Hanan tole a da- £40, 41, 12,43} 4 wy dy EH Lab} 4% haan *4, Ge Dg, t-stant shaft stale 4, ne de da (Heal state). ven . @ scanned with OKEN Scanner17, Renstruet a pra to, accept aT aN stunting with atleast 9 zenoes 47 2 ones. Sols stant Ss Rejected m= {a,2, 5,46 Jet Accepted dos strings fas a= 140,01) 92, 99,9} ' nA oootaa4 2) == {0,4} nations _ 3S x28 “e O41. . ) de i Stant state el o* ito 5) 4 t- V4 (fina) state) ° 4 Stale transition 39, 4, - Is aable i W 4 Ys h b&b ts 42 Wy 4a a, Ty 1s ds Ye a @ scanned with OKEN Scannerig. “onstruct a DFA to accept a language Lagwsnieles ae = 2} ol M ee S40, 4h Aceeptol Refced : en Ve, t3) Uy dee strings Der (ax DPR eit b ok 1) qo t= stant stale abb 3% 2-45 (Final state) Tova stele ayb @ scanned with OKEN ScannerVY. 8onstnuct a = prA to accept the language L suk 88 Litfw:w has odd number of 2f 1s followed 4 even numbeer of zenoes. } 1 Sole Accepled strings —-Rerected —stsrings r f 7 9 7-400 11000 4.4100(00)* stant @ scanned with OKEN Scannerble 4 Kk problems - the steps te be followed fs :- ) rtentity the madi, a/p alphabet and dividon *?, 5) Compote the possible sremaindens. These hemaindens mépre _sent the states of the Dea. a Find the transitions of The fonm S(qi,a)-qr whene je (nie d) hfe 2) —Gonstruck the DFA using transitions oblained in step 3, Ja (nied) 2k Ro nadix Fon binany 5 2=2 Ti+ emaindesr “obtuined aften dividing by k dsm digits JK Fon binary , d= fo,4} 1. Gonstnuc a DFA to accept strings of 0% and Is whene the valve of each string ts snepnesented as a binang numben . Only the strings pepnesenting Oo%S should be accepted . 3elP2- Step 4 m=? d=f{o,4} k=s Step 2 i Remaindens # 0,19 2730 Compre the transitions SLO ty whene j= (fitd) med k qc (ai td) mod § Step 8 Step 4:- “Table —— @ scanned with OKEN Scannercs (2xi+d) motl 5 nemainden 6 (2¥*0+0) mod 5 =0 oO 4 (2* D+1) mod Sos ° (24140) mod 5 = 2 4 4 (28141) mod 5 = 3 oO (2¥ 240) med 5 = y 2 4 (28241) mod 5 = 9 3 ° (2*340) mod 5 = 4 1 (2*3+1) mod 5 = 5 ie 0 | (2440) med 5 = 2 oh (2441) mod B= & Yo Slay 1 Vy Sle), Ye $4), 43 SQ4)s, U $(r2,04, Ye © Cat)s5, a S (4,94, V2 SGp)s5, Ta S(Hds9, VY 54,39, 2,-Gonetnuck a divisible by 3. ve Gols d-{o,%23 2H DOL g,ap k=3 possible nemaindens = 0,1,2 n=10 DEN’ te accept decimal strsings (2%) @ scanned with OKEN ScanneroS — Case-3 String length mod problems Skep 1 i Find the memaindens obtained by Aig i; String length by k. Step 2 b Tdentify the transihions 66a, 0 = (1 om) FT mepmesents —hemaindy, with the fells nielation whene k i divison and. ypte 0,452 dividing it by k Skp 3 2 Talentity stant state and final state, upto k=! obtained tien, Ex: Construct a DFA to accept strings of even numben of a’s, “t t= fw: wa] med 2~0} veshions :~ ) Construct a DFA to accept languag to? nagion in fw? is of even length,” Sol": — Arecephable strings Rejected strings . : bab ep Le [wefa,b} jeven bach bo baaaabb Eaneb bb aa bbabbb 7 baaab eo edd no. of a’s then make YW i Try sal staf M=442,5) 4,4} ~ a as tm D A= 14)%,42} se Le Te] Dz={aby drensition | 2 te | U4] Yo 1ansibon D6 :(QxzZ)>& meas table =} 44) de) te 4) Gp t~ stant stake hla) & 3) Ue 2 Io Cftnal state) @ scanned with OKEN Scanner- of as. | Co L = fw st [Wal mod > = a} with qo os otal stele and qo as Final state gi 6 (4a) = ee mod) whene ke2 and t=o,1 i 89,2) = 4 (Cie) med 2) 0 S(4e,a) = 4 (ort mod 2) = % 4 $(44,0) = 7 (441 mod 2)= 9, stan ) Gonstmuct a PEA to accept language’, =u slo mod 3=0f whene > -{a} D Benstevet a DFA to accept. language, p-fuy Malin) eed so} whene = =-fa,b} Li } Construct a DEA to accept language , Lefivs li] med S4¢ wheve zeta Case- 5 + Numbeti of specified symbols , mod. kk problems Step-1 t- Find ‘the “emaindens obtained by divreling the nes of specttied symbole by ki. Sep-2 :— ilenhfy the transitions 2A TRe transitions can be obtained. by using ‘the Following nelattfon 3~ S (47, = 4 (itr med kD Whene ki-divieon and 1 nepnesents remainders o,1,2 uplo k-1. @ scanned with OKEN ScannerAPE TEN Sart y L 1. Gonstreck pen fo accept language such that L={Nalec) med 5 04 (cine tty Gol: kes (a 1=0,1,2, 3,4 1] Sard
@ te @ scanned with OKEN Scanner5) Yet (A080) Final stale oS Nole p=) The DFR fe accept even 1% of ve cal —* . A no. o& bs can be chloined by making 0B) cI mp coleman The pen to accept ode nov of ate and Odd ne, Bs can be cblained by making (A381) Hee Final state. 3) DFA th accept cdd no. of ars and Bs can be obtained by making (41,8) a5 the fica) state. even no. of “What ane the dieadvantages of pra 7 ) Constewetion of DEA is diffrwlk when compared. to NFA, @ scanned with OKEN ScannerVeltrministic Finite Automata (NFA) 2~ A non dekmminitte finite cwhomata consisting oF (states, alphabets , transitions, stettt state, Final sais + Nea 5 tuples Me (4,2,8,4F)- whene, G@ #- Non creply Finite sel of tales ~ nor emp! Finite ack of IP alphabets based on the comment sete ancl zr ste machine ean enter inte ene om mere slotes q, #7 stant stoic F spon ernply set symbol J of fina( states . 7 , . 1. Construct NEA to accept strings of ae and b’s ending with fab’, ab Sel s— 8-140, V2 ta} e| x-fabt e q, i- stent olale = 4, |{te443] 0 9, fina) state au b on 6(oxz)>2* xq, |? > D) (4, aoab) - (fee44}, aab) Fr (f42,433, 46) F (L4e,%4} sb) {ae th, @ Yo is the final state an ; alphabets in given stming « wT is accepted we have Scanned gl! the @ scanned with OKEN ScannerFg dD 09.5 8a (Mer i | F (faap” *R Fb (£11759) ccecept language L such that om aba} 1 H3a.-Gonskwet NFA to recognise Cllowing key wonds a ? abe, abd, and aacd. a)Ceonstruct NEA to necognize 01 , 11 and Otol. @ scanned with OKEN ScannerNFA te such that uth accept s symbel fecm Sright + Gonvension of NFA to’ DFA im ) Lazy method 2d Subset method t. Lazy method :- Skp- tio Telentify the stant state qo. Skep-2 > Tdentity alphabet set = Step-3 = Sp(Ttaj- cache = Sw (4.0 Y Sw (apa)u--- UB CV) = 441 54m geo tnt ¥Add the stale to @, Cie. stake set ch DFA) _-éonveat the ellowing NFA into Ths equivelent fee G5 earth) —= awit s] 2 [Fh] Slep 1 qe is the stank ctate Ls q, | £4,413] 40 PFA. Step 2 3 s- fab} uy | ap | *4| ¢ | @ scanned with OKEN ScannerStep -3 © Fon state qe x Topol =b Trpok - 2 . q g 4e,b}) = Sa 4 +) S(fanah)- 14% ss (i ) te) Fon state 49e,44} E Thr - « Het § (tanta) = Sy {tee} Y Sy bbe = 49045 ub = $04 are = 4b 8, (faearg jb) = Syfteby o SEtnb} & * 4e" Is = £40,429 Fon stoke fae ta} Trea eT Sse ae} d= Sydteoste Sytdaa} 5 (aon s)-5, fone ~ fiend? aT ~ Teta lt} Stale transition a 5 : joble fon DFA :- Av They Ste tiy {vey eq} {det} [fae 42f cr ttt} [Lt a} ive} @ scanned with OKEN Scanner@ scanned with OKEN Scanner
You might also like
Unit-1 - 2 - 3 Notes
PDF
No ratings yet
Unit-1 - 2 - 3 Notes
46 pages
Kali Puja - Swami Satyananda Saraswati
PDF
No ratings yet
Kali Puja - Swami Satyananda Saraswati
264 pages
Automata and Formal Languages Cheatsheet
PDF
No ratings yet
Automata and Formal Languages Cheatsheet
5 pages
TOC 166 Notes by Quantum City AIR 107, GATE CS 2024, Shreyas Rathod
PDF
No ratings yet
TOC 166 Notes by Quantum City AIR 107, GATE CS 2024, Shreyas Rathod
75 pages
21CS51 ATCD MODULE 1 DFA-NFA-Conversion-Minimization
PDF
No ratings yet
21CS51 ATCD MODULE 1 DFA-NFA-Conversion-Minimization
136 pages
Flat Notes
PDF
No ratings yet
Flat Notes
111 pages
Automata
PDF
No ratings yet
Automata
47 pages
Toc - Unit 1
PDF
No ratings yet
Toc - Unit 1
57 pages
Flat Notes
PDF
No ratings yet
Flat Notes
110 pages
Languages Strings
PDF
No ratings yet
Languages Strings
53 pages
18CS54 - ATCI - MODULE 1 - FSMs
PDF
No ratings yet
18CS54 - ATCI - MODULE 1 - FSMs
43 pages
Regular Languages and Finite Automata: Lecture Notes On
PDF
No ratings yet
Regular Languages and Finite Automata: Lecture Notes On
56 pages
FLAT Unit 1 LM
PDF
No ratings yet
FLAT Unit 1 LM
10 pages
18CS54 - Atci - Module 1
PDF
No ratings yet
18CS54 - Atci - Module 1
23 pages
Theory of Computation PDF
PDF
No ratings yet
Theory of Computation PDF
162 pages
ACD
PDF
No ratings yet
ACD
61 pages
DLC CSC 351 Course Material-2020-Ayorinde
PDF
No ratings yet
DLC CSC 351 Course Material-2020-Ayorinde
90 pages
FLAT Notes
PDF
No ratings yet
FLAT Notes
116 pages
Notes 250112 173439
PDF
No ratings yet
Notes 250112 173439
29 pages
BCS503 Module 1 Written
PDF
No ratings yet
BCS503 Module 1 Written
30 pages
Lectur Notes TOC
PDF
No ratings yet
Lectur Notes TOC
116 pages
Flat Notes
PDF
No ratings yet
Flat Notes
111 pages
Flat Notes
PDF
No ratings yet
Flat Notes
111 pages
tcs1 Slides 10 20 30
PDF
No ratings yet
tcs1 Slides 10 20 30
84 pages
Unit 1
PDF
No ratings yet
Unit 1
12 pages
ACD
PDF
No ratings yet
ACD
68 pages
TOC Notes by Yashashvi and Shravani
PDF
No ratings yet
TOC Notes by Yashashvi and Shravani
26 pages
Flat Notes
PDF
No ratings yet
Flat Notes
110 pages
Flat Notes
PDF
No ratings yet
Flat Notes
207 pages
Tafl Unit 1 Notes
PDF
No ratings yet
Tafl Unit 1 Notes
44 pages
FLAT Complete Notes
PDF
No ratings yet
FLAT Complete Notes
110 pages
Flat Notes 2
PDF
No ratings yet
Flat Notes 2
110 pages
Flat Unit-1
PDF
No ratings yet
Flat Unit-1
59 pages
FLAT
PDF
No ratings yet
FLAT
85 pages
Unit V
PDF
No ratings yet
Unit V
30 pages
Flat Notes
PDF
No ratings yet
Flat Notes
314 pages
01 Toc
PDF
No ratings yet
01 Toc
31 pages
Tafl-1st and 2ND Unit
PDF
No ratings yet
Tafl-1st and 2ND Unit
132 pages
Unit1 New1
PDF
No ratings yet
Unit1 New1
75 pages
TOC Lec1
PDF
No ratings yet
TOC Lec1
39 pages
Flat 1
PDF
No ratings yet
Flat 1
31 pages
202003242118235722pankaj Kumar TOC-1
PDF
No ratings yet
202003242118235722pankaj Kumar TOC-1
38 pages
Unit 1
PDF
No ratings yet
Unit 1
32 pages
ACD 1st Unit Notes
PDF
No ratings yet
ACD 1st Unit Notes
54 pages
Module - I
PDF
No ratings yet
Module - I
70 pages
Unit 1.1
PDF
No ratings yet
Unit 1.1
64 pages
Tafl Unit 1
PDF
No ratings yet
Tafl Unit 1
64 pages
Automata Notes
PDF
No ratings yet
Automata Notes
230 pages
Toa Handout 2
PDF
No ratings yet
Toa Handout 2
41 pages
Chapter 2 Python Fundamentals
PDF
No ratings yet
Chapter 2 Python Fundamentals
33 pages
Autumata Cha1
PDF
No ratings yet
Autumata Cha1
20 pages
Theory of Computation: Computer Science
PDF
No ratings yet
Theory of Computation: Computer Science
134 pages
FLAT Unit-I Lecture Notes
PDF
No ratings yet
FLAT Unit-I Lecture Notes
30 pages
Automata Theory and Computability
PDF
No ratings yet
Automata Theory and Computability
189 pages
TOC Notes by Ajay Sir (1) Compressed
PDF
No ratings yet
TOC Notes by Ajay Sir (1) Compressed
48 pages
1 Finite Autometa
PDF
No ratings yet
1 Finite Autometa
21 pages
Atc Part1
PDF
No ratings yet
Atc Part1
15 pages
FLAT Notes PDF
PDF
No ratings yet
FLAT Notes PDF
110 pages
ECS 20 Chapter 12, Languages, Automata, Grammars: R R 1 2 N R N n-1 2 1 R
PDF
No ratings yet
ECS 20 Chapter 12, Languages, Automata, Grammars: R R 1 2 N R N n-1 2 1 R
4 pages