0% found this document useful (0 votes)
36 views17 pages

Unit-2 RegularExpressions&Languages

The document discusses regular expressions and their properties, including operations and examples of languages that can be represented by them. It also covers the conversion of regular expressions to finite automata and includes various examples and proofs related to these concepts. Additionally, it addresses the pumping lemma and its application in proving whether a language is regular or not.

Uploaded by

rajatmaurya7906
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
0% found this document useful (0 votes)
36 views17 pages

Unit-2 RegularExpressions&Languages

The document discusses regular expressions and their properties, including operations and examples of languages that can be represented by them. It also covers the conversion of regular expressions to finite automata and includes various examples and proofs related to these concepts. Additionally, it addresses the pumping lemma and its application in proving whether a language is regular or not.

Uploaded by

rajatmaurya7906
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
You are on page 1/ 17
Regular Expression : . : 22. The Act G Alsings actepted by FA se pk Cuguage, Thr Aepuler feape AP NAT, Ly cepe ft opae® oi” ' 0” ® Camp Show thot POCRp ey rey B a ar® € a7bP? a LE a7) Cenvert into SFA ea e a Sime ale % Slabs are tn frak P Aeti pe eR E ae Heuer Porvect Eraupe — Prove cy Aupreve the following exprersrou (xn2") Panos)” ENEA tor (tst)™ Or 6 & xr > é 3 ENEA +o DEA € chtuwe G 0 = oh 4 4 Vector} ” nm 2 2a 1.2% Heute Proved , Example Pysve or disprove -the follosing RE Oo (ees)” eptyc® Depron © (es+eyes=(ee*s)* —y ® sles+s¥R = ee eceec 4 le eguivelue MFA Uk Bh Basie properties & Regular Expression + P+R=aR de R= R b= ER= RE=R e*= ie gts é RHR=R PQa+PR = P(AtR) P+ RP = @rR)P R¥R*. R™ RRs R*R (ary =R™ E+RRY ER > (PAP = Peary” * > (pray = (Pra®) = (P4 a") (P*a = e+ CPrayve Rove that (PAyP = Port” Lus = (Pal*P = (é,Pa, Para, rarara:)P = (P, Par, PRPAP Paparar.-~) = PLE, QP, BPQAP AParar..- = Play = RHS P, Je ve tha pkey. ¢ 4110)" + F _ ae P LHS = (P¥a) é € move 14 Zeunsved f ) e Q pis = E+( POR Oh irs . Deas LHS 4 RES Now Qnversion of ENFA to MA . ane Acme. Pesure P Q Y u Example — Beye hat 6+ (ony Col) = (Heo lé *Coly*= R Las = e+ RR™ = R® = (Feo) We raw dat (p¥ eX)”. Pare raft f° Ls = Gy ott)* Prove that Buaunple | (+ 00*1)+ (14001) Cotto" lotto¥t) = 0%) Cot lo*1) LHS = Ciro) [+ OHO*)* Cor D] Lk CoFlo= R = (oe) [e+ R*R] = (400%!) R* = sle+oo*)iR™ as o*| _lorionny! Ru ant Example: Tae OR Fale iy (S42 7)" tine a8 Goth LHSR ems Contain E iy (stte st Tone aS both LHS Z Ris dock nok lowlain & fy ote CO Bue vas both Lic Lave tole ¢ Example: Find RE a) the fab cy all Binge coding fn (atey*b b) Khe Bek of ald Abunge -evding in ba (ary ba WO Be dk Of alt Abings tui neithes, in b nor wr ba late)” aatate A) “the Act oF all in ab aaeat . © the Ze of ald Ainge neithr in ab nor ba Etath + aib)*Caatbb) SeeyPsPee Example} Find the RE 25, Ty Strings Containing exactly tivo o's PMoltote il) Sting Containing at dest two o's *o1*o Cito)” OR (ot 0 Loo (04N)* ill) Strings net encing in ol (CoH) (00+ II-+ 10) Pee Example! (ontDuck NEA sith @ move fOr RE = olLCio*+ ily +O] 1 (enyert ik bo BEA Goteny*to 62> 0 +O z Gos) (ea, 0 =e¢(A0 1b, 0 EO 2£C(%U 45%) = Be yh £(44,) 244%, £64 44, 93 $647 % Ish WG, fy Example | lendtiuck cua NFA Ae attepl Ahe faupuase, “api tented oy a E¥C* Convert the NFA do DFA Oo -Qe® © Os ele VOU. Uh * ED Saya. d= ec(1V4UP)= ECC) = dot — 61404 C= €(%0) 51 (aetndy, b) = €6(PUYOS) = ELAWI= We cae ! 6 Cah, a) = ec(Opo= hase (uh ,b) = OCHO FI = KGr sifeuy oe Maye (GOW 2 & Saye eeCAI> 26. DEA tp Regular Expression Thee ae two popular approaches for (oustuicling a RE fom PA D Thangh Atak /foop elimination D Aade's Teoem Ro Q+tRP > R=RP™ Stati/ Loop , yo ® Ry “e =) Bb ® .. Ys b+ bia ° & sai A Gemorie one 2late machine }— eek : Qe aa 6 bread ttCg 3, A gerete tug wale Bd Unread fg a ag ? al eee ae fa) eR OR R, Ry + RGR GOs Me RE = RRL R+RG RR) faders Theorem! R= Qiep R=BRe* Re ge(arRoer SAtQPa Rpm = B+OP+ (QaRP) I SATOH APM REX - = QCe+P4 Py 9 Zar Exauple 4. = 64+ 4b ta, = GA GY = E+40 t%O i= ue % =a) +4.) 44) WW = HAT HOt WA*TUHA 4-40 Pur OR Ge in ay - 24 !+ 2! +4,01 : 4 = U1 t4,(It01) Geet G45 + aba w= 41 (400 Ua Et a, (ab+ba) So y= qo4 auiltroiSog, ee Ge € (abibad® Y= b+ % (04 1U401¥ 00) hee (o4(101¥'00) u= (2H Uit01F00)" . Proved) 7 Re = (oe + ILit0t800) Eafaid xy Ny 0° y oo} . as e eee -—D = boty) —O on my 4, = 14+ 4,04) —O hese eee %= 41th opm . New y= T]p NANS (outx oR Old Y) G=€0 +H (or) ap = lie) °R (oy) Tn=or alow) 3 a> alow poe we ae & 9 Sloe He elFnloH) 5 9,210" inpe 1% oO; e New Y= old x 4, = olowd) + Modo Nas y = © NAN(O OR ©) Pp: Hg. a ° NAND O i ~ o 1@. 10 12 q Sete : ' SP pogo =o: b= Er ot U! -O U= ert» —O > Ga)t 4-42 —~@ 4o = (€+4,1)0* 2 RE= Xo (Ie%t0e) (E+) 4,2 le, %e + It Geo = 080 + 41 fo + G 149,00 % =0%o tq (lot tI te) ry qa ofo (ide tt 00) O qs dro (Ie Ht00)” : oa RE = vo Lio t1400)” (E40) Ws ab braon d per - . AB Wwexyz 4-0") wee abetay,™ ° ber . (axe ty te me wy2e a ae t+ yyze @ Bok a! v * ¥ br | 3B ree Babee. Pe we ght Beunple Consider he Drwsition _ Conert Ub fo eun equivelete Pepalon exprensi Madeu's Hicorew . i 1 A : Oo fl 3 Eqa Azé+Al+ar —O A= (E81) + A! B= Aotce —® DAs Eran c= BI — © qa a B= (€+8NI% +0 3 : eas - 6 ; C= BI B= +e) lo+ Blo C= ocir'o +1051 = Pot Bii*o+ Blo Ava. 8 0 + BU +10) S>B= > (IP +10)" Bawnple: Find the ‘ ie wed by the FA Popul. expression fet Airings Ne Cogrir hoon, Uke Anal theses oy Abnig Pecan “ 4 = EtG 44,0000 —O Ye eoty2 —O© a= bl +yo —@ Eq) qr Jaz E44! + Aol +42) Cow Y= 42 + ole 4p = €4+4,(1+00+01) + Voll ot!) aes (e+4, (to0+03]C 1 Lox)” Foe (O40 + 4, [iraorasdIlo4n™ _ ¥ B= 424 104304 4, (Hood lonfo 4, = MonFo + 424 (w20r01) 1 (0F/%0] 4,< ion¥ o (2+ Creo+01)) Loris” Ramping Lemna fpr Regula Expression + 3 Pu Lemma 4iveg a net Grdition but not Aufgidenl Condition for vpn a 7 Dan iupuk Adring 40 balou to a Agpullar sok, - > 0 fompuaye 0 be Aepulen . + SO ik Aheuld not be Used +o estatbsh Hhot a geen Lauguape 4 Aepulos Tt Abowd Ke used to eatableh Hut a given Lauguaye ix not Aepular- Pumping Runs sor Abe pizeeubole prmeiple, luck Atle Hat ib » pigeous ane placed into fee than m holes, seme toler Lave to have mor than Ome F pigeon ta tt, — Ciwilaly, a absing a Length > Whey Becegrin by a FA Wikbn Saka Will Zeo Aomt Stetis Acpealug Lee L be @ RL and Me (@E8GeF) be a FA wikh n dtoke, languape L ik alteped byl. Leb Wet and Jule n, then W Gu be Wahlen og xyz, Where ly)>o W eg) Sm . i . Ww) xyz EL fr Wize wea ea cet te ted Pumping Leura Lhoude be applied os follows / Stop. To provethat L fa not Acgubue, we proceed with atsuuuption trol L te regula L kis cccepled by FA Uh my Atals M2 Nes, we cheese a pining LO EL Auch sthet Judl sn Note: Uohich Ud 40 Select 1 vous tinportant Steps. > Tk Willen ag XYZ tore D Dy) >0 ; i) eylcn, * ei, Now we will smd an t Auch thet xey'Z ¢L . This will Conhadut ne sthat L is Popular & heute we Gr loudude thot Lig nok . a Note: Whidr Lo Select Z tmportant . Grauples TS Lada | nz} Aaqubr? . é: o&* iP meau it 1s Regular ° OBO Erauaple: 3, Le ate”) om 20} nal / % b é b © le UO Repl : Exeample Show hat tho bouguge L= £46 ic not Aegul . 28. Supi: Lek us assume Ahat L is Aepule ad atepted by FA coibh n Atelin Step + Lek UB Cheese a abing Ws apn [Wlean pn Leb us wake wy as xyz wth Iz! 70 4 layla Arce |xylgn Ao y miust be he form a”! r>o At must be Ah the form a Now ab" Can be umiltou a& xyZ Br a® a Pons be xy z SOP3. Lek us check whethr xy'z fer i =2 belowgs do L xyz = ath an ttn snanih a Where W>o re mo G as are Peale than no Gb 40 aye ¢L Hence by lombracbichion wee cour Any hak he given Paupeope 13 not /epula, Erawple: Laing tacts Lemma for. Aepali fs, pasve thatthe Lapuape if Sai 2 “1 ipo} é& not Acpubr . Sapl, let us assume Phat Lis Aula ¢ Guu be adopted by FA with n Alalex Slopr. Leb us choose a Abtinp We are — here’ [wl =3n BN . Lekus Write Weak xyz with Iylze 4 izyisn Asrve Weyl Sn) y musk be Fite forum aX JATPO ’ Axon a4 ” a*® Nao W= a" Gu by wrillen as Sah qgrs*,2n ae n xy z SPB. Lotus check whetnes XYZ forica belongs to L xyz = ahal¥ ar ey on = ann,2n bo 170 Be 010 be ro olen be Bo xv el alice Heuce by (onbadiction, We Gu Sa Veu Me 4 Aa at ihe gates lagage Frauple: Using Pumping Leuune for Axpuler Rots, Prove Ahak she Language. Le {wu | w eloeP} is not*eputer. 4d. Let Stop a ona ee Cau be accepted Sir» Let us Choose a Absing We ab ba? (wis 2nd Le. len Let us wai w as xyz with Cowdition \y)r0 4 Inylsn force (yIEn 1-2 Y must be oftle fom al 1a >0 fx nn ” a w= ab ba” “Gu be Witten a8 aka a0 *™ Soy xy Zz 3 i é Lek Us Check whether xy'z for Cor belongs to L ya i xe = at a> abet es at - amr = abba” heooxye €v 4 bance boy lontradiction We Gu Any that the given Laupsape is nek hep Frample: Using PL prove that Lauguspe L= {Wu} 0 €Ca,b)"f ix not Aegis. Stop, bet us aseume that Lik Repub £ Can be acteplod by FA coeth 1 Steles - Step. Let Us Choose a woalwing bie a" a re lw)sr2ner Fe [wi yn Leb ur wale W a xyz With lowdition lyrpo 4 pylsn Ance ieylsn, y musk be a He fem 2* ldo Lon, on ” ad VOW Can Bo Ke wadien 88 At af a ath Step. f p: Lek us check whether yy!2 for for belongs tL bba” xyz Bare NAY = @arFa' b ae = ane ab ab ie xvz2 ee Pouce by pears We Cau Lay that the giver Cuapuage tx Erawplt — Uding PL prove Ala L={ OV 0™" | myo dn vo} iinet neh Sagan ij — suit 2; Lt us choose a 2DA Lowe os — usjz 2 (rem) ott Leb oS We W as a Oe ties IyJro 8 yen fone Yl SN, MIELE fom OF |7D0 a xyz = afer gre" 1m Aya, Ut Us check yy'z joriz0 beloags tL fan ire stat gh (MO ae €L Heute preved je wign bok Example: using PL hws drat language L = {wie |W ECb5E by not a 24, Stop: Siz: we aMh ath ae lle 3n+3 be, jofyen Let us Wake Was xyz Whee ly) >o & lzylsn Ante \tylén, yp He must be gf fom al} r>0 eee, it a W = Oba amy hep: casp aPak® ah FH my arb ps: Lek us chee xy'Zz for Poo blows tot 7 . , BYE ara Le ye di. Grane! Using PL prove Lange L ={6 lm tt prime} id not Angele . Stepd. =e Let Us choose WW = ab Whee PK pomeno L p>n le (Wap pe lozn oe Let us wae Ww ae xyz — oth Coudition [y1 20 S1ZYIS 7 We Cau assume that Y= a” m>o Sep, xylz ta be Uuillen a bey] = byzle ty = pele fer iz pt! / be Leri-m = bEpm = (PHIM ie no prlmens, Ie xy aL a . Bawpe; using PL prot Ahet Language 'L =fao }i>o} is nek Acpuler StopL: Wet us assume thok the Given lareprope L 2 ropa Con be accept Gy FA ' 2: bk us Chowse a Abring Om b Beker “ We om — tadent be baipn Wek Now fob U& wrile wd as xyz bith Coudelion lyizo & beylgn Stops Lek us cheek yy'2 fort 0 Aolonps te L tace Loz - [xyzJ = bevel tly because YI7° Ko ixve| > n>. 4 a because ocyleu AO len heyz] 0 ont SS oF oy ee StepS Lek us check xy ger C70 belonpste L ¢ t 2 v¥e 2 oS ot ote" iva ++ = pti ” tuke f= NAY * nite xr 1 é. w+ FP on’ ft = BMT ES 1 t + an xyz =o" pee ged 2K re xyz €b fo f= mee . Nene by lentradiction We tan Bay that the itn lanpuaye doetenat ol Brame ; Using PL parte that L = fap Fm anf is net Ajab a flee us chow a aig fom L w= aPb% gic tak presen 4 boot! Leb us Wile W oA xyz woth (Oudddion lyJ70 4 MyI

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy