CS 542 Avn Dt Stutu n Alotm Exm 2 Soluton Jontn Tun 4/2/202. (5 ont) Con n oton on t tton t tutu n w t n t 2 no. Wt t mllt num o no tt t tton t tutu oul ontn. Exln you nw. Sn n mut n you o u t n t, t n o t oot mut t lt 20. Sn t n t mot l n, w mut v t lt 2 20 no. In t O(m lo lo n) nly o t tton t tutu, w n t noton o omnnt no. Suo t tton t tutu 6 mllon no. I t oot o t t nvolv n t ov n oton n o 30, wt t mxmum num o no lon t n t tt oul omnnt? Exln you nw. T Δ vlu o t omnnt no mut n y mo tn to o >2 you o own t n t om t oot. Sn t t omnnt no mut v Δ, t nxt mut Δ 3, t nxt mut v Δ 7 n t nxt mut v Δ 5. I t w not omnnt no, t woul v Δ 3, ut t not ol, vn tt t n o t oot 30. So, t n t mot 4 omnnt no. In t, n t ot no v Δ o t lt, vn ou omnnt no too mny to t n o t oot om xn 30. Wt 3 omnnt no, w n v 7 nonomnnt no wt Δ o. An t to 37 v 28, w mll tn t vn oot n o 30. So t mxmum num o omnnt no 3. Con no x wt n(x)=0 n n((x))=8. Suo w om t oton nvolvn no x n x not omnnt mmtly o o t n oton. Wt t mllt ol vlu tt n((x)) n v t t t n oton v omlt? Exln you nw. E o t n mut n t Δ(x) y t lt to o 3/2. So, t t n n t om 8 to t lt 8(3/2) 3 =27. Sn n(x)=0, t lo mn tt n((x)) t lt 27.
2 2. (2 ont) T m low ow tl ntton o n ntmt tt n t xuton o t ntommon nto lotm. In t tt, w no on?, n on, Wt t nt on nto o o t no, n n? no()=, no(n)=, no()= Fo w t lotm omut t n vlu t t ont? {,t}, {,} Sow ow t tton n t t unt uv ll to t n unton tun Ptton m n n t t m : {,), {,t}, {,}, {,}, {,} t n t m
3. (2 ont) T m low ow tl ntton o t tt o t ounon lotm. Slly, t ow t, t t n t ltt (wt y n n omtt). 4 4 () 3 5 2 5 m m 6 2 4 3 2 m m 3 2 4 3 m () () () Lt t t n y t tton t tutu o t tt. Fo t n t tton, l t nonl lmnt. T nonl lmnt unln n t t t t: {,}, {,}, {,,}, {,,,,m} In t m ov w n X tou ll no n () tt on lt y t lotm. T lt no t ummy no t t to, lu ot, ot, ot I t t ontnn t t ont o t ounon uu t t ont n tm. Lt t ut o () tt tun y t u mto n t nmn oton t t tt o t mn loo. Alo, ow t tt tun y t y mto, wtn nmn. 3
4. (5 ont) T u low ow n ntmt t n t xuton o Emon lotm o nn mxmum z mtn. T mtn not own xltly, ut nt ont own n t tton t tutu own. B n m Dw lo uv oun t vtx t w om loom n t unt. M t o t loom wt B. M vn vt wt lu n n o vt wt mnu n. Int w n t unt mtn, y mn tm wt n M. I {,} o nxt, n umntn t oun. Lt t vt n tt umntn t. nm B 4
5. (20 ont) In t nly o t ott umntn t lotm, w n lvl (u) to t lnt o t ott t om to u n t ul, t t t umntn t. A t lotm o, lvl (t) n t vou ont n w n n to t o twn two uv n to lvl (t). Wt t lt num o tt t ott umntn t lotm wll xut on unt ntwo wt n vt n m? Exln you nw. 2(n2) /2 on t nly o Dn lotm, n t n oon tly to t u n Dn lotm. Suo tt o vn lvl (t) =. Gv n u oun on t num o umntn t t n tt. (Hnt: n unt ntwo, n two umntn t oun n t m tou t m vtx?) Exln you nw. E no n only u on n, n ut on nomn o outon n t t ll. Conuntly, t num o umntn t n t t mot (n2)/ Now, v n u oun on t tm nt nn umntn t o lnt. Sn umntn t t O(m) tm, t totl tm nt O(mn/) Now, u t ult om t lt two t to v n u oun on t totl tm nt y t ott umntn t lotm on unt ntwo. I N t mx num o, t unnn tm O(mn(/2/3.../N))=O(mn lo N) =O(mn lo n). 5
6. (8 ont) Con t ny t own low. I t ll ln ny t ( l t). I o, ow vlu o t n tt ty t nvnt on t n. I not, ow ow t n m ln wt nl otton n ow t o n tt ty t nvnt o t t t t otton oton. It not ll ln ny t. I t w, t n() woul v to t lt 2, n o to ontnt wt t n()=. But t ml n() mut t lt 3 n tt ontt t t tt t tmot nl (t xtnl no w t t l o ) n o 0. T t low otn y on t otton t t oot n t n own ty t nvnt on t n. 2 2 2 6
7. (20 ont) In t nly o t lutn ny t, tn num o t llot to ly. Suo tt 25 t llot to ly t no x. Wt t mllt ol num o no n t t? Exln you nw. I t oot o t t tn t num o llot t 3(n() n(x). Sn t num 25, t n n n twn x n 8. T ml tt n() t lt 8. In t ontxt, t n o no t loo o t l o t num o nnt tt t. Hn t num o no t lt 256. Wt t n to t vlu o n(x) ult o t ly? Exln you nw. At t ly, x t oot o t t, o t t m n tt onlly. So, t n(x) n y 8. Suo tt ly t no x tn ly t, ll o w nvolv oulotton. Suo tt o x o t ly t, ((x)) t m n x n o t mnn t t n o ((x)) ul to n(x)3. I C t num o t n to mntn t t nvnt o t ly, n C 2 t num n t t ly, v low oun on t n C C 2. Exln you nw. Fom t nly o t lutn t, w now tt wn w o oul otton wt n(x)=n(((x))), t lt on t l (tt, w n t lt on w t t t t tn w o t t). So, t 6 t o w n(x)=n(((x))), l t lt 6 t. W lo now tt wn n(x)<n(((x))), tt t lt /3 o t t llot to t t l. E o t ou t wt n(((x)))=n(x)3 9 t llot to t. Sn 3 o t no lon n t t t, w n totl o 2 t om t t. Comnn t ult, w v tt C C 2 t lt 8. 7