L5L 41J
I nstructicns:
hla nne Keu
MIidt*rm l-
m Y** fi1;y use y*ur text *rrd y*ur OWhJ notes f*r this *x*rn but YoLl mfiY not use anything else.
c Y**r wmrk to4UST be yc*r *wn, Ccnsultin5l with ailyone cr searching the Int*rnet is ch*ating and
if y*u al* caL:ght y*u witrl get a zers.
* Fiease write legii:ly anel *nsu’rer each questian compl*t*[y.
+ Y*u n”:ar; print cr-rt this exarn to fiil in, ar y*il ffiav read it fr*m a terminal *nd write yo*r frris\ffers
*n a sepai”ate piece *f paper. f;1ther \iday ysu must create a pdf of yo$r 3rls$/ers *nd suhn”nit thenr t* Gtad*Sr*p* hy 7-:$CI Pl#i”
1
1 /’1 E n+rl
a Construct a state diagrarn fur a DtA thut *ccepts the following langilage
{w € {fi, 3}*; lwi is rdd}
otl
d, I
b. eanstrucr; stlt* diagram for a il[rA that aecepts th* f*ll*u,ring languag* {w e {0, 3}*r vr **ds with an 3*} I
i c)
C. Construct the state dlagran: f*r a proriuct DilA from the answers fr*m Fa;!s a and b t* cr**lf; s DFA that accepts {w e {0, }”}* : lw I is cdd ur w cnds with an S{} {ifutP*ftTeNT: e**struct & “produ{t” *FA not mm5, ffiFA that giues the set}
0
?
2″ {5 pts} Construet the state diagram f*r a l}FA whie h accepts the foll*wing language {w { {1., 0}* : w c*ntains at l*ast tw* ffi’s nert fallowed by * 3i
d,b’t
a
(
*ib,,
q
I
* ,’lr’1, s
o{”
i” (
t
o
I
€>
L
b
b
e
tt
dl
c
{-
t,i s/””/rs’
d
3″ i5 pts) Cive the state diagranr withr R# ffi*re than 33 states f*r an l\}fA which r*engr:izes th* language: X- = {w fr {a,b,c}” : w conlains at least *ne substring that contains th* sam* eler**nt three times in a rr:w) {e.g. bcaaab e L, hbb € L, a*ba*hh fl L) B*nus point if yaur NFA has less tha* “tl statss.
ci
, (
c1
lt
,brc
o
I
3
4. {lC pts}Convertthef*iluwing 1\lIAto a ilFA usingthe met}’:od demonstrated in class. Draw the state diagrarx. Yeru dnm’t need ta show {ar calculate}the statss that ar* rrot r*achahle frurn the start state.
&
i 1 t,’rtr
a lrt
1t)
–, * f i,,21 ti
v 12,11 a
0
t
7
1..
U
tl7 1)L
q
4 i
4
ttJ
tz,t)
, .) lzi>)
0
0
0
I
o, I 4
1
€ (t;S
4
5″ {a ptsi Fcr *aeh *lthe N*ngurag*s defined by th* f*llowing r*gular expressir:ns, give twc stnings that are mernbers and two strings that are n*t m*rlri:ers. {[ * ia, [:]]
a. ba U abua *ternbrr> i bq o{ {4 nul tt(fi[l7r: b
h” i0. u b)*
/4dr’nhtn5.
4,tl ,re^byl ” {n
OtA
6. {5 pts} Glve a r*g*lar expressi*n that generates tire f*ll*wing nanguag*: iw € is, h]* : w does nci contain the rLrbstring aab)
( bir L o,b U
/ ) ,t \
Q *
?” (a pts] Let D be a DFA” What simpl* prop€rty *f * iE true iff € € L{l}} Itr, Elr,rl ,!r’lc iv cL{t ‘lcteYl s[‘lc
LwuF)
f . i4 pisi l.Jse the ;rlphabct 5 = {0,1} f*r this 6:roblem;
a. List till the langr,:*ges that ean he rec*gnized hy a 3FA r’;ith l- state
Z+
tl. List alltt”re languages that r** be reccgnized by an IJFA with l” state
0) L) C+ It) T* )
0)
I
D bb
q
5
$. {1″0 pts} lJse the m*thod learn*d in cl*ss t* f *nvert f he DFA hel*w t* a Regular flxpression Ee s*re ro sh*v’r all your work.
a. First drav; the Gfl’i[:A t* start tht pr*ress
Ltyb
qv z
t
h. f.J*ur [lin’ri*ate State 1 anri cir*,* th* new GFiFA
G: = L, d rr, f,,* tr– q t) L4v(”’tb) = a u b G’, = l’0, V /^,, f,,’* tr ‘q v l^*r z = {
ri tJ (q’til 4’t [q ‘tb) = (i ‘ ‘{” u) G;,erl) G,(,, f,, u Q v (“‘za)dr t’ a vb
t:t U b)G,b) etlb
d. Now eorne up with the resulting re6ul*r expressicrr
f z €r’= {n, U i”u,f-rur e., = iJ (a ,t b) (@ uu)to ‘a))r Ur uu)
C”‘ , e. U Qi
e ,* $r-* &\/b
3
i’
tl
t:
i”0. {1*pts} Fr*v*thatthcset{u;wn:ur€{*, 1″}*iisn*tar*gulariang*age”{ReeallwRisthe
!\,tn
ixy,i*y=7\/=A-*=7I.0i s’^ei tiJ >c =/ )’o
(s,\rre ttr:,,/l lqs iess
reverse *f w)
By(unJ’,iirli,^ fhzPt =7i zr’t :.l” ),tpp”;e I ie *'” R’.”, 7
tt V*cL *l l”‘i’-lt d*
ut= x/?
-tb””e t lxyl* |
L lll ?o
s { x/;z e L
Lut ,u=Arlr lf 0f e L Lel w:”n/Z sf fht
l*l”tf ? f
3 toaof,’/’v* s /'” /l
x’ : 0o^;tflfaf4t /’z
0! lO”?r*l.ld)
:)I c”l’3
L
i t” 5 touf q A. //
V;
11. {t* pts} {a} Where is thc crron in tlr* f*llowlng pr**f? {h} [l:rneet it *r state briefly tl;hy !t cannot h,r: t*rreeted
1= .[{CI]”}” n l0} is n*t a reguiar langL;age.
Pf: (i:y c*ntradietionlAssurne it is regr.rlar. Let p be the pr,rmping length
Chncse w = (* f’eLand Writ* w * xyz.
/^a ra-1 = .1, aIlG 7 ; {UIJ” –
T 14,) o, 17 d, [u,,.9 I o*o7 al
lxyl =Zspnnd lyl =1>*
hut xyo: = *{*1}.r S l-
but, by Fun:ping Lenrnr* xu f L =><= (rantradicti*n)
Iherefore, t is n*t a regular la;':guag*.
b..eqlt,'.r,' ,* ,'n
3 7,'r'r* s thn, t ,*d,
(-r,'f L
bt acrreo{.r( sirt{t L L q ft.L
{W ?t)r
4 RL
,lurt r' l. .,1.1,*
i,,ss s /a,.,,r
l, ,i/l
)u -lr"lrl' f ,.1 ,,n ,as
iI iues+'] *,r1" i. ,if ,.ttt,/s.
I
7
i7" {1* pts} Answer th* f*ll*w!ng -l"ru* *r false:
a" |: {r.tr e lL},'1,.".,9}*:r.qr}ias n* l*ariingzel'cls ar:d:,thenvier,ver{ as a r.lccitual
Irunrller"isaprinrcnuuiberl:*tr.veeyl l and 1S**]. (Tirismlrans 2 €L, 13 ffiLbul 25dL)Lisaregularlangnagt. , t' ; ,4.sets rc,.2,
f
( t^ i) l,'o,J, ,-''l 'll 'in Q /r,,- )
I
V). Supp*seAand Bare r*gular Iaitgu*g*sthen {w; vl= xYwhere x € Aand y s B}is* re6ulxr ienguage
f
d" l{ N ir ;:tr NFA rvit}r n slates the n t a t}F'A I} l.vifh n*t }no}'e than n: sl*tes s*cl'l tl.:at l.{li}) * l,[i]]
hl,r)
e. Let l- = {;, aab, aaahh, h, aa}. Ther* is n* *FA wittr"l5 slates lhat reflsgfliz*s 1,.
zlr r verll e L *lrn L -*ri,{ b- iu{;*r\" rL o*ly 5'- t irltt) I L,''" ,
13. {S ptl} Suppose we define a variati*n *f ** I'lFA as fnll*ws: [x*nrfutA is * 5-tup{t
{Q, I, S. q0, F}that aerepts x f; I* if every p*ssibie sti*te th*t it c*uld be in aften neading
input x is a stale fro*'r F. il* other'!,t*rdr, an Hxarnl\ifA is jusl [ike an frjFA exrspt that an hlFA aeeepts x if s*me stat* that it e*uld h* in after reacling input x is in t, and an txamNFA ficrepts x if cve11, statc that it c*uld he in;:fter reading ini:i;i r is in F).
a^ Show if L is a Regr-rlar tanguag*, then 3 an [xamtuFA M such that t{M} - L. {Y*ur
f
(&L t lururl w,len caa"qy'e't r/'"' ) C" lf a langua,ge is ual regttlal' lher: it is ultcr:untabic
hr-c L r b*, *vl
ans\#Br can be brief)
DFA /
€e",1 lt lb.rrlll ol +s 44 E *r* l/fA
E '/€f
b. 5l"row that if tuI i: an fixan':l'lFA, then L{lV}} is a regular !anguage
CQ,2,5,7) fI
(ls" |qe gawte (a+tl.rr{r,n 0n
l, e,?FAtu5'aqs*s"J1.
]u ,rt CfAl Erc rf 't
14 i,
(-o *v "r^ t i,rat,n'f,2,l/fA
(otl lu*lve)rr q'( '-**\qLl")
# I e?ta)
k -'f
(€te\z,[i rGs4),F') rtl' ;{f q8c F
Lsl
v,-t L