CSE303 - Introduction to th Thory of Computing Smpl Solutions for Exrciss on Finit Automt Exrcis 2.1.1 A dtrministic finit utomton M ccpts th mpty string (i.., L(M)) if nd only if its initil stt is finl stt. Exrcis 2.1.3 () Th following stt digrm rprsnts n utomton tht ccpts thos strings w {, } in which ch is immditly prcdd y., (c) Th following utomton ccpts thos strings w {, } tht contin nithr nor s sustring.,
Exrcis 2.1.5 () (iii) Th following 2-tp finit utomton ccpts th st {( n, n m ) : n, m 0}., () (iv) Th following 2-tp finit utomton ccpts th st {( n, m n ) : n, m 0}. (Not ll trnsitions to dd stt r shown.),
Exrcis 2.2.3 () A possil utomton for ccpting th lngug () () is: (c) Th rgulr xprssion (( ) ) gnrts th sm lngug s (( ) ). An utomton ccpting th corrsponding lngug is:, Exrcis 2.3.3 Lt M 1 = (K 1, Σ, δ 1, s 1, F 1 ) nd M 2 = (K 2, Σ, δ 2, s 2, F 2 ) dtrministic finit utomt. W construct finit utomton M tht ccpts th intrsction L(M 1 ) L(M 2 ) of th lngugs ccptd y M 1 nd M 2, rspctivly. Th utomton M is dsignd to simult th oprtion of oth M 1 nd M 2. Mor spcificlly, its stts r pirs, whr th first componnt rflcts M 1 nd th scond componnt M 2. Formlly, lt K K 1 K 2 ; lt th st of ll tripls ((q 1, q 2 ), σ, (q 1, q 2)) in K Σ K, such tht δ 1 (q 1, σ) = q 1 nd δ 2(q 2, σ) = q 2 ; nd lt F th st F 1 F 2. Th finit utomton M = (K, Σ,, (s 1, s 2 ), F) ccpts L(M 1 ) L(M 2 ).
Exrcis 2.3.6 Lt M = (K, Σ, δ, s,f) dtrministic finit utomton tht ccpts th lngug L. () Lt M th finit utomton (K, Σ, δ, s, F ), whr F = {p K : (p, w) M (f, ) for som f F nd w Σ }. Tht is, M diffrs from M only in tht its finl stts r ll thos stts from which finl stt of M cn rchd. Th utomton M ccpts th st of prfixs of (strings in) L. () Lt M th finit utomton (K, Σ,,s, F), whr = {(p, σ, q) : δ(p, σ) = q} {(s,, q) : q K nd (s, w) M (q, ) for som w Σ }. Intuitivly, M works s M, ut computtions my gin t ny stt tht cn rchd from s y M. Th utomton M ccpts th st of suffixs of (strings in) L. (d,) Lt M th finit utomton (K, Σ, δ, s,f ), whr F = {q : (q, w) M (q, ) for som w L nd som q F }. Th utomton M ccpts th right quotint L/L of L y L. Not tht this dfinition is not ffctiv. A suitl st F xists, ut it my not possil to ctully comput it. Th diffrnc twn prts (d) nd () is tht for prt (d) on cn show how to construct F. (g) Lt M th finit utomton (K {s 0 }, Σ,, s 0, {s}), whr s 0 is nw stt not contind in K nd = {(q, σ, p) : δ(p, σ) = q} {(s 0,, q) : q F }. Informlly, w otin M from M y rvrsing ll trnsitions nd switching initil nd finl stts. (W nd to introduc nw initil stt for M s M my hv mor thn on finl stt.) Th utomton M ccpts th st of ll rvrs strings of L. Exrcis 2.4.5 () W us th Pumping Thorm to prov tht th lngug L = {ww : w {, } } is not rgulr.
Th proof is y contrdiction. Suppos L is rgulr. Thn y th Pumping Thorm thr xists n intgr n 1 such tht vry string ww L, with ww n, cn writtn s ww = xyz, whr xy n, y, nd xy i z L, for ch i 0. Tk th string w = n. Sinc ww n, th string ww cn writtn s xyz, for suitl strings x, y, nd z s dscrid ov. Sinc xy n, th string xy consists of s only. Thrfor xyyz is string of th form k+m k, whr m > 0. This string is clrly not of th form uu, for ny string u, which contrdicts tht it is n lmnt of L. W conclud tht L is not rgulr lngug. Exrcis 2.4.7 Lt M = (K, Σ, δ, s, F) dtrministic finit utomton nd lt n th numr of stts of M. First osrv tht if string w is ccptd y M nd n w, thn, y th sm rgumnts s in th proof of Thorm 2.4.1, w cn writtn s xyz, whr 1 y n nd y drivs th utomton from som stt q ck to q. Consquntly, th utomton M ccpts xy i z, for ch i 0. An immdit consqunc of this osrvtion is tht if M ccpts ny string of lngth grtr thn or qul to K, thn it ccpts infinitly mny strings. On th othr hnd, if M ccpts infinitly mny strings, thn it must ccpt som strings of lngth grtr thn or qul to K. Lt w ny shortst such string. By th ov osrvtion w cn writtn s xyz, for suitl strings x, y, nd z, such tht 1 y K nd M ccpts xz. Sinc th string xz is shortr thn w w my infr tht xz < K (for othrwis w = xyz could not shortst string of lngth grtr thn or qul to K tht is ccptd y M) nd hnc K w < 2 K. Exrcis 2.4.8 () A sust of rgulr lngug nd not rgulr. For xmpl, th st {, } is rgulr, ut its sust { i i : i 0} is nonrgulr. (c) If L is rgulr, so is its complmnt Σ L. Thus, th conctntion of th two sts, L(Σ L) = {xy : x L nd y L}, is rgulr s wll.
(d) Th Pumping Thorm cn usd to show tht th st {w : w = w R } is not rgulr. () If L is rgulr, so is th st L R ; s Prolm 2.3.6 (g). Sinc w R L if nd only if w L R, w my infr tht th st is rgulr. L L R = {w : w L nd w L R } = {w : w L nd w R L} (g) Not tht Σ = {y : y Σ } is sust of {xyx R : x, y Σ } (s th formr st is otind from th lttr y tking x to th mpty string. This of cours implis tht th two sts r qul (nd rgulr).