Generating Balanced Parentheses and Binary Trees by Prefix Shifts

Size: px
Start display at page:

Download "Generating Balanced Parentheses and Binary Trees by Prefix Shifts"

Transcription

1 Gnrtin Bln Prnthss n Binr Trs Pri Shits Frnk usk 1 Aron Willims 2 Dprtmnt o Computr Sin Univrsit o Vitori, Vitori BC, V8W 3P6, Cn, 1 UL: 2 Emil: hron@uvi. Astrt W show tht th st B n o ln prnthsis strins with n lt n n riht prnthss n nrt pri shits. I 1, 2,..., 2n is mmr o B n, thn th k-th pri shit is th strin 1, k, 2,..., k 1, k+1,..., 2n. Pri shit lorithms r lso known or omintions, n prmuttions o multist; th omintion lorithm pprs in sils o Knuth vol 4. W show tht th lorithm is losl rlt to th omintion lorithm, n lik it, hs looplss implmnttion, n rnkin lorithm tht uss O(n) rithmti oprtions. Aitionll, th lorithm n irtl trnslt to nrt ll inr trs looplss implmnttion tht mks onstnt numr o pointr hns or h sussivl nrt tr. Kwors: Gr os, Ctln numrs, ln prnthss, inr trs, omintoril nrtion, loopr lorithm. 1 Introution Bln prnthsis strins r on o th most importnt o th mn isrt struturs tht r ount th Ctln numrs, C n ( ) 2n n /(n + 1). Th Ctln numrs n th ojts ount thm r tnsivl isuss in Stnl (1999). Th onlin supplmnt lists 149 istint isrt struturs ount th Ctln numrs (Stnl (27)). Binr trs n orr trs r lso ount th Ctln numrs; ths tr struturs r o prmount importn to omputr sintists. Thr is lr numr o pprs lin with th unmntl prolm o hustivl listin n rnkin inr trs. In this ppr w vlop n lorithm tht hs numr o ttrtiv n uniqu turs s ompr with istin lorithms. Lt B t,s th st o ll itstrins ontinin t 1s n s s n stisin th onstrint tht th numr o 1s in n pri is t lst s lr s th numr o s. For mpl, B 3,2 {111, 111, 111, 111, 111}. In prtiulr, B t,s is mpt i t < s. Furthrmor, i t s thn B t,s n thouht o s th st o ll ln prnthsis strins mppin 1 to lt prnthsis n to riht prnthsis. In this s, w somtims rop th s rom th nottion; B n B n,n. Copriht 28, Austrlin Computr Soit, In. This ppr ppr t th Fourtnth Computin: Th Austrlsin Thor Smposium (CATS28), Univrsit o Wollonon, Nw South Wls, Austrli. Conrns in srh n Prti in Inormtion Thnolo (CPIT), Vol. 77, Jms Hrln n Prhu Mnm, E. proution or mi, not-or proit purposs prmitt provi this tt is inlu. I 1, 2,..., t+s is mmr o B t,s, thn th k-th pri shit is th strin 1, k, 2,..., k 1, k+1,..., t+s. Not tht th irst it, 1 is not prt o this inition; this is nturl sin 1 is lws 1. Furthrmor, it is impossil to nrt B t,s i 1 is inlu in th shits (.., 1 t s is th onl vli shit o oth 1 t 1 s 1 n 1 t 1 s 1 1). In orr to nti th rr into rin urthr, low w show th simpl itrtiv rul, whos sussiv pplition will nrt B t,s usin pri shits. Itrtiv sussor rul: Lot th ltmost 1 n suppos tht its 1 is in position k. I th (k + 1)- st pri shit is vli ( mmr o B t,s ), thn it is th sussor; i it is not vli thn th k-th pri shit is th sussor. Th onl strin without 1 is 1 t s, whih is th inl strin. Th initil strin is 11 t 1 s 1. Applin th rul to B 3,2 ivs th squn 111, 111, 111, 111, 111. This is th irst ppr tht onsirs whthr ln prnthss n nrt pri shits. It is known tht B t,s n nrt trnsposin pir o its (usk & Proskurowski (199)), pir o its with onl s in twn (Bultn & usk (1998)), or trnsposin on or two pirs o jnt its (Vjnovszki & Wlsh (26)). In nrl it is impossil to nrt B t,s trnsposin onl on pir o jnt its (usk & Proskurowski (199)). Our lorithm will shown to nrt B t,s trnsposin on or two pirs o its, ut thos its r not jnt in nrl. An lorithm or nrtin omintoril ojts is si to looplss i onl onstnt mount o omputtion is us in trnsormin th urrnt strutur into its sussor. Looplss lorithms r known or vrious lsss o isrt struturs tht r ount th Ctln numrs. S, or mpl, th pprs olnts (1991), Korsh, LFoltt, & Lipshutz (23), Mtos, Pinho, Silvir-Nto & Vjnovszki (1998), Vjnovszki & Wlsh (26) n Tkok & Violih (26). Thr is ppr tht shows tht inr trs in thir onvntionl rprsnttion o no with two pointrs n iintl nrt onl mkin onstnt numr o pointr hns twn sussiv trs (Lus, olnts, & usk (1993)). This lorithm n implmnt looplssl n is prsnt in Knuth (26). Th urrnt ppr ivs th sis or nothr suh lorithm. Th pproh tkn in this ppr ws initit in th pprs o usk & Willims (25, 28) or nrtin omintions tht r rprsnt itstrins in th usul w. Thr th itstrins r lso nrt pri shits. It is rmrkl how mn

2 o th rsults o thos pprs hv los nlous with th rsults o th urrnt ppr. Th orrin o omintions in (usk & Willims 25, 28) ws ll ool-l orr us o its los onntion with th wll-known ol orr o omintions. In similr spirit, w hv u our orr CoolCt orr us o its los onntions with ool-l orr n with th Ctln numrs. ltiv to list o ojts, th rnk o prtiulr ojt is th position tht it oupis in th list, ountin rom zro. To summriz, our mtho hs th ollowin proprtis: 1. Eh sussiv strin irs rom its prssor th rottion o pri o th strin. Furthrmor, th list o strins is irulr in th sns tht th irst n lst lso ir pri rottion. 2. Eh sussiv strin irs rom its prssor th intrhn o on or two pirs o its. 3. It hs simpl rursiv sription. This sription os not involv th rvrsl o sulist, s is usull th s or Gr os. Th unrlin rph is irt rph; tht is, i 1 irs rom 2 pri rottion, thn in nrl it is not th s tht 2 irs rom 1 pri rottion. 4. It hs rmrkl simpl itrtiv sussor rul. This rul ws stt ov. 5. Th itrtiv sussor rul n implmnt s looplss lorithm. Also, th sussor rul n trnslt to looplss lorithm or nrtin inr trs. No prvious listin o ln prnthsis strins is simultnousl Gr o or th strins n or th orrsponin inr trs. 6. It hs rnkin lorithm tht uss O(n) rithmti oprtions. No prvious Gr o or ln prnthsis strins hs this proprt. 2 Gnrtin Binr Trs To iv th rr lvor o how usul th itrtiv sussor rul is, in this stion w trnslt th rul so tht it pplis to inr trs, s tritionll implmnt on omputr. Th rsult is looplss lorithm tht mks t most 16 pointr upts twn sussiv trs. An implmnttion o this lorithm is vill rom th uthors. Th stnr ijtion twn B n,n n tn inr trs with n intrnl nos is to ssoit h intrnl no with 1 n h l with n thn o prorr trvrsl o th tr, inorin th inl l. I z is no in inr tr, thn w us l(z) n r(z) to not th pointrs to th lt n riht hilrn o z. Unortuntl, w lso n to mintin th prnt o h intrnl no; this is not p(z). To upt th tr w mintin thr pointrs:, th irst no tht is not on th ltmost pth o intrnl nos;, th prnt o ; n, th root o th tr. Th ssinmnts low rprsnt prlll utions, so tht, or mpl, [, ] [, ] swps th two vlus n. Th lorithm trmints whn oms nil. Aorin to th itrtiv sussor rul thr r thr ss to onsir: () th strin is o th orm 1 p q 11α, () th strin is o th orm 1 p q 1α, with p > q, n () th strin is o th orm 1 p p 1α. Blow w show th upts tht r nssr in h p h q r Fiur 1: Th trs orrsponin to This is n mpl o Cs (). o th thr ss. Importnt not: Th upts to th prnt il r not shown pliitl low, ut vr tim tht n upt is on to r(.) or l(.), thn n upt must on to p(.). E.., i th upt is r(v) w, thn it shoul ollow with i w nil thn p(w) v. Cs (): Th nw strin is 1 p+1 q 1α. This s ours whn l() nil. Th orrsponin upt to th inr tr is [r(), r(), l(), l()] [r(), l(), l(), ] ; r(); Cs (): Th nw strin is 11 p 1 q 1α. This s ours whn l() nil n. Th orrsponin upt to th inr tr is [l(p()), r(p()), l(), r(), l(), r()] [l(),, r(), r(p()), nil, ]; [, ] [, r()]; Cs (): th nw strin is 1 p+1 p+1 α. This s ours whn l() nil n. Th orrsponin upt to th inr tr is [l(), r()] [, nil]; [,, ] [,, r()]; Atr this upt th lorithm trmints i nil (i.., i α is th mpt strin). Ths thr ss r illustrt in Fiurs 1, 2, n 3. Cirls r us or intrnl nos, squrs r us or lvs, n th trinls rprsnt sutrs whos strutur is not spii (ut whos prorr orr must prsrv). 3 ursiv Strutur In this stion w min th rursiv strutur o th CoolCt orrin on ln prnthsis. In prtiulr, w provi two rursiv ormul n prov tht th prou lists tht r intil to thos prou th itrtiv rul. A orollr to this rsult is tht th itrtiv rul nrts vr strin in B t,s. For omprison purposs w lso provi th rursiv strutur or o-liorphi, or ol orrin. W in this stion ivin orml inition o th itrtiv rul. p r q h

3 Th CoolCt itrtiv rul mps inr strin B t,s to nothr inr strin σ() B t,s. Whn os not ontin n 1 or 11 s sustrin thn it is sist to in σ() usin th ollowin two spil ss, whih simpl mov th rihtmost smol into th son ltmost position. σ() { 11 i j i 11 i j (1) 111 i j i 11 i j 1 (1) r Othrwis, w n ssum tht 11 i j 1z or som smol z n som (possil mpt) strin. q r σ() { 111 i j z i i j (2) 1z1 i j 1 i i > j (2) p p q W inutivl lt σ () n σ k () σ(σ k 1 ()) or k >, so tht w n in n itrtiv list t,s tht uss σ. t,s, σ(), σ 2 (),..., σ k 1 () (3) Fiur 2: Th trs orrsponin to This is n mpl o Cs (). whr 1 t s n k B t,s. W ll lso in it usul to strt th itrtiv pross t th sussor o, n in t our irst rursiv strutur will qul this sonr listin. Inst o strtin th itrtiv pross t th sussor o, this sonr listin n lso sn s th rsult o pplin σ to h strin in t,s. S t,s σ(), σ 2 (),..., σ k () (4) σ( t,s ) (5) h h To ttr illustrt our irst rursiv ormul, lt us in minin th rursiv strutur o th ol list L 4,4 n thn omprin it to th CoolCt list S 4,4. Th trm ol rrs to th t tht th strins in B t,s r in inrsin liorphi orr whn h strin is r rom riht to lt. Th ol list L 4,4 n uilt rursivl rom th smllr lists L 3,i or i 3. Eh o ths lists pprs s olumn within Fiur 4. Noti tht in h olumn th suis innin with 1 r unrlin, n ll o th strins with ivn unrlin sui ppr onsutivl. In th s o L 4,4 (whr t s) th suis innin with 1 r 1, 1, 1, n 1. Noti tht thr is no sui 1 sin thr is no strin in B 4,4 with tht sui. Howvr, th sui 1 os ppr in L 3,2 (whr t > s) sin thr is strin with tht sui in B 3,2. Finll, in h s th suis r orr rsin numr o zros. In nrl h o ths osrvtions hols tru, n it ls to th ollowin rursiv ormul or L t,s Fiur 3: Th trs orrsponin to This is n mpl o Cs (). { Lt 1, 1 s, L t 1,1 1 s 1,..., L t 1,s 1 1 i t s L t 1, 1 s, L t 1,1 1 s 1,..., L t 1,s 1 i t > s. To ompt prssions o this kin w introu to omin short lists o strins into lrr lists, n w rstt th rursiv ormul or L t,s s ollows s 1 L t 1,i 1 s i i t s (6) i L t,s s L t 1,i 1 s i i t > s. (6) i Now w turn our ttntion to th rursiv strutur o W 4,4 tht is illustrt in Fiur 5. As in ol th suis innin with 1 r unrlin n

4 L 3, L 3,1 L 3,2 L 3,3 L 4, Fiur 4: Th rursiv strutur o ol. W 3, W 3,1 W 3,2 W 3,3 W 4, Fiur 5: Th irst rursiv strutur o CoolCt. th strins with ivn unrlin sui ppr onsutivl within h list. Howvr, in this s th suis innin with 1 r orr rsin numr o zros, pt or th sui 1 s tht pprs lst inst o irst. O ours, thr is onl sinl strin in B t,s tht hs th sui 1 s, nml 1 t s. Amzinl, th ltrnt plmnt o this sinl strin ull pturs th irn twn th rursiv strutur o CoolCt n ol. W in th list W t,s s ollows, n w prov tht it is qul to S t,s in Thorm 1 s 1 W t 1,i 1 s i, 1 t s W t,s s W t 1,i 1 s i, 1 t s i t s (7) i t > s.(7) Sin th rursiv strutur o W t,s is rorrin o th strins in L t,s w hv th ollowin rmrk. mrk 1. W t,s ontins h strin in B t,s tl on. An importnt stp towrs provin Thorm 1 is th ollowin lmm, tht pliitl intiis th irst n lst strins tht ppr in W t,s whn s >. Lmm 1. For s > irst(w t,s ) 11 t 1 s 1 (8) lst(w t,s ) 1 t s. (9) Proo. Th vlu o lst(w t,s ) ollows immitl rom (7). To trmin th vlu o irst(w t,s ) w hv th ollowin irst(w t,s ) irst(w t 1,1 )1 s 1 irst(w t 2,1 )11 s 1 irst(w t 3,1 )111 s 1... irst(w 1,1 )1 t 1 s 1 11 t 1 s 1. Now w r in position to prov th min rsult o this stion. Thorm 1. S t,s W t,s. Proo. To prov th rsult w n to show tht within W t,s th irst strin in h sulist is otin pplin σ to th lst strin o th prvious sulist. Th sulists in W t,s r slihtl irnt pnin on whthr t s (7) or t > s (7), so w pro in two ss. First w prov th rsult whn t > s. For th lst trnsition w hv σ(lst(w t 1,s 1)) σ(1 t 1 s 1) 1 t s whih ollows rom Lmm 1 n th inition o σ (1). For th rminin trnsitions w hv, or 1 i s 1, σ(lst(w t 1,s i 1 i )) σ(1 t 1 s i 1 i ) 11 t 2 s i 1 i 1 irst(w t 1,s i+1 1 i 1 ) whih ollows rom Lmm 1 n th inition o σ (2). In prtiulr, (2) pplis hr sin t > s n i 1 impl tht t 1 > s i. Nt w prov th rsult whn t s. For th lst trnsition w hv σ(lst(w t 1,s 1 1)) σ(1 t 1 s 1 1) 1 t s whih ollows rom Lmm 1 n th inition o σ (2). In prtiulr, (2) pplis hr sin t s. For th rminin ss w hv, or 1 i s 2, σ(lst(w t 1,s i 1 i )) σ(1 t 1 s i 1 i ) 11 t 2 s i 1 i 1 irst(w t 1,s i+1 1 i 1 whih ollows rom Lmm 1 n th inition o σ (2). In prtiulr, (2) pplis hr sin t s n i 2 impl tht t 1 > s i. Thorm 1 llows us to show tht th itrtiv inition o CoolCt prous lists tht r irulr. Tht is, in oth t,s n S t,s, th irst strin n otin pplin σ to th lst strin. Mor nrll w hv th ollowin orollr. Corollr 1. For n B t,s n k B t,s σ k (). Proo. W n prov this rsult showin tht th list S t,s is irulr. This provs th sttmnt o th orollr n lso provs tht t,s is irulr (4)

5 n (3). W omplish our ol throuh th ollowin hin o qulitis tht rrn Thorm 1, Lmm 1, n (1) σ(lst(s t,s )) σ(lst(w t,s )) σ(1 t s ) 11 t 1 s 1 irst(w t,s ) irst(s t,s ). Thorm 1 lso llows us to prov tht th itrtiv inition o CoolCt nrts vr strin in B t,s. Corollr 2. t,s n S t,s ontin h strin in B t,s tl on. Proo. Th rsult or S t,s ollows rom mrk 1 n Thorm 1. Th rsult or t,s ollows rom th t tht σ k (1 t s ) 1 t s or k B t,s Corollr 1, n thus t,s is rorrin o S t,s (3) n (4). Althouh th rursiv inition o W t,s hs its nits, somtims it is mor onvnint to work with rursiv inition tht ontins wr trms. For mpl, in Stion 5 w rnk th orr o th strins within CoolCt utilizin th ollowin inition K t,s 1 i t s K t,s K t 1,s 1, 1 t 1 1 i s 1 K t,s 1, K t 1,s 1, 1 t 1 s 1 i 1 < s < t. (1) In Thorm 2 w prov tht K t,s is intil to W t,s pt tht it is missin th strin 1 t s. Th proo is involv, so w provi n illustrtion or h o th thr ss o (1) in Fiur 6. In h olumn th ovrlin n unrlin strins not whthr th numr o zros or ons r in rursivl rs, rsptivl. Strins without n ovrlin or unrlin r o th orm 1 t 1 s 1 n r not involv in th nt lowr lvl o rursion, whil th strins low th horizontl lin r o th orm 1 t s n rprsnt th uniqu strin tht is in W t,s ut is not in K t,s. For th sk o svin sp w onl prou th olumns with smllr numr o zros, until th numr o zros quls on. K 3,1 K 4,1 K 4,2 K 4,3 K 4, Fiur 6: Th son rursiv strutur or CoolCt. Thorm 2. W t,s K t,s, 1 t s. Proo. W prov th rsult oul inution. Th irst inution will on th numr o zros, n th son inution will on th numr o ons. For th s s o th irst inution w hv s 1 n it is s to vri tht W t,1 t 1 i 1 t i t 1 1 i 1 t i, 1 t K t,1, 1 t. Now suppos tht s k > 1 n tht th thorm hols or ll s < k. At this point w strt our son inution. For th s s o th son inution w hv t k. In othr wors th numr o ons is qul to th numr o zros, whih is th minimum possil numr o ons. W hv th ollowin prssion or W k,k k 1 k 1 ( k 1 W k 1,i 1 k i, 1 k k W k 1,i 1 k 1 i, 1 k k 1 (W k,k 1 ) W k 1,i 1 k 1 i, 1 k k 1 ) (K k,k 1, 1 k k 1 ) K k,k 1, 1 k k K k,k, 1 k k. Now to ontinu with th son inution w suppos tht t k + j, or som j >, n tht th thorm hols or ll t < k + j. In othr wors, w r supposin tht thr r j mor ons thn zros, n tht th thorm hols whn thr r wr thn j itionl ons. Thn w hv th ollowin prssion or W k+j,k k W k+j 1,i 1 k i, 1 k+j k k 1 ( k 1 W k+j 1,i 1 k i, W k+j 1,k 1, 1 k+j k W k+j 1,i 1 k 1 i ), W k+j 1,k 1, 1 k+j k. Th rkt prout hs wr thn k zros n quls W k+j,k 1 pt tht it is missin 1 k+j k 1 s its lst strin. Thror, th irst inution K k+j,k 1, W k+j 1,k 1, 1 k+j k. Th son trm hs wr thn k+j ons. Thror, th son inution w ontinu s ollows K k+j,k 1, (K k+j 1,k, 1 k+j 1 k )1, 1 k+j k K k+j,k 1, K k+j 1,k 1, 1 k+j 1 k 1, 1 k+j k K k+j,k, 1 k+j k. This omplts th inutiv s o th son inution, n so th thorm is tru or s k n ll t k. This omplts th inutiv s o th irst inution, n so th thorm is tru or ll s 1.

6 Bor losin this stion w pliitl stt th irst n lst strins o t,s sin it will usul in th nt stion. Lmm 2. For s > irst( t,s ) 1 t s { 1 lst( t,s ) t 1 s 1 1 i t s 1 t 1 s 1 i t > s. 4 Alorithm In this stion w prsnt n lorithm to nrt t,s. Tht is, w prsnt n lorithm tht itrtivl visits h sussiv strin in th CoolCt orrin strtin with 1 t s. Th lorithm is rmrkl iint in trms o tim n stor. In prtiulr it is looplss in th sns tht h sussiv strin is nrt in O(1) tim, n it is onstnt tr-sp in th sns tht it uss O(1) stor whn luin th rr tht hols th inr strin. Th rr uss 1-s inin, so [1] is th irst vlu in th rr. For proposition P, th nottion [[P ]] mns 1 i P is tru n i P is ls. As in Stion 2, th vril is us to rprsnt th position o 1 in th ltmost 1. Howvr, th vril is now us to rprsnt th position o th ltmost. Th initil vlus o n o not o this rul, n th r hosn simpl or th sk o th irst itrtion. Th initil vlu 1 t s is visit th visit() ommn on lin 5, whil ll othr vlus o ontin ltmost 1 n r visit on lin 21. W s tht h itrtion strts t th whil sttmnt on lin 6. Durin h itrtion thr r thr possil routs throuh th i sttmnts n ths thr routs orrspon tl to th ss rom Stion 2. I 1 p q 11α (s ()) t th strt o n itrtion thn th outr i sttmnt on lin 11 is not ntr. I 1 p p 1α (s ()) thn th innr i sttmnt on lin 12 is ntr. I 1 p q 1α or p > q (s ()) thn th innr ls sttmnt is ntr. Th nrl i o th lorithm is to mintin n n to us thir vlus, n th vlus o [] n [], to trmin how ns to hn rom on itrtion to th nt. CoolCt(t, s) quir: t s > 1: n t + s 2: rr(1 t s ) 3: t 4: t 5: visit() 6: whil < n [t s]] o 7: [] 8: [] 1 9: + 1 1: : i [] 12: i 2 2 { Cs () } 13: : ls 15: [] 1 { Cs () } 16: [2] 17: 3 18: 2 19: n 2: n { ls Cs () } 21: visit() 22: n To prov th orrtnss o th lorithm w trk th vlus o th thr vrils rom on visit ll to th nt visit. W lt 1, 2,... rprsnt th vlus tkn vril t h susqunt visit, n w us th sm onvntion or n. For mpl, 1 will th irst n onl vlu o visit t lin 5, whil 2 will th irst vlu o visit t lin 21. Whn i is th smllst vlu whr i [ i ] thn w will s tht i is orrt. Likwis whn i is th smllst vlu whr i [ i ] 1 n i > i thn w will s tht i is orrt. For onvnin w lso lt V t,s 1, 2,..., k whr k is th lst vlu o tht is visit or th prorm trmints. Ultimtl w will show tht th prorm os in t trmint, n tht V t,s t,s (Thorm 3). W rr to th urrnt vlus o,, n s th urrnt oniurtion. From lins 2-4 w s tht 1 1 t s, 1 t n 1 t, so th initil oniurtion or ntrin th whil loop is 1 t s t t. B Lmm 2, irst( t,s ) 1 t s so is initiliz to th orrt vlu. Th prorm trmints on n (t s) (lin 6), whr (t s) quls on i t s, n zro othrwis. In othr wors, i t s thn CoolCt trmints on n 1, n othrwis it trmints on n. ll tht this onition hos th two ss o (7). Finll, w point out CoolCt s pliit rquirmnt tht t s >. Th nt two lmms will rss th irst two itrtions o th lorithm. Lmm 3. V t,s t,s whn t 2. Proo. It is s to vri tht V 1,1 1, V 2,1 11, 11, n V 2,2 11, 11. In th irst s th prorm os not ntr th whil loop n in th lst two ss th prorm trmints tr th whil loop s irst itrtion. Lmm 4. I t > 2 thn 2 σ( 1 ), 2 3, n 2 2. Proo. Whn t > 2 th prorm ntrs th whil loop n tr lins 7-1 w hv th ollowin oniurtion 1 t s t + 1 t + 1. Sin [] [t + 1] th prorm ntrs th outr i sttmnt on lin 11. Sin t > 2 it os not ntr th innr i sttmnt on lin 12 n so lins 15 n 16 r ut to iv th ollowin oniurtion 11 t s t + 1 t + 1. Atr lin 17 n lin 18 w hv th ollowin oniurtion 11 t 1 s Sin th nt lin to ut is visit sttmnt w hv 2 11 t 1 s 1. Thror, w hv provn th rsult sin 1 1 t s n σ(1 t s ) 11 t 1 s 1 (1). Th nt lmm plins how th lorithm trmints (th vlus or lst( t,s ) r rll rom Lmm 2). Lmm 5. I t > 1, vr i B t,s, n i is orrt thn { 1 lst(v t,s ) lst( t,s ) t 1 s 1 1 i t s 1 t 1 s 1 i t > s

7 Proo. Whn t s, th onition on th whil loop is < n 1. I k 1 t 1 s 1 1 n k is upt orrtl thn k n 1, so on k is visit th prorm will trmint. Furthrmor, (6) w hv tht i < n 1 or ll i k sin th ssumption ll i B t,s. Whn t > s, th onition on th whil loop is < n. I k 1 t 1 s 1 n k is upt orrtl thn k n, so on k is visit th prorm will trmint. Furthrmor, (6) w hv tht i < n or ll i k sin th ssumption ll i B t,s. Now tht th trm ss o CoolCt hv n ount or, w n ous on th nrl hvior o th lorithm. In prtiulr, 1 t s n 1 t 1 s 1 hv n lt with in Lmm 4 n Lmm 5 rsptivl, so w n onl onsir th hvior o th lorithm on inr strins tht ontin ltmost 1 n t lst on itionl smol ollowin it. In othr wors, w ssum tht 11 p q 1z... whr z {, 1}. From Stion 3 w rll our itrtiv inition or σ() { 111 p q z... i p q n z (11) 1z1 p q 1... i p > q or z 1. (11) Noti tht whn z 1 thn th lt si o (11) n (11) r intil. Thror, w n intrhn thir rols whn th onition o z 1 is stisi. Thus, th onitions in (11) n (11) n quivlntl stt s p q n p > q, rsptivl. In t, th onitions wr oriinll stt this w in (2) n (2); w mk th hn hr sin it optimizs th loi o th rsultin prorm. Anothr w o sttin th quivln is tht i 11 p p thn it os not mttr i w mov th (2p + 3)r smol or th (2p + 4)th smol sin oth r qul to 1. W now r l to omplt this stion with thr lmms. Th irst two lmms orrspon to (11) (ss () n () rsptivl), whil th thir lmm orrspons to (11) (s ()). Lmm 6. Suppos z 1, so tht i 11 p q I i n i r orrt, thn i+1 σ( i ) n i+1 n i+1 r orrt. Proo. From th sttmnt o th lmm, w n ssum tht th urrnt oniurtion pprs low n th prorm just stisi th onition o th whil loop 11 p q p + 2 p + q + 3. Atr utin lins 7-1 th urrnt oniurtion oms 11 p 1 q 1... p + 3 p + q + 4. Sin [] 1 th prorm os not ntr th i sttmnt on lin 11 n so i+1, i+1, n i+1 r qul to thir rsptiv vlus ov. From (11), σ( i ) i+1. Furthrmor, th vlus o i+1 n i+1 r orrt. Lmm 7. Suppos p > q n z, so tht i 11 p q 1... with p > q. I i n i r orrt, thn i+1 σ( i ) n i+1 n i+1 r orrt. Proo. From th sttmnt o th lmm, w n ssum tht th urrnt oniurtion pprs low n th prorm just stisi th onition o th whil loop 11 p q 1... p + 2 p + q + 3. Atr utin lins 7-1 th urrnt oniurtion oms 11 p 1 q... p + 3 p + q p q... Sin [] th prorm ntrs th i sttmnt on lin 11. Sin 2 2 woul impl tht p+q +4 2p + 4 n thus p q, thn th i sttmnt on lin 12 is not ntr. Atr utin lins 15 throuh 18 th oniurtion oms 11 p q At this point th prorm mks th nt visit in lin 21, so i+1, i+1, n i+1 r qul to thir rsptiv vlus ov. From (11), σ( i ) i+1. Furthrmor, th vlu o i+1 is orrt. Finll, th vlu o i+1 is lso orrt sin p >. Lmm 8. Suppos p q n z, so tht i 11 p p I i n i r orrt, thn i+1 σ( i ) n i+1 n i+1 r orrt. Proo. From th sttmnt o th lmm, w n ssum tht th urrnt oniurtion pprs low n th prorm just stisi th onition o th whil loop 11 p p 1... p + 2 2p + 3. Atr utin lins 7-1 th urrnt oniurtion oms 11 p 1 p... p + 3 2p + 4. Sin [] th prorm ntrs th i sttmnt on lin 11. Sin 2 2 th prorm ntrs th i sttmnt on lin 12. Atr utin lin 13 th urrnt oniurtion oms 11 p 1 p... p + 3 2p + 5. At this point th prorm mks th nt visit in lin 21, so i+1, i+1, n i+1 r qul to thir rsptiv vlus ov. From (11), σ( i ) i+1. Furthrmor, th vlu o i+1 is orrt. Howvr, n w rtin tht th vlu o i+1 is orrt? Noti tht th pliitl ispl portion o in th ov oniurtion ontins n qul numr o 1s n s. Hn, th nt smol must 1, n so th vlu o i+1 is lso orrt. Th rsult o Lmms 3-8 is tht CoolCt(t, s) orrtl visits n upts irst( t,s ), n thn orrtl visits n upts vr othr strin in t,s up to n inluin lst( t,s ) tr whih it trmints. Thror, w hv th ollowin thorm. Thorm 3. For ll t s >, w hv V t,s t,s. 5 nkin In this stion w vlop rnkin lorithm tht uss O(n) rithmti oprtions. W will n to know th numr o lmnts in K t,s, whih w not K t,s B t,s 1. Tl 1 shows K t,s or s t 8. Thorm 4. For ll s t, K t,s + 1 t s + 1 ( ) ( t + s t + s t + 1 t t ) ( ) t + s. t + 1

8 Tl 1: Th Ctln( trinl. Th row t, olumn s ntr is K t,s t s+1 t+s ) t+1 t Proo. Ths r wll-known proprtis o th Ctln trinl (Knuth (26), Stnl (1999)). Lt 2 t+s 1 B t,s. W us ρ() to not th rnk o in th list K t,s. Hr is rursiv sription o th rnkin pross; it ollows irtl rom (1). Lt 2 t+s 2. ρ( ) i t+s 1 ρ() K t,s 1 i 1 t 1 s 1 K t 1,s + ρ( ) othrwis. For mpl, ρ(1111) K 4,2 + ρ(111) 8 + ρ(111) 8 + K 3,1 + ρ(11) ρ(11) 1 + K 2,1 1 1 (12) Not tht (12) inors trilin s; th rnk thror pns onl on th positions o th 1s. I 1, 2,..., t r th positions oupi th 1s n q is th minimum vlu or whih q > q, thn (12) n itrt to otin ρ( t ) K q,q q 1 + t jq+1 K j,j j 1. (13) W now show tht thr is ni w to viw th rnkin pross s wlk on rtin intr ltti. r to Fiur 7. Th wlk strts t th uppr lt; h 1 is vrtil stp own n h is horizontl stp to th riht. Th vrtil s r ll, whr th t-th row o vrtil s (ountin rom 1) ts ll s ollows rom lt-to-riht: (no ll), K t,, K t,1,..., K t,t 1. Th ll urthst to th riht in h row is not on n. Fiur 7 illustrts th pth or th itstrin Th squr mrks th npoint o th prt o th pth tht ns t th ltmost 1; i., th strin 1111 in th mpl itstrin. Th rnk o th itstrin is otin summin th lls on th pth tr th squr, in th ll on th to th riht o th on tht prs th squr (th irl ll in th iur), n thn sutrtin 1. Thus ρ( ) To unrnk w rvrs th pross. W us ρ 1 t,s (m) to not th strin B t,s whos rnk in K t,s is m. Suppos, or mpl, tht w wnt th rnk 212 itstrin with t 8 n s 6; i.., ρ 1 (8,6)(212). W strt whr th mpl pth ns. W mov to th lt so lon s th lls th rminin rnk, Fiur 7: nkin thn mov up n rpt. Arrivin t th ol squr, w r t n impss; th rminin rnk is 7, so w hv t to nountr th squr. So w so up n th rnk oms 4, whih is wht rmins i w mk th urrnt lotion (on mov ov th ol squr) th nw squr. Thus ρ 1 (8,6)(212) W lv it to th rr to turn this sription into n lorithm. Wht is th runnin tim o th rnkin lorithm? Lt n t+s. Not tht (12) n (13) involv O(n) itions n othr oprtions. W n voi omputin th ntir tl onl omputin th vlus n lon th pth. First omput K t,s, whih tks O(n) rithmti oprtions. Thn mk us o th ollowin rltions whih n hk usin Thorm 4: 1 + K t 1,s 1 + K t,s 1 (t + 1)(t s) (t s + 1)(t + s) (1 + K t,s) n s(t s + 2) (t s + 1)(t + s) (1 + K t,s). O ours, i mn rnkin/unrnkin oprtions r in prorm thn it will ttr to pr-omput th K t,s tl. 6 Finl mrks For utur rsrh, it woul intrstin to trmin whthr th rsults o this ppr n tn to th nturl /1 rprsnttion o k-r trs, or to orr trs with prsri r squn (Zks & ihrs (1979)). W thnk th rrs or rull rin this ppr n pointin out numr o tpos n pls whr th position oul improv. rns B. Bultn & F. usk (1998), An Es-MK Alorithm or Wll-Form Prnthsis Strins, Inormtion Prossin Lttrs, 68, pp Donl E. Knuth (25), Th Art o Computr Prormmin, Volum 4: Gnrtin ll Comintions n Prtitions, Fsil 3, Aison-Wsl, 15 ps.

9 Donl E. Knuth (25), Th Art o Computr Prormmin, Volum 4: Gnrtin ll Trs; Histor o Comintiontoril Gnrtion, Fsil 4, Aison-Wsl, 12 ps. J. Korsh, P. LFoltt, & S. Lipshutz (23), Looplss Alorithms n Shrör Trs, Intrntionl Journl o Computr Mthmtis, 8, pp J. Lus, D. olnts, n F. usk (1993), On ottions n th Gnrtion o Binr Trs, Journl o Alorithms, 15, pp A.. Mtos, F.A.A. Pinho, A. Silvir-Nto & V. Vjnovszki (1998), On th Looplss Gnrtion o Binr Tr Squns, Inormtion Prossin Lttrs, 68, pp D. olnts (1991), A Looplss Alorithm or Gnrtin Binr Tr Squns, Inormtion Prossin Lttrs, 39, pp F. usk (1979), Simpl omintoril Gr os onstrut rvrsin sulists, 4th ISAAC (Intrntionl Smposium on Alorithms n Computtion), Ltur Nots in Computr Sin, #762, pp F. usk n A. Proskurowski (199), Gnrtin Binr Trs Trnspositions, Journl o Alorithms, 11, pp F. usk & A. Willims (25), Gnrtin Comintions B Pri Shits, Computin n Comintoris, 11th Annul Intrntionl Conrn, COCOON 25, Kunmin, Chin, Auust 16-29, 25, Proins. Ltur Nots in Computr Sin 3595, Sprinr-Vrl. F. usk n A. Willims (28), Th Coolst w to Gnrt Comintions, Disrt Mthmtis, to ppr, 28..P. Stnl (1999)Enumrtiv Comintoris, vol. 2, Cmri Univrsit Prss, Nw York/Cmri, 1999, ii ps..p. Stnl (27), Ctln Anum, vrsion o 2 Jun 27; 61 ps, T. Tkok (1999), O(1) Tim Alorithms or Comintoril Gnrtion Tr Trvrsl, Th Computr Journl, vol. 42, no. 5, pp T. Tkok & S. Violih (26), Comintoril Gnrtion Fusin Looplss Alorithms, In Pro. Twlth Computin: Th Austrlsin Thor Smposium (CATS26), Hort, Austrli. C- PIT, 51. Gumunsson, J. n J, B., Es., ACS V. Vjnovszki & T. Wlsh (26), A looplss twolos Gr-o lorithm or listin k-r Dk Wors, Journl o Disrt Alorithms, Vol. 4, No. 4, pp Wlsh, A Simpl Squnin An nkin Mtho Tht Works On Almost All Gr Cos, Unpulish srh port, Dprtmnt o Mthmtis n Computr Sin, UQAM P.O. Bo 8888, Sttion A, Montrl, Qu, Cn H3C 3P8, 68 ps. T.. Wlsh (23), Gnrtin Gr os in O(1) worst-s tim pr wor, Ltur Nots in Computr Sin 2731, Proins o th 4h Intrntionl Conrn, Disrt Mthmtis n Thortil Computr Sin 23, Dijon, Frn, Jul 7-12, 23, Sprinr-Vrl, Nw York, (23), S. Zks & D. ihrs (1979), Gnrtin Trs n Othr Comintoril Ojts Liorphill, SIAM J. Computin, 8, pp

1 Introduction to Modulo 7 Arithmetic

1 Introduction to Modulo 7 Arithmetic 1 Introution to Moulo 7 Arithmti Bor w try our hn t solvin som hr Moulr KnKns, lt s tk los look t on moulr rithmti, mo 7 rithmti. You ll s in this sminr tht rithmti moulo prim is quit irnt rom th ons w

More information

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management nrl tr T is init st o on or mor nos suh tht thr is on sint no r, ll th root o T, n th rminin nos r prtition into n isjoint susts T, T,, T n, h o whih is tr, n whos roots r, r,, r n, rsptivly, r hilrn o

More information

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology! Outlin Computr Sin 331, Spnnin, n Surphs Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #30 1 Introution 2 3 Dinition 4 Spnnin 5 6 Mik Joson (Univrsity o Clry) Computr Sin 331 Ltur #30 1 / 20 Mik

More information

Present state Next state Q + M N

Present state Next state Q + M N Qustion 1. An M-N lip-lop works s ollows: I MN=00, th nxt stt o th lip lop is 0. I MN=01, th nxt stt o th lip-lop is th sm s th prsnt stt I MN=10, th nxt stt o th lip-lop is th omplmnt o th prsnt stt I

More information

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim's Alorithm Introution Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #33 3 Alorithm Gnrl Constrution Mik Joson (Univrsity o Clry)

More information

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim s Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #34 Introution Min-Cost Spnnin Trs 3 Gnrl Constrution 4 5 Trmintion n Eiiny 6 Aitionl

More information

Outline. Binary Tree

Outline. Binary Tree Outlin Similrity Srh Th Binry Brnh Distn Nikolus Austn nikolus.ustn@s..t Dpt. o Computr Sins Univrsity o Slzur http://rsrh.uni-slzur.t 1 Binry Brnh Distn Binry Rprsnttion o Tr Binry Brnhs Lowr Boun or

More information

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura Moul grph.py CS 231 Nomi Nishimur 1 Introution Just lik th Python list n th Python itionry provi wys of storing, ssing, n moifying t, grph n viw s wy of storing, ssing, n moifying t. Bus Python os not

More information

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely . DETERMINANT.. Dtrminnt. Introution:I you think row vtor o mtrix s oorint o vtors in sp, thn th gomtri mning o th rnk o th mtrix is th imnsion o th prlllppi spnn y thm. But w r not only r out th imnsion,

More information

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE! Points miss: Stunt's Nm: Totl sor: /100 points Est Tnnss Stt Univrsity Dprtmnt o Computr n Inormtion Sins CSCI 2710 (Trno) Disrt Struturs TEST or Sprin Smstr, 2005 R this or strtin! This tst is los ook

More information

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS C 24 - COMBINATIONAL BUILDING BLOCKS - INVST 3 DCODS AND NCODS FALL 23 AP FLZ To o "wll" on this invstition you must not only t th riht nswrs ut must lso o nt, omplt n onis writups tht mk ovious wht h

More information

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE! Points miss: Stunt's Nm: Totl sor: /100 points Est Tnnss Stt Univrsity Dprtmnt of Computr n Informtion Sins CSCI 710 (Trnoff) Disrt Struturs TEST for Fll Smstr, 00 R this for strtin! This tst is los ook

More information

CS September 2018

CS September 2018 Loil los Distriut Systms 06. Loil los Assin squn numrs to msss All ooprtin prosss n r on orr o vnts vs. physil los: rport tim o y Assum no ntrl tim sour Eh systm mintins its own lol lo No totl orrin o

More information

Constructive Geometric Constraint Solving

Constructive Geometric Constraint Solving Construtiv Gomtri Constrint Solving Antoni Soto i Rir Dprtmnt Llngutgs i Sistms Inormàtis Univrsitt Politèni Ctluny Brlon, Sptmr 2002 CGCS p.1/37 Prliminris CGCS p.2/37 Gomtri onstrint prolm C 2 D L BC

More information

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem Thorm 10-1: Th Hnshkin Thorm Lt G=(V,E) n unirt rph. Thn Prt 10. Grphs CS 200 Alorithms n Dt Struturs v V (v) = 2 E How mny s r thr in rph with 10 vrtis h of r six? 10 * 6 /2= 30 1 Thorm 10-2 An unirt

More information

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs Orniztion Domintors, ontrol-pnn n SSA orm Domintor rltion o CFGs postomintor rltion Domintor tr Computin omintor rltion n tr Dtlow lorithm Lnur n Trjn lorithm Control-pnn rltion SSA orm Control-low rphs

More information

Designing A Concrete Arch Bridge

Designing A Concrete Arch Bridge This is th mous Shwnh ri in Switzrln, sin y Rort Millrt in 1933. It spns 37.4 mtrs (122 t) n ws sin usin th sm rphil mths tht will monstrt in this lsson. To pro with this lsson, lik on th Nxt utton hr

More information

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS OMPLXITY O OUNTING PLNR TILINGS Y TWO RS KYL MYR strt. W show tht th prolm o trmining th numr o wys o tiling plnr igur with horizontl n vrtil r is #P-omplt. W uil o o th rsults o uquir, Nivt, Rmil, n Roson

More information

Garnir Polynomial and their Properties

Garnir Polynomial and their Properties Univrsity of Cliforni, Dvis Dprtmnt of Mthmtis Grnir Polynomil n thir Proprtis Author: Yu Wng Suprvisor: Prof. Gorsky Eugny My 8, 07 Grnir Polynomil n thir Proprtis Yu Wng mil: uywng@uvis.u. In this ppr,

More information

CS 461, Lecture 17. Today s Outline. Example Run

CS 461, Lecture 17. Today s Outline. Example Run Prim s Algorithm CS 461, Ltur 17 Jr Si Univrsity o Nw Mxio In Prim s lgorithm, th st A mintin y th lgorithm orms singl tr. Th tr strts rom n ritrry root vrtx n grows until it spns ll th vrtis in V At h

More information

EE1000 Project 4 Digital Volt Meter

EE1000 Project 4 Digital Volt Meter Ovrviw EE1000 Projt 4 Diitl Volt Mtr In this projt, w mk vi tht n msur volts in th rn o 0 to 4 Volts with on iit o ury. Th input is n nlo volt n th output is sinl 7-smnt iit tht tlls us wht tht input s

More information

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am 16.unii Introution to Computrs n Prormmin SOLUTIONS to Exmintion /30/0 9:05m - 10:00m Pro. I. Kristin Lunqvist Sprin 00 Grin Stion: Qustion 1 (5) Qustion (15) Qustion 3 (10) Qustion (35) Qustion 5 (10)

More information

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V Unirt Grphs An unirt grph G = (V, E) V st o vrtis E st o unorr gs (v,w) whr v, w in V USE: to mol symmtri rltionships twn ntitis vrtis v n w r jnt i thr is n g (v,w) [or (w,v)] th g (v,w) is inint upon

More information

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018 CSE 373: Mor on grphs; DFS n BFS Mihl L Wnsy, F 14, 2018 1 Wrmup Wrmup: Disuss with your nighor: Rmin your nighor: wht is simpl grph? Suppos w hv simpl, irt grph with x nos. Wht is th mximum numr of gs

More information

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs. Pths.. Eulr n Hmilton Pths.. Pth D. A pth rom s to t is squn o gs {x 0, x 1 }, {x 1, x 2 },... {x n 1, x n }, whr x 0 = s, n x n = t. D. Th lngth o pth is th numr o gs in it. {, } {, } {, } {, } {, } {,

More information

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013 CS Avn Dt Struturs n Algorithms Exm Solution Jon Turnr //. ( points) Suppos you r givn grph G=(V,E) with g wights w() n minimum spnning tr T o G. Now, suppos nw g {u,v} is to G. Dsri (in wors) mtho or

More information

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph Intrntionl J.Mth. Comin. Vol.1(2014), 80-86 Algorithmi n NP-Compltnss Aspts of Totl Lit Domintion Numr of Grph Girish.V.R. (PES Institut of Thnology(South Cmpus), Bnglor, Krntk Stt, Ini) P.Ush (Dprtmnt

More information

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s? MATH 3012 Finl Exm, My 4, 2006, WTT Stunt Nm n ID Numr 1. All our prts o this prolm r onrn with trnry strings o lngth n, i.., wors o lngth n with lttrs rom th lpht {0, 1, 2}.. How mny trnry wors o lngth

More information

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017 MAT3707/201/1/2017 Tutoril lttr 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS MAT3707 Smstr 1 Dprtmnt o Mtmtil Sins SOLUTIONS TO ASSIGNMENT 01 BARCODE Din tomorrow. univrsity o sout ri SOLUTIONS TO ASSIGNMENT

More information

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes. Nm: UCA ID Numr: Stion lttr: th 61 : Disrt Struturs Finl Exm Instrutor: Ciprin nolsu You hv 180 minuts. No ooks, nots or lultors r llow. Do not us your own srth ppr. 1. (2 points h) Tru/Fls: Cirl th right

More information

CS 241 Analysis of Algorithms

CS 241 Analysis of Algorithms CS 241 Anlysis o Algorithms Prossor Eri Aron Ltur T Th 9:00m Ltur Mting Lotion: OLB 205 Businss HW6 u lry HW7 out tr Thnksgiving Ring: Ch. 22.1-22.3 1 Grphs (S S. B.4) Grphs ommonly rprsnt onntions mong

More information

0.1. Exercise 1: the distances between four points in a graph

0.1. Exercise 1: the distances between four points in a graph Mth 707 Spring 2017 (Drij Grinrg): mitrm 3 pg 1 Mth 707 Spring 2017 (Drij Grinrg): mitrm 3 u: W, 3 My 2017, in lss or y mil (grinr@umn.u) or lss S th wsit or rlvnt mtril. Rsults provn in th nots, or in

More information

The University of Sydney MATH2969/2069. Graph Theory Tutorial 5 (Week 12) Solutions 2008

The University of Sydney MATH2969/2069. Graph Theory Tutorial 5 (Week 12) Solutions 2008 Th Univrsity o Syny MATH2969/2069 Grph Thory Tutoril 5 (Wk 12) Solutions 2008 1. (i) Lt G th isonnt plnr grph shown. Drw its ul G, n th ul o th ul (G ). (ii) Show tht i G is isonnt plnr grph, thn G is

More information

Problem solving by search

Problem solving by search Prolm solving y srh Tomáš voo Dprtmnt o Cyrntis, Vision or Roots n Autonomous ystms Mrh 5, 208 / 3 Outlin rh prolm. tt sp grphs. rh trs. trtgis, whih tr rnhs to hoos? trtgy/algorithm proprtis? Progrmming

More information

Trees as operads. Lecture A formalism of trees

Trees as operads. Lecture A formalism of trees Ltur 2 rs s oprs In this ltur, w introu onvnint tgoris o trs tht will us or th inition o nroil sts. hs tgoris r gnrliztions o th simpliil tgory us to in simpliil sts. First w onsir th s o plnr trs n thn

More information

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review rmup CSE 7: AVL trs rmup: ht is n invrint? Mihl L Friy, Jn 9, 0 ht r th AVL tr invrints, xtly? Disuss with your nighor. AVL Trs: Invrints Intrlu: Exploring th ln invrint Cor i: xtr invrint to BSTs tht

More information

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1. Why th Juntion Tr lgorithm? Th Juntion Tr lgorithm hris Willims 1 Shool of Informtis, Univrsity of Einurgh Otor 2009 Th JT is gnrl-purpos lgorithm for omputing (onitionl) mrginls on grphs. It os this y

More information

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2 Grt Thortil Is In Computr Sin Vitor Amhik CS 15-251 Ltur 9 Grphs - II Crngi Mllon Univrsity Grph Isomorphism finition. Two simpl grphs G n H r isomorphi G H if thr is vrtx ijtion V H ->V G tht prsrvs jny

More information

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12 Aministrivi: CS61B Ltur #33 Autogrr will run this vning. Toy s Rings: Grph Struturs: DSIJ, Chptr 12 Lst moifi: W Nov 8 00:39:28 2017 CS61B: Ltur #33 1 Why Grphs? For xprssing non-hirrhilly rlt itms Exmpls:

More information

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

CSC Design and Analysis of Algorithms. Example: Change-Making Problem CSC 801- Dsign n Anlysis of Algorithms Ltur 11 Gry Thniqu Exmpl: Chng-Mking Prolm Givn unlimit mounts of oins of nomintions 1 > > m, giv hng for mount n with th lst numr of oins Exmpl: 1 = 25, 2 =10, =

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} Introution Computr Sin & Enginring 423/823 Dsign n Anlysis of Algorithms Ltur 03 Elmntry Grph Algorithms (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) I Grphs r strt t typs tht r pplil to numrous

More information

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees /1/018 W usully no strns y ssnn -lnt os to ll rtrs n t lpt (or mpl, 8-t on n ASCII). Howvr, rnt rtrs our wt rnt rquns, w n sv mmory n ru trnsmttl tm y usn vrl-lnt non. T s to ssn sortr os to rtrs tt our

More information

Seven-Segment Display Driver

Seven-Segment Display Driver 7-Smnt Disply Drivr, Ron s in 7-Smnt Disply Drivr, Ron s in Prolm 62. 00 0 0 00 0000 000 00 000 0 000 00 0 00 00 0 0 0 000 00 0 00 BCD Diits in inry Dsin Drivr Loi 4 inputs, 7 outputs 7 mps, h with 6 on

More information

Multipoint Alternate Marking method for passive and hybrid performance monitoring

Multipoint Alternate Marking method for passive and hybrid performance monitoring Multipoint Altrnt Mrkin mtho or pssiv n hyri prormn monitorin rt-iool-ippm-multipoint-lt-mrk-00 Pru, Jul 2017, IETF 99 Giuspp Fiool (Tlom Itli) Muro Coilio (Tlom Itli) Amo Spio (Politnio i Torino) Riro

More information

d e c b a d c b a d e c b a a c a d c c e b

d e c b a d c b a d e c b a a c a d c c e b FLAT PEYOTE STITCH Bin y mkin stoppr -- sw trou n pull it lon t tr until it is out 6 rom t n. Sw trou t in witout splittin t tr. You soul l to sli it up n own t tr ut it will sty in pl wn lt lon. Evn-Count

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} s s of s Computr Sin & Enginring 423/823 Dsign n Anlysis of Ltur 03 (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) s of s s r strt t typs tht r pplil to numrous prolms Cn ptur ntitis, rltionships twn

More information

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp CSE 373 Grphs 1: Conpts, Dpth/Brth-First Srh ring: Wiss Ch. 9 slis rt y Mrty Stpp http://www.s.wshington.u/373/ Univrsity o Wshington, ll rights rsrv. 1 Wht is grph? 56 Tokyo Sttl Soul 128 16 30 181 140

More information

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms rp loritms lrnin ojtivs loritms your sotwr systm sotwr rwr lrn wt rps r in mtmtil trms lrn ow to rprsnt rps in omputrs lrn out typil rp loritms wy rps? intuitivly, rp is orm y vrtis n s twn vrtis rps r

More information

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths. How os it work? Pl vlu o imls rprsnt prts o whol numr or ojt # 0 000 Tns o thousns # 000 # 00 Thousns Hunrs Tns Ons # 0 Diml point st iml pl: ' 0 # 0 on tnth n iml pl: ' 0 # 00 on hunrth r iml pl: ' 0

More information

CMSC 451: Lecture 2 Graph Basics Thursday, Aug 31, 2017

CMSC 451: Lecture 2 Graph Basics Thursday, Aug 31, 2017 Dv Mount CMSC 45: Ltur Grph Bsis Thursy, Au, 07 Rin: Chpt. in KT (Klinr n Tros) n Chpt. in DBV (Dsupt, Ppimitriou, n Vzirni). Som o our trminoloy irs rom our txt. Grphs n Dirphs: A rph G = (V, E) is strutur

More information

Numbering Boundary Nodes

Numbering Boundary Nodes Numring Bounry Nos Lh MBri Empori Stt Univrsity August 10, 2001 1 Introution Th purpos of this ppr is to xplor how numring ltril rsistor ntworks ffts thir rspons mtrix, Λ. Morovr, wht n lrn from Λ out

More information

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

Similarity Search. The Binary Branch Distance. Nikolaus Augsten. Similrity Srh Th Binry Brnh Distn Nikolus Augstn nikolus.ugstn@sg..t Dpt. of Computr Sins Univrsity of Slzurg http://rsrh.uni-slzurg.t Vrsion Jnury 11, 2017 Wintrsmstr 2016/2017 Augstn (Univ. Slzurg) Similrity

More information

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1 CSC 00 Disrt Struturs : Introuon to Grph Thory Grphs Grphs CSC 00 Disrt Struturs Villnov Univrsity Grphs r isrt struturs onsisng o vrs n gs tht onnt ths vrs. Grphs n us to mol: omputr systms/ntworks mthml

More information

Planar Upward Drawings

Planar Upward Drawings C.S. 252 Pro. Rorto Tmssi Computtionl Gomtry Sm. II, 1992 1993 Dt: My 3, 1993 Sri: Shmsi Moussvi Plnr Upwr Drwings 1 Thorm: G is yli i n only i it hs upwr rwing. Proo: 1. An upwr rwing is yli. Follow th

More information

OpenMx Matrices and Operators

OpenMx Matrices and Operators OpnMx Mtris n Oprtors Sr Mln Mtris: t uilin loks Mny typs? Dnots r lmnt mxmtrix( typ= Zro", nrow=, nol=, nm="" ) mxmtrix( typ= Unit", nrow=, nol=, nm="" ) mxmtrix( typ= Int", nrow=, nol=, nm="" ) mxmtrix(

More information

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem) 12/3/12 Outlin Prt 10. Grphs CS 200 Algorithms n Dt Struturs Introution Trminology Implmnting Grphs Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 1 Ciruits Cyl 2 Eulr

More information

A 4-state solution to the Firing Squad Synchronization Problem based on hybrid rule 60 and 102 cellular automata

A 4-state solution to the Firing Squad Synchronization Problem based on hybrid rule 60 and 102 cellular automata A 4-stt solution to th Firing Squ Synhroniztion Prolm s on hyri rul 60 n 102 llulr utomt LI Ning 1, LIANG Shi-li 1*, CUI Shung 1, XU Mi-ling 1, ZHANG Ling 2 (1. Dprtmnt o Physis, Northst Norml Univrsity,

More information

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs Prt 10. Grphs CS 200 Algorithms n Dt Struturs 1 Introution Trminology Implmnting Grphs Outlin Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 2 Ciruits Cyl A spil yl

More information

Section 10.4 Connectivity (up to paths and isomorphism, not including)

Section 10.4 Connectivity (up to paths and isomorphism, not including) Toy w will isuss two stions: Stion 10.3 Rprsnting Grphs n Grph Isomorphism Stion 10.4 Conntivity (up to pths n isomorphism, not inluing) 1 10.3 Rprsnting Grphs n Grph Isomorphism Whn w r working on n lgorithm

More information

Limits Indeterminate Forms and L Hospital s Rule

Limits Indeterminate Forms and L Hospital s Rule Limits Indtrmint Forms nd L Hospitl s Rul I Indtrmint Form o th Tp W hv prviousl studid its with th indtrmint orm s shown in th ollowin mpls: Empl : Empl : tn [Not: W us th ivn it ] Empl : 8 h 8 [Not:

More information

12. Traffic engineering

12. Traffic engineering lt2.ppt S-38. Introution to Tltrffi Thory Spring 200 2 Topology Pths A tlommunition ntwork onsists of nos n links Lt N not th st of nos in with n Lt J not th st of nos in with j N = {,,,,} J = {,2,3,,2}

More information

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings PAGES Primry Primry Mths Bsis Sris THE SUBTRACTION BOOK A prorssion o sutrtion skills writtn y Jillin Cokins INTRODUCTION This ook is intn to hlp sur th mthmtil onpt o sutrtion in hilrn o ll s. Th mstry

More information

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA.

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA. S i m p l i y i n g A l g r SIMPLIFYING ALGEBRA www.mthltis.o.nz Simpliying SIMPLIFYING Algr ALGEBRA Algr is mthmtis with mor thn just numrs. Numrs hv ix vlu, ut lgr introus vrils whos vlus n hng. Ths

More information

Complete Solutions for MATH 3012 Quiz 2, October 25, 2011, WTT

Complete Solutions for MATH 3012 Quiz 2, October 25, 2011, WTT Complt Solutions or MATH 012 Quiz 2, Otor 25, 2011, WTT Not. T nswrs ivn r r mor omplt tn is xpt on n tul xm. It is intn tt t mor omprnsiv solutions prsnt r will vlul to stunts in stuyin or t inl xm. In

More information

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1 Solutions for HW Exris. () Us th rurrn rltion t(g) = t(g ) + t(g/) to ount th numr of spnning trs of v v v u u u Rmmr to kp multipl gs!! First rrw G so tht non of th gs ross: v u v Rursing on = (v, u ):

More information

Walk Like a Mathematician Learning Task:

Walk Like a Mathematician Learning Task: Gori Dprtmnt of Euction Wlk Lik Mthmticin Lrnin Tsk: Mtrics llow us to prform mny usful mthmticl tsks which orinrily rquir lr numbr of computtions. Som typs of problms which cn b on fficintly with mtrics

More information

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f lulu jwtt pnlton sin towr ounrs hpl lpp lu Our irst non-linr t strutur! rph G onsists o two sts G = {V, E} st o V vrtis, or nos st o E s, rltionships twn nos surph G onsists o sust o th vrtis n s o G jnt

More information

BASIC CAGE DETAILS D C SHOWN CLOSED TOP SPRING FINGERS INNER WALL TABS ARE COINED OVER BASE AND COVER FOR RIGIDITY

BASIC CAGE DETAILS D C SHOWN CLOSED TOP SPRING FINGERS INNER WALL TABS ARE COINED OVER BASE AND COVER FOR RIGIDITY SI TIS SOWN OS TOP SPRIN INRS INNR W TS R OIN OVR S N OVR OR RIIITY. R IMNSIONS O INNR SIN TO UNTION WIT QU SM ORM-TOR (zqsp+) TRNSIVR. R. RR S OPTION (S T ON ST ) TURS US WIT OPTION T SINS. R (INSI TO

More information

1. Determine whether or not the following binary relations are equivalence relations. Be sure to justify your answers.

1. Determine whether or not the following binary relations are equivalence relations. Be sure to justify your answers. Mth 0 Exm - Prti Prolm Solutions. Dtrmin whthr or not th ollowing inry rltions r quivln rltions. B sur to justiy your nswrs. () {(0,0),(0,),(0,),(,),(,),(,),(,),(,0),(,),(,),(,0),(,),(.)} on th st A =

More information

Polygons POLYGONS.

Polygons POLYGONS. Polgons PLYGNS www.mthltis.o.uk ow os it work? Solutions Polgons Pg qustions Polgons Polgon Not polgon Polgon Not polgon Polgon Not polgon Polgon Not polgon f g h Polgon Not polgon Polgon Not polgon Polgon

More information

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality: CS2: Grphs Prihr Ch. 4 Rosn Ch. Grphs A olltion of nos n gs Wht n this rprsnt? n A omputr ntwork n Astrtion of mp n Soil ntwork CS2 - Hsh Tls 2 Dirt Grphs Grphs/Ntworks Aroun Us A olltion of nos n irt

More information

Two Approaches to Analyzing the Permutations of the 15 Puzzle

Two Approaches to Analyzing the Permutations of the 15 Puzzle Two Approhs to Anlyzin th Prmuttions o th 15 Puzzl Tom How My 2017 Astrt Th prmuttions o th 15 puzzl hv n point o ous sin th 1880 s whn Sm Lloy sin spin-o o th puzzl tht ws impossil to solv. In this ppr,

More information

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari Grphs CSC 1300 Disrt Struturs Villnov Univrsity Grphs Grphs r isrt struturs onsis?ng of vr?s n gs tht onnt ths vr?s. Grphs n us to mol: omputr systms/ntworks mthm?l rl?ons logi iruit lyout jos/prosss f

More information

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas SnNCutCnvs Using th Printl Stikr Funtion On-o--kin stikrs n sily rt y using your inkjt printr n th Dirt Cut untion o th SnNCut mhin. For inormtion on si oprtions o th SnNCutCnvs, rr to th Hlp. To viw th

More information

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms 0/0/ CS/ENGRD 0 Ojt- Orint Prormmin n Dt Strutur Fll 0 Dou Jm Ltur 9: DFS, BFS & Shortt Pth Toy Rhility Dpth-Firt Srh Brth-Firt Srh Shortt Pth Unwiht rph Wiht rph Dijktr lorithm Rhility Alorithm Dpth Firt

More information

MULTIPLE-LEVEL LOGIC OPTIMIZATION II

MULTIPLE-LEVEL LOGIC OPTIMIZATION II MUTIPE-EVE OGIC OPTIMIZATION II Booln mthos Eploit Booln proprtis Giovnni D Mihli Don t r onitions Stnfor Univrsit Minimition of th lol funtions Slowr lgorithms, ttr qulit rsults Etrnl on t r onitions

More information

BASIC CAGE DETAILS SHOWN 3D MODEL: PSM ASY INNER WALL TABS ARE COINED OVER BASE AND COVER FOR RIGIDITY SPRING FINGERS CLOSED TOP

BASIC CAGE DETAILS SHOWN 3D MODEL: PSM ASY INNER WALL TABS ARE COINED OVER BASE AND COVER FOR RIGIDITY SPRING FINGERS CLOSED TOP MO: PSM SY SI TIS SOWN SPRIN INRS OS TOP INNR W TS R OIN OVR S N OVR OR RIIITY. R TURS US WIT OPTION T SINS. R (UNOMPRSS) RR S OPTION (S T ON ST ) IMNSIONS O INNR SIN TO UNTION WIT QU SM ORM-TOR (zqsp+)

More information

Graph Algorithms and Combinatorial Optimization Presenters: Benjamin Ferrell and K. Alex Mills May 7th, 2014

Graph Algorithms and Combinatorial Optimization Presenters: Benjamin Ferrell and K. Alex Mills May 7th, 2014 Grp Aloritms n Comintoril Optimiztion Dr. R. Cnrskrn Prsntrs: Bnjmin Frrll n K. Alx Mills My 7t, 0 Mtroi Intrstion In ts ltur nots, w mk us o som unonvntionl nottion or st union n irn to kp tins lnr. In

More information

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals Intgrtion Continud Intgrtion y Prts Solving Dinit Intgrls: Ar Undr Curv Impropr Intgrls Intgrtion y Prts Prticulrly usul whn you r trying to tk th intgrl o som unction tht is th product o n lgric prssion

More information

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e)

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e) POW CSE 36: Dt Struturs Top #10 T Dynm (Equvln) Duo: Unon-y-Sz & Pt Comprsson Wk!! Luk MDowll Summr Qurtr 003 M! ZING Wt s Goo Mz? Mz Construton lortm Gvn: ollton o rooms V Conntons twn t rooms (ntlly

More information

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim MULTIPLE STITCHES Nrtiti Ehos o Rgl omponnts vok visions o th pst sign y Hln Tng-Lim Us vrity o stiths to rt this rgl yt wrl sign. Prt sping llows squr s to mk roun omponnts tht rp utiully. FCT-SC-030617-07

More information

SOLVED EXAMPLES. be the foci of an ellipse with eccentricity e. For any point P on the ellipse, prove that. tan

SOLVED EXAMPLES. be the foci of an ellipse with eccentricity e. For any point P on the ellipse, prove that. tan LOCUS 58 SOLVED EXAMPLES Empl Lt F n F th foci of n llips with ccntricit. For n point P on th llips, prov tht tn PF F tn PF F Assum th llips to, n lt P th point (, sin ). P(, sin ) F F F = (-, 0) F = (,

More information

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths Dt Strutur LECTURE Shortt pth lgorithm Proprti of hortt pth Bllmn-For lgorithm Dijktr lgorithm Chptr in th txtook (pp ). Wight grph -- rminr A wight grph i grph in whih g hv wight (ot) w(v i, v j ) >.

More information

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael.

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael. 0 Computr i Dsign or Eltroni Systms Ciruit Moling n si Grph Conptslgorithms Instrutor: Mri K. Mihl MKM - Ovrviw hviorl vs. Struturl mols Extrnl vs. Intrnl rprsnttions Funtionl moling t Logi lvl Struturl

More information

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem) 4/25/12 Outlin Prt 10. Grphs CS 200 Algorithms n Dt Struturs Introution Trminology Implmnting Grphs Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 1 2 Eulr s rig prolm

More information

The University of Sydney MATH 2009

The University of Sydney MATH 2009 T Unvrsty o Syny MATH 2009 APH THEOY Tutorl 7 Solutons 2004 1. Lt t sonnt plnr rp sown. Drw ts ul, n t ul o t ul ( ). Sow tt s sonnt plnr rp, tn s onnt. Du tt ( ) s not somorp to. ( ) A onnt rp s on n

More information

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions ulty o Mtmtis Wtrloo, Ontrio N ntr or ution in Mtmtis n omputin r / Mt irls Mr /, 0 rp Tory - Solutions * inits lln qustion. Tr t ollowin wlks on t rp low. or on, stt wtr it is pt? ow o you know? () n

More information

Greedy Algorithms, Activity Selection, Minimum Spanning Trees Scribes: Logan Short (2015), Virginia Date: May 18, 2016

Greedy Algorithms, Activity Selection, Minimum Spanning Trees Scribes: Logan Short (2015), Virginia Date: May 18, 2016 Ltur 4 Gry Algorithms, Ativity Sltion, Minimum Spnning Trs Sris: Logn Short (5), Virgini Dt: My, Gry Algorithms Suppos w wnt to solv prolm, n w r l to om up with som rursiv ormultion o th prolm tht woul

More information

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, * CmSc 365 Thory of Computtion Finit Stt Automt nd Rgulr Exprssions (Chptr 2, Sction 2.3) ALPHABET oprtions: U, conctntion, * otin otin Strings Form Rgulr xprssions dscri Closd undr U, conctntion nd * (if

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Grdy mthods Prudn Wong http://www.s.liv..uk/~pwong/thing/omp108/01617 Coin Chng Prolm Suppos w hv 3 typs of oins 10p 0p 50p Minimum numr of oins to mk 0.8, 1.0, 1.? Grdy mthod Lrning outoms Undrstnd wht

More information

Module 2 Motion Instructions

Module 2 Motion Instructions Moul 2 Motion Instrutions CAUTION: Bor you strt this xprimnt, unrstn tht you r xpt to ollow irtions EXPLICITLY! Tk your tim n r th irtions or h stp n or h prt o th xprimnt. You will rquir to ntr t in prtiulr

More information

Tangram Fractions Overview: Students will analyze standard and nonstandard

Tangram Fractions Overview: Students will analyze standard and nonstandard ACTIVITY 1 Mtrils: Stunt opis o tnrm mstrs trnsprnis o tnrm mstrs sissors PROCEDURE Skills: Dsriin n nmin polyons Stuyin onrun Comprin rtions Tnrm Frtions Ovrviw: Stunts will nlyz stnr n nonstnr tnrms

More information

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation A Simpl Co Gnrtor Co Gnrtion Chptr 8 II Gnrt o for singl si lok How to us rgistrs? In most mhin rhitturs, som or ll of th oprnsmust in rgistrs Rgistrs mk goo tmporris Hol vlus tht r omput in on si lok

More information

Section 3: Antiderivatives of Formulas

Section 3: Antiderivatives of Formulas Chptr Th Intgrl Appli Clculus 96 Sction : Antirivtivs of Formuls Now w cn put th is of rs n ntirivtivs togthr to gt wy of vluting finit intgrls tht is ct n oftn sy. To vlut finit intgrl f(t) t, w cn fin

More information

Tableau algorithms defined naturally for pictures

Tableau algorithms defined naturally for pictures 1 Introution Tblu lorithms in nturlly or piturs Mr A. A. vn Luwn CWI Kruisln 413 1098 SJ Amstrm Th Nthrlns mil: M.vn.Luwn@wi.nl Abstrt W onsir piturs s in in [Zl1]. W lbort on th nrlistion o th Robinson-Shnst

More information

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata 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

More information

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski Dut with Dimons Brlt DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Lsli Roglski Photo y Anrw Wirth Supruo DUETS TM from BSmith rt olor shifting fft tht mks your work tk on lif of its own s you mov! This

More information

Binomials and Pascal s Triangle

Binomials and Pascal s Triangle Binomils n Psl s Tringl Binomils n Psl s Tringl Curriulum R AC: 0, 0, 08 ACS: 00 www.mthltis.om Binomils n Psl s Tringl Bsis 0. Intif th prts of th polnomil: 8. (i) Th gr. Th gr is. (Sin is th highst

More information

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW Smll Pth Quiz ML n Dtss Cn you giv n xprssion tht rturns th lst / irst ourrn o h istint pri lmnt? Ltur 8 Strming Evlution: how muh mmory o you n? Sstin Mnth NICTA n UNSW

More information

DETAIL B DETAIL A 7 8 APPLY PRODUCT ID LABEL SB838XXXX ADJ FOUR POST RACK SQUARE HOLE RAIL B REVISION

DETAIL B DETAIL A 7 8 APPLY PRODUCT ID LABEL SB838XXXX ADJ FOUR POST RACK SQUARE HOLE RAIL B REVISION RVISION RV SRIPTION Y T HNG NO NOT OR PROUT LL JJH // LR TIL PPLY PROUT I LL TIL INSI UPPR ROSS MMR ON PR RK IS J OUR POST RK SQUR HOL RIL IS MN MS G NUT, PNL RNG 99 PPLY PROUT I LL INSI UPPR ROSS MMR

More information