1 (12 points) Red-Black trees and Red-Purple trees
|
|
- Jodie Bridges
- 5 years ago
- Views:
Transcription
1 CS6 Hoework 3 Due: 29 April 206, 2 oo Subit o Gradescope Haded out: 22 April 206 Istructios: Please aswer the followig questios to the best of your ability. If you are asked to desig a algorith, please describe it clearly ad cocisely, prove its correctess, ad aalyze its ruig tie. If you are asked to show your work, please iclude relevat calculatios for derivig your aswer. If you are asked to explai your aswer, give a short setece) ituitive descriptio of your aswer. If you are asked to prove a result, please write a coplete proof at the level of detail ad rigor expected i prior CS Theory classes i.e. 03). Whe writig proofs, please strive for clarity ad brevity i that order). Cite ay sources you referece. 2 poits) Red-Black trees ad Red-Purple trees It s Barr the Bear s birthday! To celebrate, he decides to save the plaet... by platig trees! I particular, he wats to plat Red-Black trees RB trees) i his garde. Ufortuately, Barr the Bear s birthday coicides with Prak Day celebrated by the peguis, ad Poe the Pegui has bee up to soe ischief. He praks the RB trees ito Red-Purple trees RP trees) by alterig the structure of the trees i soe way. a) 3 pts) If you believe a tree is a valid RB tree, provide a valid colorig for the tree to covice Barr to keep it. Otherwise, cocisely prove why there is o valid colorig to covice Barr to destroy it. b) 3 pts) If you believe a tree is a valid RB tree, provide a valid colorig for the tree to covice Barr to keep it. Otherwise, cocisely prove why there is o valid colorig to covice Barr to destroy it.
2 c) After reovig the RP trees, Barr ow wats to upgrade his RB tree show below by isertig the uber 6 ito it. Show how this ca be doe such that after the isertio it reais to be a valid RB tree. For full-credit, you should show iterediate steps i.e., by showig how the tree is beig trasfored ito the fial oe) by drawig a few trees poits) The followig sequece of operatios are perfored whe we isert 6. ) Isert a ew red ode with 6 as key as a left child of the ode with 200 as key. 2) Right-rotate aroud the ode with 200 as key. 3) Re-color the ode with 6 50, resp.) as key to black red, res.). 4) Left-rotate aroud the ode with 50 as key. 5) This results i a valid RB-tree. To receive a full credit, you eed to show all iterediate steps by drawig the trees with proper keys ad colors; steps 3-4 ca be erged ito oe tree, though). The trees are show o the last page of this solutio due to space). 2 4 poits) Terary Search Trees o 2D Plae I this proble, we will be talkig about terary search trees TST). Terary search trees are siilar to biary search trees but rather tha havig just 2 poiters left ad right), they have 3 poiters left, iddle, ad right). A TST T is a terary tree i which each ode cotais a poit of the for x, y) for soe x, y Z. Moreover, o two poits i T ca share the sae x value ad o two poits ca share the sae y value. The the followig properties hold for every ode u with key x, y) i ay TST: Ay poit x L, y L ) i the left-subtree of u has x L < x ad y L < y. Ay poit x M, y M ) i the iddle-subtree of u has x M > x ad y M < y. Ay poit x R, y R ) i the right-subtree of u has x R > x ad y R > y. Clarificatio: You ca assue that for ay ode v i TST T, you ca copute the uber of odes that belog to the subtree of v i tie O) e.g., it is stored as part of TST). a) Prove or disprove: For ay set of distict poits where o two poits share the sae x-coordiate or y-coordiate), there exists a terary search tree T o these poits with ht ) = Of)): i) whe f) =, 2
3 ii) whe f) = log. To prove the clai, provide a cocise proof. To disprove the clai, provide a couterexaple. 3 poits) Stateet i) is true ad stateet ii) is false. 2 poits) To prove stateet i): Let S be ay set of poits. Let x, y ) be the poit i S with sallest x-coordiate. We ake the root ode cotaiig x, y ), ad let S R = {x, y) S : y > y } ad S M = {x, y) S : y < y }. Notice that {x, y )} S L S R = S ad they partitio S. We recursively build a subtree o S R ad ake it the right-subtree of the root ad also build a subtree o S M ad ake it the iddle-subtree of the root. Sice S =, the height of this tree is trivially O). To see this is a valid TST, by our costructio of S M of S R, resp.) all poits i the iddle-subtree right-subtree, resp.) satisfy the properties of TST at the root ode. I fact this stateet reais true at every ode i TST we build oe ca prove this by iductio o the uber of odes; we oit the details). Note that provig this clai for soe exaple tree would ot receive full credit. Also, provig by iductio o that oe ca isert a ew poit to a arbitrary TST is wrog, as the exaple for 2-a-ii shows.) poit) To disprove stateet ii): Cosider poits give by {i, i) : i [, ]}; that is, x-coordiates are icreasig i i ) ad y-coordiates are decreasig. Due to the properties of TST, it is easy to see that, ) ust be the root of ay valid TST that cotais these poits otherwise, if soe other poit i, i) is the root, the, ) caot belog to ay of its subtrees). All the other poits ow ust belog to the iddle subtree of, ). Repeatig this arguet, we ed up with a TST of height i which each ode that cotais i, i) has i, i )) as its paret uless i = ) ad has i +, i + )) as its iddle-child uless i = ). Note that disprovig this clai for soe exaple tree would ot receive full credit.) b) Suppose that you are give a poit x, y ) ad a TST T which cotais poits ad has height h. You wish to deterie whether x, y ) is cotaied i T or ot. Desig a efficiet algorith to solve this proble. Prove the correctess of the algorith. Aalyze its ruig tie i ters of ad also i ters of h. 4 poits) poit) Algorith: The followig recursive algorith works, give a ode of TST we would call SearchT.root)). v L, v M, v R deote the childre of v if they do ot exist, they are NILs). Algorith Searchv) : If [v = NIL] the retur FALSE 2: If [x, y) = x, y )] the retur TRUE 3: If [x < x) y < y)] the retur Searchv L ) 4: If [x > x) y < y)] the retur Searchv M ) 5: If [x > x) y > y)] the retur Searchv R ) 6: retur FALSE At this poit, x = x or y = y or x < x) y > y). Let 2 poits) Correctess: First, it is clear that if this algorith fids x, y ), the it does exist i TST due to Lie 2). We ow prove that if x, y ) exists i TST, the this algorith fids it. Together, they prove a if-ad-oly-if stateet). 3
4 We prove by iductio o the uber of poits i TST, assuig that x, y ) exists i T. If TST cotais oly oe ode, the the root ode ust cotai x, y ), ad thus Lie 2 will be correctly executed. Now assue that TST cotais poits. If the root ode of TST cotais x, y ), the Lie 2 will be executed correctly. Otherwise, oe of the descedats of the root ode ust cotai x, y ). Sice all poits i TST have distict x-coordiates, oly oe of the sub-trees of the root ode ca ad ust) cotai x, y ). Due to the properties of TST, x, y ) ust satisfy oe of the coditios listed i Lies 3-5; the three cases are pairwise exclusive, ad if x, y ) satisfies oe of the, the it caot belog to ay subtrees of the root, which is a cotradictio. Hece by iductive hypothesis whe we call our recursive algorith o oe of the child of the root, it will correctly fid x, y ) sice it subtree cotais at ost poits). Note: There are other ways to prove correctess.) poit) Ruig tie: I the worst case this algorith visits every ode, ad its ruig tie is O) a exaple of such TST is the oe fro previous part). I ters of h, this algorith traverses a path fro the root ode to a leaf ode i the worst case, ad thus we have Oh). c) Now, suppose that give a TST T o odes ad height h ad a poit x, y ), you wish to deterie the uber of poits x, y) i the tree such that x x ad y y. Give a recursive algorith that searches for these poits, startig fro the root of T. At each recursive step at a ode u of T, how ay childre of u does your algorith eed to recurse o i the worst case? Aalyze the worst case) rutie Uh) of your algorith i ters of h. What is the worst case) ruig tie i ters of whe h ca be arbitrary)? What would the ruig tie be i ters of if the tree is copletely balaced ad h = log 3? 7 poits) 3 poits) Algorith: The followig recursive algorith works, give a ode of TST we would call CoutT.root)). Let v L, v M, v R deote the childre of v if they do ot exist, they are NILs). Let cv) be the uber of odes belogig to the subtree that is rooted at v. Algorith 2 Coutv) : If [v = NIL] the retur 0 2: x, y) poit i v 3: If [x, y) = x, y )] the z 4: Else z 0 5: If [x x) y y)] the retur Coutv L ) + Coutv R ) + cv M ) + z 6: If [x x) y < y)] the retur Coutv L ) + Coutv M ) + z 7: If [x > x) y y)] the retur Coutv M ) + Coutv R ) + z 8: If [x > x) y < y)] the retur Coutv M ) + z poit) I the worst case the algorith recurses o at ost 2 childre of ay ode. Note: If your algorith recurses o at ost 3 childre i the worst case, you lose 3 poits for the algorith ad poit for this questio. You also receive 0 poits for part d).) poit) Rutie Uh) is O2 h ) because the brachig factor at each ode is 2 i.e., we recurse o at ost two odes fro each ode), ad the height of tree is h. Usig a recurrece relatio, we ca write it as Uh) 2Uh ) + O) i the worst case, both subtrees ca have height h ), which leads to Uh) = O2 h ).) poit) Rutie is O) if h ca be arbitrary because i the worst case we ust visit every ode). 4
5 poit) If the tree is copletely balaced, the we have h = log 3, ad the worst-case rutie is O2 h ) = O2 log 3 ) = O log 3 2 ) which is asyptotically better tha O), ad gives us a better upper boud i ters of ). d) Bous: 4 poits) Show that your ruig tie Uh) above is tight by providig a exaple tree ad iput poit that cause the algorith to use at least ΩUh)) tie. To show the tight boud, you ust show that for arbitrary there exists a valid TST o poits ad a poit x, y ) you ca choose your TST ad its poits as well as x, y )) such that the algorith i Part c) rus i ΩUh)) = Ω2 h ) tie. Ituitively we wat to have a TST such that at each o-leaf) ode our algorith recurses o two odes. There are three cases out of four) i which the algorith akes two recursive calls i our solutio, Lies 4-6). You ca pick ay, but choosig Lie 4 would be easiest choosig Lie 5 or Lie 6 ay lead to a uch ore coplicated way of costructig a exaple). Let us create a TST o odes as follows. Let x i, y i ) = i, i) for all i []. Notice that o two poits share the sae x or y coordiates. Let x /2, y /2 ) be the poit cotaied i the root ode of our TST if is ot eve, roudig up or dow does ot atter). Clearly, the poits with saller idex tha /2 ust all belog to the left-subtree of the root, ad the others to the right-subtree of the root; they are of equal sizes sice we picked the iddle oe, they differ by at ost ), ad we recursively choose the iddle oe as the root of each subtree, ad so o. This defies our TST. Note that it satisfies all three coditios o x, y-coordiates of poits i subtrees of each ode ad the coditio that o two poits ca share the sae x or y coordiate. The height of the TST is h = log. For the poit beig queried, we choose x, y ) = 0, + ) ay x < ad y > works, too). This esures that Lie 4 is executed at every o-leaf ode. Thus the tie that the algorith takes o this poit is Ω) Ω2 h ). Note: If your exaple does NOT lead to Ω2 h ) rutie for the correct algorith for Part c), the you get 0 poits for this part i particular, if your algorith for Part c) is wrog, the you are likely to receive o credit for this part). The rubric icluded i the solutio we posted earlier is out of date. Please refer to Gradescope s rubric istead.) 3 2 poits) Hash Table Cosider a hash table with buckets ad eleets hashed ito it. We will show that with high probability, the size of the largest bucket is goig to be very sall. We will assue that the hash fuctio beig cosidered satisfies the siple uifor hashig property. That is, the probability that a eleet is iserted ito ay of the buckets is / ad idepedet of the eleets already there. a) Let b i be the uber of eleets i the i-th bucket. The b i follows a bioial distributio. What are the paraeters of this distributio? What is E[b i ]? 4 poits) b i Bio, ), E[b i] =. b) Show that li Prax i b i l ) = 0. I other words, for sufficietly large, we ca be assured that with high probability, oe of the buckets will have ore tha l eleets hashed to the. You ay fid the followig iequalities helpful: The Cheroff Boud: If X is a bioially ) distributed rado variable with E[X] = µ, the for ay µ. e δ > 0, PrX + δ)µ) < δ +δ) +δ 5
6 The Uio Boud: Give evets A, A 2,... A, we have Pr i= A i) i= PrA i). I aother words, the probability of at least oe of the evets occurrig is at ost the total su of the idividual evet probabilities. 8 poits) Substitutig δ = l, ad µ = ito the Cheroff boud, we get Prb i l ) < e δ + δ) +δ = e e +δ + δ) +δ = e e l )l = e l ) l = e expl l ) l = e = e = e el l l l l l l ) Usig the uio boud, we see that ax i Prb i l ) Prb i l ) e 2 l l, which goes to 0 as goes to. Note: Oe coo error is to apply the Uio boud o the quatities li Prb i l )). 4 6 poits) Hash Table: Siple Uifor Hashig Poe the Pegui uderstads ad likes hash tables. Barr the Bear uderstads hash tables but does ot like chaiig. Help Barr choose the size of his hash table such that he would ot eed to worry about chaiig. Let be the uber of ites that Barr has ad be the size of his hash table to be deteried. We assue is sufficietly large ad is uch larger tha. Assue Barr s hash fuctio satisfies the siple uifor hashig property. a) What is the probability that a particular slot is epty after hashig ites? Derive a lower boud i the for of c 0 + c where c 0 ad c are costats. Hit: Take the two ost sigificat ters i the bioial expasio x + y) = j=0 j) x j y j. 3 poits) We choose c 0 = ad c =. The probability that a particular slot is epty is exactly ). We ca lower boud this as follows: ) = i=0 i ) = > ) i 2 ) ) ) ) sice the last ter i previous lie is positive) 6
7 ) ) i To obtai the iequality above, we eed to show that i=2 2 i > 0. It is sufficiet to prove the i 2 iequality ) i > i+) for i [2, ] because each positive ter would be followed by a egative ter saller tha it). ) ) i i + = = = ) i ) i i + ) ) i + ) i) i i + ) ) i + i)) > 0. i i + ) Note that >, ad therefore i) = + i > 0.) b) What is the probability that a particular slot has exactly oe ite? Derive a lower boud i the for of f) + f2) where f 2 ad f 2 are polyoial fuctios i. 3 poits) We choose f ) = ad f 2 ) = ). The probability that a particular slot has oe ite is exactly. ) Fro Part a), we kow that ) > whe > ). Hece, we ca lower boud this probability as follows: ) > ) = ) 2. c) Derive a upper boud o the probability that there exists a slot with at least two ites. Use the bouds fro Parts a) - b). 5 poits) The probability that a particular slot has at least two ites is ius the probability that it has either zero or oe ite. By Parts a) ad b), this is at ost ) ) ) ) 2 = 2. By the uio boud, the probability that there exists a slot out of slots) with at least two ites is at ost ). d) Let ɛ > 0 be give. Usig Part c), deterie i ters of ad ɛ, such that the probability that all slots have at ost oe ite o chaiig!) is at least / ɛ. Note: should be i the for gɛ) where g is a liear fuctio i ɛ. 5 poits) We choose = 2+ɛ or, gɛ) = 2 + ɛ). The, the probability that there exists a slot with at least two ites is at ost ) = 2 < 2 2+ɛ = / ɛ. The probability that all slots have at ost oe ite is 2+ɛ the at least / ɛ. 7
8 Trees for Q-c
CS 70 Second Midterm 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):
CS 70 Secod Midter 7 April 2011 NAME (1 pt): SID (1 pt): TA (1 pt): Nae of Neighbor to your left (1 pt): Nae of Neighbor to your right (1 pt): Istructios: This is a closed book, closed calculator, closed
More information19.1 The dictionary problem
CS125 Lecture 19 Fall 2016 19.1 The dictioary proble Cosider the followig data structural proble, usually called the dictioary proble. We have a set of ites. Each ite is a (key, value pair. Keys are i
More informationChapter 2. Asymptotic Notation
Asyptotic Notatio 3 Chapter Asyptotic Notatio Goal : To siplify the aalysis of ruig tie by gettig rid of details which ay be affected by specific ipleetatio ad hardware. [1] The Big Oh (O-Notatio) : It
More informationCS / MCS 401 Homework 3 grader solutions
CS / MCS 401 Homework 3 grader solutios assigmet due July 6, 016 writte by Jāis Lazovskis maximum poits: 33 Some questios from CLRS. Questios marked with a asterisk were ot graded. 1 Use the defiitio of
More informationTest One (Answer Key)
CS395/Ma395 (Sprig 2005) Test Oe Name: Page 1 Test Oe (Aswer Key) CS395/Ma395: Aalysis of Algorithms This is a closed book, closed otes, 70 miute examiatio. It is worth 100 poits. There are twelve (12)
More informationDiscrete Mathematics: Lectures 8 and 9 Principle of Inclusion and Exclusion Instructor: Arijit Bishnu Date: August 11 and 13, 2009
Discrete Matheatics: Lectures 8 ad 9 Priciple of Iclusio ad Exclusio Istructor: Arijit Bishu Date: August ad 3, 009 As you ca observe by ow, we ca cout i various ways. Oe such ethod is the age-old priciple
More informationAn Introduction to Randomized Algorithms
A Itroductio to Radomized Algorithms The focus of this lecture is to study a radomized algorithm for quick sort, aalyze it usig probabilistic recurrece relatios, ad also provide more geeral tools for aalysis
More informationECE 901 Lecture 4: Estimation of Lipschitz smooth functions
ECE 9 Lecture 4: Estiatio of Lipschitz sooth fuctios R. Nowak 5/7/29 Cosider the followig settig. Let Y f (X) + W, where X is a rado variable (r.v.) o X [, ], W is a r.v. o Y R, idepedet of X ad satisfyig
More informationThe Hypergeometric Coupon Collection Problem and its Dual
Joural of Idustrial ad Systes Egieerig Vol., o., pp -7 Sprig 7 The Hypergeoetric Coupo Collectio Proble ad its Dual Sheldo M. Ross Epstei Departet of Idustrial ad Systes Egieerig, Uiversity of Souther
More informationCOMP 2804 Solutions Assignment 1
COMP 2804 Solutios Assiget 1 Questio 1: O the first page of your assiget, write your ae ad studet uber Solutio: Nae: Jaes Bod Studet uber: 007 Questio 2: I Tic-Tac-Toe, we are give a 3 3 grid, cosistig
More informationCS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016
CS161: Algorithm Desig ad Aalysis Hadout #10 Staford Uiversity Wedesday, 10 February 2016 Lecture #11: Wedesday, 10 February 2016 Topics: Example midterm problems ad solutios from a log time ago Sprig
More informationOPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES
OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES Peter M. Maurer Why Hashig is θ(). As i biary search, hashig assumes that keys are stored i a array which is idexed by a iteger. However, hashig attempts to bypass
More informationRandomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)
Radomized Algorithms I, Sprig 08, Departmet of Computer Sciece, Uiversity of Helsiki Homework : Solutios Discussed Jauary 5, 08). Exercise.: Cosider the followig balls-ad-bi game. We start with oe black
More information4.3 Growth Rates of Solutions to Recurrences
4.3. GROWTH RATES OF SOLUTIONS TO RECURRENCES 81 4.3 Growth Rates of Solutios to Recurreces 4.3.1 Divide ad Coquer Algorithms Oe of the most basic ad powerful algorithmic techiques is divide ad coquer.
More informationProblem Set 2 Solutions
CS271 Radomess & Computatio, Sprig 2018 Problem Set 2 Solutios Poit totals are i the margi; the maximum total umber of poits was 52. 1. Probabilistic method for domiatig sets 6pts Pick a radom subset S
More informationMath 4707 Spring 2018 (Darij Grinberg): midterm 2 page 1. Math 4707 Spring 2018 (Darij Grinberg): midterm 2 with solutions [preliminary version]
Math 4707 Sprig 08 Darij Griberg: idter page Math 4707 Sprig 08 Darij Griberg: idter with solutios [preliiary versio] Cotets 0.. Coutig first-eve tuples......................... 3 0.. Coutig legal paths
More informationUniversity of Colorado Denver Dept. Math. & Stat. Sciences Applied Analysis Preliminary Exam 13 January 2012, 10:00 am 2:00 pm. Good luck!
Uiversity of Colorado Dever Dept. Math. & Stat. Scieces Applied Aalysis Prelimiary Exam 13 Jauary 01, 10:00 am :00 pm Name: The proctor will let you read the followig coditios before the exam begis, ad
More informationDefinitions: Universe U of keys, e.g., U N 0. U very large. Set S U of keys, S = m U.
7 7 Dictioary: S.isertx): Isert a elemet x. S.deletex): Delete the elemet poited to by x. S.searchk): Retur a poiter to a elemet e with key[e] = k i S if it exists; otherwise retur ull. So far we have
More informationLecture 10: Bounded Linear Operators and Orthogonality in Hilbert Spaces
Lecture : Bouded Liear Operators ad Orthogoality i Hilbert Spaces 34 Bouded Liear Operator Let ( X, ), ( Y, ) i i be ored liear vector spaces ad { } X Y The, T is said to be bouded if a real uber c such
More information(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3
MATH 337 Sequeces Dr. Neal, WKU Let X be a metric space with distace fuctio d. We shall defie the geeral cocept of sequece ad limit i a metric space, the apply the results i particular to some special
More informationLecture Outline. 2 Separating Hyperplanes. 3 Banach Mazur Distance An Algorithmist s Toolkit October 22, 2009
18.409 A Algorithist s Toolkit October, 009 Lecture 1 Lecturer: Joatha Keler Scribes: Alex Levi (009) 1 Outlie Today we ll go over soe of the details fro last class ad ake precise ay details that were
More informationBinomial transform of products
Jauary 02 207 Bioial trasfor of products Khristo N Boyadzhiev Departet of Matheatics ad Statistics Ohio Norther Uiversity Ada OH 4580 USA -boyadzhiev@ouedu Abstract Give the bioial trasfors { b } ad {
More informationIntegrals of Functions of Several Variables
Itegrals of Fuctios of Several Variables We ofte resort to itegratios i order to deterie the exact value I of soe quatity which we are uable to evaluate by perforig a fiite uber of additio or ultiplicatio
More informationSome remarks on the paper Some elementary inequalities of G. Bennett
Soe rears o the paper Soe eleetary iequalities of G. Beett Dag Ah Tua ad Luu Quag Bay Vieta Natioal Uiversity - Haoi Uiversity of Sciece Abstract We give soe couterexaples ad soe rears of soe of the corollaries
More information1 Hash tables. 1.1 Implementation
Lecture 8 Hash Tables, Uiversal Hash Fuctios, Balls ad Bis Scribes: Luke Johsto, Moses Charikar, G. Valiat Date: Oct 18, 2017 Adapted From Virgiia Williams lecture otes 1 Hash tables A hash table is a
More informationBertrand s postulate Chapter 2
Bertrad s postulate Chapter We have see that the sequece of prie ubers, 3, 5, 7,... is ifiite. To see that the size of its gaps is ot bouded, let N := 3 5 p deote the product of all prie ubers that are
More informationStatistics for Applications Fall Problem Set 7
18.650. Statistics for Applicatios Fall 016. Proble Set 7 Due Friday, Oct. 8 at 1 oo Proble 1 QQ-plots Recall that the Laplace distributio with paraeter λ > 0 is the cotiuous probaλ bility easure with
More information42 Dependence and Bases
42 Depedece ad Bases The spa s(a) of a subset A i vector space V is a subspace of V. This spa ay be the whole vector space V (we say the A spas V). I this paragraph we study subsets A of V which spa V
More informationBernoulli Polynomials Talks given at LSBU, October and November 2015 Tony Forbes
Beroulli Polyoials Tals give at LSBU, October ad Noveber 5 Toy Forbes Beroulli Polyoials The Beroulli polyoials B (x) are defied by B (x), Thus B (x) B (x) ad B (x) x, B (x) x x + 6, B (x) dx,. () B 3
More informationMath 116 Practice for Exam 3
Math 6 Practice for Eam 3 Geerated April 4, 26 Name: SOLUTIONS Istructor: Sectio Number:. This eam has questios. Note that the problems are ot of equal difficulty, so you may wat to skip over ad retur
More information6.4 Binomial Coefficients
64 Bioial Coefficiets Pascal s Forula Pascal s forula, aed after the seveteeth-cetury Frech atheaticia ad philosopher Blaise Pascal, is oe of the ost faous ad useful i cobiatorics (which is the foral ter
More informationX. Perturbation Theory
X. Perturbatio Theory I perturbatio theory, oe deals with a ailtoia that is coposed Ĥ that is typically exactly solvable of two pieces: a referece part ad a perturbatio ( Ĥ ) that is assued to be sall.
More informationCS 330 Discussion - Probability
CS 330 Discussio - Probability March 24 2017 1 Fudametals of Probability 11 Radom Variables ad Evets A radom variable X is oe whose value is o-determiistic For example, suppose we flip a coi ad set X =
More informationRecurrence Relations
Recurrece Relatios Aalysis of recursive algorithms, such as: it factorial (it ) { if (==0) retur ; else retur ( * factorial(-)); } Let t be the umber of multiplicatios eeded to calculate factorial(). The
More informationCSE 4095/5095 Topics in Big Data Analytics Spring 2017; Homework 1 Solutions
CSE 09/09 Topics i ig Data Aalytics Sprig 2017; Homework 1 Solutios Note: Solutios to problems,, ad 6 are due to Marius Nicolae. 1. Cosider the followig algorithm: for i := 1 to α log e do Pick a radom
More informationInfinite Sequences and Series
Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet
More informationLecture 11: Hash Functions and Random Oracle Model
CS 7810 Foudatios of Cryptography October 16, 017 Lecture 11: Hash Fuctios ad Radom Oracle Model Lecturer: Daiel Wichs Scribe: Akshar Varma 1 Topic Covered Defiitio of Hash Fuctios Merkle-Damgaård Theorem
More informationMA131 - Analysis 1. Workbook 3 Sequences II
MA3 - Aalysis Workbook 3 Sequeces II Autum 2004 Cotets 2.8 Coverget Sequeces........................ 2.9 Algebra of Limits......................... 2 2.0 Further Useful Results........................
More information5.6 Binomial Multi-section Matching Transformer
4/14/21 5_6 Bioial Multisectio Matchig Trasforers 1/1 5.6 Bioial Multi-sectio Matchig Trasforer Readig Assiget: pp. 246-25 Oe way to axiize badwidth is to costruct a ultisectio Γ f that is axially flat.
More informationDefine a Markov chain on {1,..., 6} with transition probability matrix P =
Pla Group Work 0. The title says it all Next Tie: MCMC ad Geeral-state Markov Chais Midter Exa: Tuesday 8 March i class Hoework 4 due Thursday Uless otherwise oted, let X be a irreducible, aperiodic Markov
More informationDisjoint set (Union-Find)
CS124 Lecture 7 Fall 2018 Disjoit set (Uio-Fid) For Kruskal s algorithm for the miimum spaig tree problem, we foud that we eeded a data structure for maitaiig a collectio of disjoit sets. That is, we eed
More informationLecture 9: Hierarchy Theorems
IAS/PCMI Summer Sessio 2000 Clay Mathematics Udergraduate Program Basic Course o Computatioal Complexity Lecture 9: Hierarchy Theorems David Mix Barrigto ad Alexis Maciel July 27, 2000 Most of this lecture
More informationA string of not-so-obvious statements about correlation in the data. (This refers to the mechanical calculation of correlation in the data.
STAT-UB.003 NOTES for Wedesday 0.MAY.0 We will use the file JulieApartet.tw. We ll give the regressio of Price o SqFt, show residual versus fitted plot, save residuals ad fitted. Give plot of (Resid, Price,
More informationDepartment of Informatics Prof. Dr. Michael Böhlen Binzmühlestrasse Zurich Phone:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch Iformatik II Midterm1 Sprig 018 3.03.018 Advice You have 90 miutes to complete
More informationJacobi symbols. p 1. Note: The Jacobi symbol does not necessarily distinguish between quadratic residues and nonresidues. That is, we could have ( a
Jacobi sybols efiitio Let be a odd positive iteger If 1, the Jacobi sybol : Z C is the costat fuctio 1 1 If > 1, it has a decopositio ( as ) a product of (ot ecessarily distict) pries p 1 p r The Jacobi
More informationSeunghee Ye Ma 8: Week 5 Oct 28
Week 5 Summary I Sectio, we go over the Mea Value Theorem ad its applicatios. I Sectio 2, we will recap what we have covered so far this term. Topics Page Mea Value Theorem. Applicatios of the Mea Value
More informationMath 116 Practice for Exam 3
Math 6 Practice for Exam Geerated October 0, 207 Name: SOLUTIONS Istructor: Sectio Number:. This exam has 7 questios. Note that the problems are ot of equal difficulty, so you may wat to skip over ad retur
More informationA PROBABILITY PROBLEM
A PROBABILITY PROBLEM A big superarket chai has the followig policy: For every Euros you sped per buy, you ear oe poit (suppose, e.g., that = 3; i this case, if you sped 8.45 Euros, you get two poits,
More informationCSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)
CSI 101 Discrete Structures Witer 01 Prof. Lucia Moura Uiversity of Ottawa Homework Assigmet #4 (100 poits, weight %) Due: Thursday, April, at 1:00pm (i lecture) Program verificatio, Recurrece Relatios
More informationMathematical Induction
Mathematical Iductio Itroductio Mathematical iductio, or just iductio, is a proof techique. Suppose that for every atural umber, P() is a statemet. We wish to show that all statemets P() are true. I a
More informationSorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU.
Sortig Algorithms Algorithms Kyuseo Shim SoEECS, SNU. Desigig Algorithms Icremetal approaches Divide-ad-Coquer approaches Dyamic programmig approaches Greedy approaches Radomized approaches You are ot
More informationRead carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book.
THE UNIVERSITY OF WARWICK FIRST YEAR EXAMINATION: Jauary 2009 Aalysis I Time Allowed:.5 hours Read carefully the istructios o the aswer book ad make sure that the particulars required are etered o each
More informationHOMEWORK 2 SOLUTIONS
HOMEWORK SOLUTIONS CSE 55 RANDOMIZED AND APPROXIMATION ALGORITHMS 1. Questio 1. a) The larger the value of k is, the smaller the expected umber of days util we get all the coupos we eed. I fact if = k
More informationMath 451: Euclidean and Non-Euclidean Geometry MWF 3pm, Gasson 204 Homework 3 Solutions
Math 451: Euclidea ad No-Euclidea Geometry MWF 3pm, Gasso 204 Homework 3 Solutios Exercises from 1.4 ad 1.5 of the otes: 4.3, 4.10, 4.12, 4.14, 4.15, 5.3, 5.4, 5.5 Exercise 4.3. Explai why Hp, q) = {x
More informationWe have also learned that, thanks to the Central Limit Theorem and the Law of Large Numbers,
Cofidece Itervals III What we kow so far: We have see how to set cofidece itervals for the ea, or expected value, of a oral probability distributio, both whe the variace is kow (usig the stadard oral,
More informationSummer MA Lesson 13 Section 1.6, Section 1.7 (part 1)
Suer MA 1500 Lesso 1 Sectio 1.6, Sectio 1.7 (part 1) I Solvig Polyoial Equatios Liear equatio ad quadratic equatios of 1 variable are specific types of polyoial equatios. Soe polyoial equatios of a higher
More informationf(1), and so, if f is continuous, f(x) = f(1)x.
2.2.35: Let f be a additive fuctio. i Clearly fx = fx ad therefore f x = fx for all Z+ ad x R. Hece, for ay, Z +, f = f, ad so, if f is cotiuous, fx = fx. ii Suppose that f is bouded o soe o-epty ope set.
More informationName Period ALGEBRA II Chapter 1B and 2A Notes Solving Inequalities and Absolute Value / Numbers and Functions
Nae Period ALGEBRA II Chapter B ad A Notes Solvig Iequalities ad Absolute Value / Nubers ad Fuctios SECTION.6 Itroductio to Solvig Equatios Objectives: Write ad solve a liear equatio i oe variable. Solve
More informationProblem Set 4 Due Oct, 12
EE226: Radom Processes i Systems Lecturer: Jea C. Walrad Problem Set 4 Due Oct, 12 Fall 06 GSI: Assae Gueye This problem set essetially reviews detectio theory ad hypothesis testig ad some basic otios
More informationw (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.
2 5. Weighted umber of late jobs 5.1. Release dates ad due dates: maximimizig the weight of o-time jobs Oce we add release dates, miimizig the umber of late jobs becomes a sigificatly harder problem. For
More informationdistinct distinct n k n k n! n n k k n 1 if k n, identical identical p j (k) p 0 if k > n n (k)
THE TWELVEFOLD WAY FOLLOWING GIAN-CARLO ROTA How ay ways ca we distribute objects to recipiets? Equivaletly, we wat to euerate equivalece classes of fuctios f : X Y where X = ad Y = The fuctios are subject
More informationThe Binomial Multi-Section Transformer
4/15/2010 The Bioial Multisectio Matchig Trasforer preset.doc 1/24 The Bioial Multi-Sectio Trasforer Recall that a ulti-sectio atchig etwork ca be described usig the theory of sall reflectios as: where:
More informationx !1! + 1!2!
4 Euler-Maclauri Suatio Forula 4. Beroulli Nuber & Beroulli Polyoial 4.. Defiitio of Beroulli Nuber Beroulli ubers B (,,3,) are defied as coefficiets of the followig equatio. x e x - B x! 4.. Expreesio
More information1. By using truth tables prove that, for all statements P and Q, the statement
Author: Satiago Salazar Problems I: Mathematical Statemets ad Proofs. By usig truth tables prove that, for all statemets P ad Q, the statemet P Q ad its cotrapositive ot Q (ot P) are equivalet. I example.2.3
More informationClassification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)
Classificatio of problem & problem solvig strategies classificatio of time complexities (liear, arithmic etc) Problem subdivisio Divide ad Coquer strategy. Asymptotic otatios, lower boud ad upper boud:
More informationApplication to Random Graphs
A Applicatio to Radom Graphs Brachig processes have a umber of iterestig ad importat applicatios. We shall cosider oe of the most famous of them, the Erdős-Réyi radom graph theory. 1 Defiitio A.1. Let
More informationProblem Cosider the curve give parametrically as x = si t ad y = + cos t for» t» ß: (a) Describe the path this traverses: Where does it start (whe t =
Mathematics Summer Wilso Fial Exam August 8, ANSWERS Problem 1 (a) Fid the solutio to y +x y = e x x that satisfies y() = 5 : This is already i the form we used for a first order liear differetial equatio,
More informationMATH 472 / SPRING 2013 ASSIGNMENT 2: DUE FEBRUARY 4 FINALIZED
MATH 47 / SPRING 013 ASSIGNMENT : DUE FEBRUARY 4 FINALIZED Please iclude a cover sheet that provides a complete setece aswer to each the followig three questios: (a) I your opiio, what were the mai ideas
More informationAutomated Proofs for Some Stirling Number Identities
Autoated Proofs for Soe Stirlig Nuber Idetities Mauel Kauers ad Carste Scheider Research Istitute for Sybolic Coputatio Johaes Kepler Uiversity Altebergerstraße 69 A4040 Liz, Austria Subitted: Sep 1, 2007;
More information10.1 Sequences. n term. We will deal a. a n or a n n. ( 1) n ( 1) n 1 2 ( 1) a =, 0 0,,,,, ln n. n an 2. n term.
0. Sequeces A sequece is a list of umbers writte i a defiite order: a, a,, a, a is called the first term, a is the secod term, ad i geeral eclusively with ifiite sequeces ad so each term Notatio: the sequece
More informationLecture 11: Pseudorandom functions
COM S 6830 Cryptography Oct 1, 2009 Istructor: Rafael Pass 1 Recap Lecture 11: Pseudoradom fuctios Scribe: Stefao Ermo Defiitio 1 (Ge, Ec, Dec) is a sigle message secure ecryptio scheme if for all uppt
More informationQueueing Theory II. Summary. M/M/1 Output process Networks of Queue Method of Stages. General Distributions
Queueig Theory II Suary M/M/1 Output process Networks of Queue Method of Stages Erlag Distributio Hyperexpoetial Distributio Geeral Distributios Ebedded Markov Chais 1 M/M/1 Output Process Burke s Theore:
More informationMachine Learning Brett Bernstein
Machie Learig Brett Berstei Week 2 Lecture: Cocept Check Exercises Starred problems are optioal. Excess Risk Decompositio 1. Let X = Y = {1, 2,..., 10}, A = {1,..., 10, 11} ad suppose the data distributio
More informationSTAT Homework 1 - Solutions
STAT-36700 Homework 1 - Solutios Fall 018 September 11, 018 This cotais solutios for Homework 1. Please ote that we have icluded several additioal commets ad approaches to the problems to give you better
More informationPerturbation Theory, Zeeman Effect, Stark Effect
Chapter 8 Perturbatio Theory, Zeea Effect, Stark Effect Ufortuately, apart fro a few siple exaples, the Schrödiger equatio is geerally ot exactly solvable ad we therefore have to rely upo approxiative
More informationMatriculation number: You have 90 minutes to complete the exam of InformatikIIb. The following rules apply:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch AlgoDat Midterm1 Sprig 016 08.04.016 Name: Matriculatio umber: Advice You have
More informationSOME FINITE SIMPLE GROUPS OF LIE TYPE C n ( q) ARE UNIQUELY DETERMINED BY THEIR ELEMENT ORDERS AND THEIR ORDER
Joural of Algebra, Nuber Theory: Advaces ad Applicatios Volue, Nuber, 010, Pages 57-69 SOME FINITE SIMPLE GROUPS OF LIE TYPE C ( q) ARE UNIQUELY DETERMINED BY THEIR ELEMENT ORDERS AND THEIR ORDER School
More informationInduction: Solutions
Writig Proofs Misha Lavrov Iductio: Solutios Wester PA ARML Practice March 6, 206. Prove that a 2 2 chessboard with ay oe square removed ca always be covered by shaped tiles. Solutio : We iduct o. For
More informationMath 475, Problem Set #12: Answers
Math 475, Problem Set #12: Aswers A. Chapter 8, problem 12, parts (b) ad (d). (b) S # (, 2) = 2 2, sice, from amog the 2 ways of puttig elemets ito 2 distiguishable boxes, exactly 2 of them result i oe
More information6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.
6 Itegers Modulo I Example 2.3(e), we have defied the cogruece of two itegers a,b with respect to a modulus. Let us recall that a b (mod ) meas a b. We have proved that cogruece is a equivalece relatio
More informationMath 104: Homework 2 solutions
Math 04: Homework solutios. A (0, ): Sice this is a ope iterval, the miimum is udefied, ad sice the set is ot bouded above, the maximum is also udefied. if A 0 ad sup A. B { m + : m, N}: This set does
More informationIf a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?
2 Lebesgue Measure I Chapter 1 we defied the cocept of a set of measure zero, ad we have observed that every coutable set is of measure zero. Here are some atural questios: If a subset E of R cotais a
More informationIt is often useful to approximate complicated functions using simpler ones. We consider the task of approximating a function by a polynomial.
Taylor Polyomials ad Taylor Series It is ofte useful to approximate complicated fuctios usig simpler oes We cosider the task of approximatig a fuctio by a polyomial If f is at least -times differetiable
More informationRecursive Algorithm for Generating Partitions of an Integer. 1 Preliminary
Recursive Algorithm for Geeratig Partitios of a Iteger Sug-Hyuk Cha Computer Sciece Departmet, Pace Uiversity 1 Pace Plaza, New York, NY 10038 USA scha@pace.edu Abstract. This article first reviews the
More informationMA131 - Analysis 1. Workbook 2 Sequences I
MA3 - Aalysis Workbook 2 Sequeces I Autum 203 Cotets 2 Sequeces I 2. Itroductio.............................. 2.2 Icreasig ad Decreasig Sequeces................ 2 2.3 Bouded Sequeces..........................
More informationOrthogonal Function Solution of Differential Equations
Royal Holloway Uiversity of Loo Departet of Physics Orthogoal Fuctio Solutio of Differetial Equatios trouctio A give oriary ifferetial equatio will have solutios i ters of its ow fuctios Thus, for eaple,
More informationThis Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2
This Lecture Divide-ad-coquer techique for algorithm desig. Example the merge sort. Writig ad solvig recurreces Divide ad Coquer Divide-ad-coquer method for algorithm desig: Divide: If the iput size is
More information5.6 Binomial Multi-section Matching Transformer
4/14/2010 5_6 Bioial Multisectio Matchig Trasforers 1/1 5.6 Bioial Multi-sectio Matchig Trasforer Readig Assiget: pp. 246-250 Oe way to axiize badwidth is to costruct a ultisectio Γ f that is axially flat.
More informationLecture 3: August 31
36-705: Itermediate Statistics Fall 018 Lecturer: Siva Balakrisha Lecture 3: August 31 This lecture will be mostly a summary of other useful expoetial tail bouds We will ot prove ay of these i lecture,
More informationContents Two Sample t Tests Two Sample t Tests
Cotets 3.5.3 Two Saple t Tests................................... 3.5.3 Two Saple t Tests Setup: Two Saples We ow focus o a sceario where we have two idepedet saples fro possibly differet populatios. Our
More information7.7 Hashing. 7.7 Hashing. Perfect Hashing. Direct Addressing
Dictioary: S.isertx): Isert a elemet x. S.deletex): Delete the elemet poited to by x. S.searchk): Retur a poiter to a elemet e with key[e] = k i S if it exists; otherwise retur ull. So far we have implemeted
More informationLecture 3: Asymptotic Analysis + Recurrences
Lecture 3: Asymptotic Aalysis + Recurreces Data Structures ad Algorithms CSE 373 SU 18 BEN JONES 1 Warmup Write a model ad fid Big-O for (it i = 0; i < ; i++) { for (it j = 0; j < i; j++) { System.out.pritl(
More informationRecursive Algorithms. Recurrences. Recursive Algorithms Analysis
Recursive Algorithms Recurreces Computer Sciece & Egieerig 35: Discrete Mathematics Christopher M Bourke cbourke@cseuledu A recursive algorithm is oe i which objects are defied i terms of other objects
More information11.6 Absolute Convergence and the Ratio and Root Tests
.6 Absolute Covergece ad the Ratio ad Root Tests The most commo way to test for covergece is to igore ay positive or egative sigs i a series, ad simply test the correspodig series of positive terms. Does
More informationYou may work in pairs or purely individually for this assignment.
CS 04 Problem Solvig i Computer Sciece OOC Assigmet 6: Recurreces You may work i pairs or purely idividually for this assigmet. Prepare your aswers to the followig questios i a plai ASCII text file or
More informationDouble Derangement Permutations
Ope Joural of iscrete Matheatics, 206, 6, 99-04 Published Olie April 206 i SciRes http://wwwscirporg/joural/ojd http://dxdoiorg/04236/ojd2066200 ouble erageet Perutatios Pooya aeshad, Kayar Mirzavaziri
More informationMathematical Preliminaries
Matheatical Preliiaries I this chapter we ll review soe atheatical cocepts that will be used throughout this course. We ll also lear soe ew atheatical otatios ad techiques that are iportat for aalysis
More informationNUMERICAL METHODS FOR SOLVING EQUATIONS
Mathematics Revisio Guides Numerical Methods for Solvig Equatios Page 1 of 11 M.K. HOME TUITION Mathematics Revisio Guides Level: GCSE Higher Tier NUMERICAL METHODS FOR SOLVING EQUATIONS Versio:. Date:
More informationDiscrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22
CS 70 Discrete Mathematics for CS Sprig 2007 Luca Trevisa Lecture 22 Aother Importat Distributio The Geometric Distributio Questio: A biased coi with Heads probability p is tossed repeatedly util the first
More information1 1 2 = show that: over variables x and y. [2 marks] Write down necessary conditions involving first and second-order partial derivatives for ( x0, y
Questio (a) A square matrix A= A is called positive defiite if the quadratic form waw > 0 for every o-zero vector w [Note: Here (.) deotes the traspose of a matrix or a vector]. Let 0 A = 0 = show that:
More information