Lecture 16. Min Cut and Karger s Algorithm

Size: px
Start display at page:

Download "Lecture 16. Min Cut and Karger s Algorithm"

Transcription

1 Lecture 16 Mi Cut ad Karger s Algorithm

2 Aoucemets HW 7 due Friday HW 8 released Friday Psych! There is o HW8. FINAL EXAM: Wedesday December 13 3:30 6:30pm

3 Advertisemet! CS83 with Omer Reigold: Witer quarter Fri1:30 PM -4:20 PM

4 Last time Miimum Spaig Trees! Prim s Algorithm Kruskal s Algorithm

5 Today Miimum Cuts! Karger s algorithm Karger-Stei algorithm Back to radomized algorithms!

6 Recall: cuts i graphs *For today, all graphs are udirected ad uweighted. A cut is a partitio of the vertices ito two oempty parts.

7 Recall: cuts i graphs *For today, all graphs are udirected ad uweighted. A cut is a partitio of the vertices ito two oempty parts. Part 1 Part 2

8 This is ot a cut

9 This is a cut

10 This is a cut These edges cross the cut. They go from oe part to the other.

11 A (global) miimum cut is a cut that has the fewest edges possible crossig it.

12 A (global) miimum cut is a cut that has the fewest edges possible crossig it.

13 Why global? Next time we ll talk about mi s-t cuts s Miimum cut which separates a specified vertex s from t t Today, there are o special vertices, so the miimum cut is global.

14 A (global) miimum cut is a cut that has the fewest edges possible crossig it.

15 Why might we care about global miimum cuts? Oe example is image segmetatio:

16 Why might we care about global miimum cuts? Oe example is image segmetatio: big edge weights* betwee similar pixels. We ll see more applicatios for other sorts of mi-cuts ext week *For the rest of today edges are t weighted; but the algorithm ca be adapted to deal with edge weights.

17 Karger salgorithm Fids globalmiimum cuts i udirected graphs Radomized algorithm Karger s algorithm might be wrog. Compare to QuickSort, which just might be slow. Why would we wat a algorithm that might be wrog? With high probability it wo t be wrog. Maybe the stakes are low ad the cost of a determiistic algorithm is high.

18 Differet sorts of gamblig QuickSortis a Las Vegas radomized algorithm It is always correct. It might be slow. Yes, this is a techical term. Formally: For all iputs A, QuickSort(A) returs a sorted array. For all iputs A, with high probability over the choice of pivots, QuickSort(A) rus quickly.

19 Differet sorts of gamblig Karger salgorithm is a Mote Carlo radomized algorithm It is always fast. It might be wrog. Formally: For all iputs G, with probability at least over the radomess i Karger salgorithm, Karger(G) returs a miimum cut. For all iputs G, with probability 1 Karger salgorithm rus i time o more tha.

20 Karger salgorithm Pick a radom edge. Cotractit. Repeat util you oly have two vertices left. a b a b New ode! Why is this a good idea? We ll see shortly.

21 Karger salgorithm a b f g e c d h

22 Karger salgorithm a radom edge! b f g e c d h

23 Karger salgorithm Create a superode! f a b g Create a superedge! Create a superedge! e c d h

24 Karger salgorithm a,b Create a superode! f g Create a superedge! Create a superedge! e c d h

25 Karger salgorithm f a,b g e c d radom edge! h

26 Karger salgorithm f a,b Create a superedge! g c d e h Create a superode! Create a superedge!

27 Karger salgorithm a,b Create a superedge! f g e,h Create a superedge! c d Create a superode!

28 Karger salgorithm f a,b g e,h c radom edge! d

29 Karger salgorithm f a,b g e,h c,d

30 Karger salgorithm f a,b g radom edge! e,h c,d

31 Karger salgorithm f a,b,c,d g e,h

32 Karger salgorithm f a,b,c,d g radom edge! e,h

33 Karger salgorithm f a,b,c,d e,h,g

34 Karger salgorithm f a,b,c,d radom edge! e,h,g

35 Karger salgorithm Now stop! There are oly two odes left. a,b,c,d The miimum cut is give by the remaiig super-odes: {a,b,c,d} ad {e,h,f,g} e,h,g,f

36 Karger salgorithm The miimum cut is give by the remaiig super-odes: {a,b,c,d} ad {e,h,f,g} a b f g e c d h

37 Karger salgorithm Does it work? Is it fast?

38 How do we implemet this? See Lecture 16 IPythoNotebook for oe way This maitais a secodary supergraph which keeps track of supernodesad superedges There s a hidde slide with pseudocode Ruig time? We cotract at most -2 edges Each time we cotract a edge we get rid of a vertex, ad we get rid of at most 2 vertices total. Naively each cotractio takes time O() Maybe there are about odes i the supernodesthat we are mergig. So total ruig time O( 2 ). We ca do O(m α )with a uio-fid data structure, but O( ( )is good eough for today.

39 Pseudocode Let u. deote the SuperNodei Γcotaiig u Say E u.,v. is the SuperEdgebetwee u.,v.. Karger( G=(V,E) ): Γ= { SuperNode(v) : v i V } E u.,v. = {(u,v)} for (u,v) i E E u.,v. = {} for (u,v) ot i E. F = copy of E This slide skipped i class while Γ > 2: (u,v) uiformly radom edge i F merge( u, v ) // merge the SuperNode cotaiig u with the SuperNode cotaiig v. F F E u.,v. // remove all the edges i the SuperEdgebetwee those SuperNodes. returthe cut give by the remaiig two supernodes. // oe superodefor each vertex // oe superedgefor each edge // we ll choose radomly from F Thewhile loop rus -2 times mergetakes time O() aively merge( u, v ): // merge also kows about Γ ad the E u.,v. s x.= SuperNode( u. v.) // create a ew superode for each wi Γ {u.,v.}: E x.,w. =E u.,w. E v.,w. Remove u. ad v.from Γad add x.. total rutime O( 2 ) We ca do a bit better with facy data structures, but let s go with this for ow.

40 Karger salgorithm Does it work? No? Is it fast? O( 2 )

41 Why did that work? We got really lucky! This could have goe wrog i so may ways.

42 Karger salgorithm Say we had chose this edge a b radom edge! f g e c d h

43 Karger salgorithm Say we had chose this edge Now there is o way we could retur a cut that separates b ad e. a b,e f g c d h

44 Eve worse If the algorithm EVERchooses either of these edges, it will be wrog. a b f g e c d h

45 a b f g How likely is that? e c d For this particular graph, I did it 10,000 times: h The algorithm is oly correct about 20% of the time!

46 That does t soud good Too see why it s good after all, we ll do a case study of this graph. Let s compare Karger salgorithm to the algorithm: Choose a completely radom cut ad hope that it s a miimum cut. c a b d e f h g The pla: See that 20% chace of correctess is actually otrivial. Use repetitio to boost a algorithm that s correct 20% of the time to a algorithm that s correct 99% of the time.

47 Radom cuts Suppose that we chose cuts uiformly at radom. That is, pick a radom way to split the vertices ito 2 parts. etc

48 Radom cuts Suppose that we chose cuts uiformly at radom. That is, pick a radom way to split the vertices ito 2 parts. The probability of choosig the miimum cut is* umber ofmicuts i that graph umber of ways to split 8 vertices i 2 parts = 2 2 O Aka, we get a miimum cut 0.8% of the time. *For this example i particular

49 Kargeris better tha completely radom! a b f g c d e h Karger salg. is correct about 20% of the time Completely radom is correct about 0.8% of the time

50 What s goig o? Which is more likely? Thig 1: It s ulikely that Kargerwill hit the mi cut sice it s so small! Lucky the lackadaisical lemur a b e f g B: The algorithm ever chooses ay of the edges i this big cut. c d h a b f g A: The algorithm ever chooses either of the edges i the miimum cut. c d e h Neither A or B are very likely, but A is more likely tha B.

51 What s goig o? Thig 2: By oly cotractig edges we are igorig certai really-ot-miimal cuts. Lucky the lackadaisical lemur c a d b e f h g B: This cut ca t be retured by Karger salgorithm! (Because how would a ad g ed up i the same super-ode?) a b f g A: This cut ca be retured by Karger s algorithm. c d e h This cut actually separates the graph ito three pieces, so it s ot miimal either half of it is a smaller cut.

52 Why does that help? Okay, so it s better tha radom We re still wrog about 80% of the time. The mai idea: repeat! If I m wrog 20% of the time, the if I repeat it a few times I ll evetually get it right. The pla: See that 20% chace of correctess is actually otrivial. Use repetitio to boost a algorithm that s correct 20% of the time to a algorithm that s correct 99% of the time.

53 Thought experimet from pre-lecture exercise Suppose you have a magic butto that produces oe of 5 umbers, {a,b,c,d,e}, uiformly at radom whe you push it. Q: What is the miimum of a,b,c,d,e? How may times do you have to push the butto before you see the miimum value? What is the probability that you have to push it more tha 5 times? 10 times? [O board]

54 [This is approximately what s o the board] This is the same calculatio we ve doe a buch of times: E[ we push the butto ] = 1/(0.20) = 5 Pr[ Number of times util we get the miimum value This oe we ve doe less frequetly: We push the butto t times ad do t ever get the mi We push the butto ] = (1 0.2) U Pr[ 5 times ad do t ] = (1 0.2) V 0.33 ever get the mi We push the butto Pr[ 10 times ad do t ] = (1 0.2) XY 0.1 ever get the mi Slide skipped i class

55 I this cotext Ru Karger s! The cut size is 6! Ru Karger s! The cut size is 3! Ru Karger s! The cut size is 3! Ru Karger s! The cut size is 2! Correct! Ru Karger s! The cut size is 5! If the success probability is about 20%, the if you ru Karger salgorithm 5times ad take the best aswer you get, that will likely be correct!

56 For this particular graph Repeat Karger salgorithm about 5 times, ad we will get a mi cut with decet probability. I cotrast, we d have to choose a radom cut about 1/0.008 = 125 times! c a b d e f h g Hag o! This 20% figure just came from ruig experimets o this particular graph. What about geeral graphs? Ca we prove this? Also, we should be a bit more precise about this about 5 times statemet. Plucky the pedatic pegui The pla: See that 20% chace of correctess is actually otrivial. Use repetitio to boost a algorithm that s correct 20% of the time to a algorithm that s correct 99% of the time.

57 Questios To geeralize this approach to all graphs 1. What is the probability that Karger salgorithm returs a miimum cut? 2. How may times should we ru Karger s algorithm to probably succeed? Say, with probability 0.99? Or more geerally, probability 1 δ?

58 Aswer to Questio 1 Claim: The probability that Karger salgorithm returs a miimum cut is at least X _ ] ^ I this case, X _ ` =0.036, so we are ^ guarateed to wi at least 3.6% of the time.

59 Aswers 1. What is the probability that Karger salgorithm returs a miimum cut? Accordig to the claim, at most 2. How may times should we ru Karger s algorithm to probably succeed? Say, with probability 0.99? Or more geerally, probability 1 δ? X ] ^

60 Before we prove the Claim 2. How may times should we ru Karger s algorithm to succeed with probability 1 δ? a b f g e c d h

61 A computatio Puchlie: If we repeat T = 2 l(1/δ)times, we wi with probability at least 1 δ. Suppose : the probability of successfully returig a miimum cut is p 0,1, we wat failure probability at most δ 0,1. Pr [ do t retur amicut i T trials ]= 1 p m So p = 1/ ( by the Claim. Let s choose T = ( l(1/δ). Pr [ do t retur a mi cut i T trials ] = 1 p m e rs m =e rsm =e rtu v w =δ Idepedet 1 p e rs 1 p e rs

62 Theorem Assumig the claim about 1/ ( Suppose G has vertices. Cosider the followig algorithm: bestcut= Noe for t=1,, ( l X : cadidatecut Karger(G) if cadidatecut is smaller tha bestcut: bestcut cadidatecut retur bestcut The Pr[ this does } t retur a micut ] δ. How may repetitios would you eed if istead of Kargerwe just chose a uiformly radom cut?

63 Aswers 1. What is the probability that Karger salgorithm returs a miimum cut? Accordig to the claim, at most 2. How may times should we ru Karger s algorithm to probably succeed? Say, with probability 0.99? Or more geerally, probability 1 δ? ( log X times. X ] ^

64 What s the ruig time? ( l X repetitios, ad O(2 ) per repetitio. So, O ( ( l X =O Treatig δas costat. Agai we ca do better with a uio-fid data structure. Write pseudocode for or better yet, implemet a fast versio of Karger salgorithm! How fast ca you make the asymptotic ruig time? Ollie the over-achievig ostrich

65 Theorem Assumig the claim about 1/ ( Suppose G has vertices. The [repeatig Karger s algorithm] fids a mi cut i G with probability at least 0.99 i time O( 4 ). Now let s prove the claim

66 Claim The probability that Karger salgorithm returs a miimum cut is at least X _ ] ^

67 Now let s prove that claim Say that S* is a miimum cut. Suppose the edges that we choose are e 1,e 2,, e -2 PR[ retur S* ] = PR[ oe of the e i cross S* ] = PR[ e 1 does t cross S* ] PR[ e 2 does t cross S* e 1 does t cross S* ] PR[ e -2 does t cross S* e 1,,e -3 do t cross S* ] a b f g e c d S* h

68 Focus i o: PR[ e j does t cross S* e 1,,e j-1 do t cross S* ] Suppose: After j-1 iteratios, we have t messed up yet! What s the probability of messig up ow? a,b These two edges have t bee chose for cotractio! f g e,h c d

69 Focus i o: PR[ e j does t cross S* e 1,,e j-1 do t cross S* ] Suppose: After j-1 iteratios, we have t messed up yet! What s the probability of messig up ow? Say there are k edges that cross S* Every remaiig ode has degree at least k. Otherwise we d have a smaller cut. Thus, there are at least (-j+1)k/2 edges total. b/c there are -j + 1 odes left, each with degree at least k. Recall: the degree of the vertex is the umber of edges comig out of it. So the probability that we choose oe of the k edges crossig S* at step j is at most: k ƒj 1 k 2 = 2 rj 1 c a,b d f e,h g

70 Focus i o: PR[ e j does t cross S* e 1,,e j-1 do t cross S* ] So the probability that we choose oe of the k edges crossig S* at step j is at most: ]ƒˆ v ^ = ( rš X The probability we do t choose oe of the k edges is at least: 1 ( = ršrx rš X rš X a,b f g c d e,h

71 Now let s prove that claim Say that S* is a miimum cut. Suppose the edges that we choose are e 1,e 2,, e -2 PR[ retur S* ] = PR[ oe of the e i cross S* ] = PR[ e 1 does t cross S* ] PR[ e 2 does t cross S* e 1 does t cross S* ] PR[ e -2 does t cross S* e 1,,e -3 do t cross S* ] a b f g e c d S* h

72 Now let s prove that claim Say that S* is a miimum cut. Suppose the edges that we choose are e 1,e 2,, e -2 PR[ retur S* ] = PR[ oe of the e i cross S* ] = r( r rx r r( rv r rœ r Œ V ( X a b f g e c d S* h

73 Now let s prove that claim Say that S* is a miimum cut. Suppose the edges that we choose are e 1,e 2,, e -2 PR[ retur S* ] = PR[ oe of the e i cross S* ] = r( ( = = X ] ^ rx r rx r r( rv r rœ r Œ V ( X a b f g c d S* e h

74 Theorem Assumig the claim about 1/ ( Suppose G has vertices. The [repeatig Karger s algorithm] fids a mi cut i G with probability at least 0.99 i time O( 4 ). That proves this Theorem!

75 What have we leared? If we radomly cotract edges: It s ulikely that we ll ed up with a mi cut. But it s ot TOO ulikely By repeatig, we likely will fid a mi cut. Here I chose δ=0.01 just for cocreteess. Repeatig this process: Fids a global mi cut i time O( 4 ), with probability We ca ru a bit faster if we use a uio-fiddata structure. *Note, i the lecture otes, we take δ= X,which makes the ruig time O( 4 log()). It depeds o how sure you wat to be!

76 More geerally Wheever we have a Mote-Carlo algorithm with a small success probability, we ca boostthe success probability by repeatig it a buch ad takig the best solutio.

77 Ca we do better? Repeatig O( 2 ) times is pretty expesive. O( 4 ) total rutime to get success probability The Karger-Stei Algorithmwill do better! The trick is that we ll do the repetitios i a clever way. O( 2 log 2 () ) rutime for the same success probability. Warig! This is a tricky algorithm! We ll sketch the approach here: the importat part is the high-level idea, ot the details of the computatios. To see how we might save o repetitios, let s ru through Karger s algorithm agai.

78 Karger salgorithm a b f g e c d h

79 Karger salgorithm Probability that we did t mess up: 12/14 There are 14 edges, 12 of which are good to cotract. a radom edge! b f g e c d h

80 Karger salgorithm Create a superode! f a b g Create a superedge! Create a superedge! e c d h

81 Karger salgorithm a,b Create a superode! f g Create a superedge! Create a superedge! e c d h

82 Karger salgorithm Probability that we did t mess up: 11/13 Now there are oly 13 edges, sice the edge betwee a ad b disappeared. f a,b g e c d radom edge! h

83 Karger salgorithm f a,b Create a superedge! g c d e h Create a superode! Create a superedge!

84 Karger salgorithm a,b Create a superedge! f g e,h Create a superedge! c d Create a superode!

85 Karger salgorithm Probability that we did t mess up: 10/12 Now there are oly 12 edges, sice the edge betwee e ad h disappeared. f a,b g e,h c radom edge! d

86 Karger salgorithm f a,b g e,h c,d

87 Karger salgorithm Probability that we did t mess up: 9/11 f a,b g radom edge! (We pick at radom from the origial edges). e,h c,d

88 Karger salgorithm f a,b,c,d g e,h

89 Karger salgorithm Probability that we did t mess up: 5/7 f a,b,c,d g radom edge! e,h

90 Karger salgorithm f a,b,c,d e,h,g

91 Karger salgorithm Probability that we did t mess up: 3/5 f a,b,c,d radom edge! e,h,g

92 Karger salgorithm a,b,c,d e,h,g,f

93 Karger salgorithm Now stop! There are oly two odes left. a,b,c,d e,h,g,f

94 Probability of ot messig up At the begiig, it s pretty likely we ll be fie. The probability that we mess up gets worse ad worse over time. 12/14 11/13 10/12 9/11 Moral: Repeatig the stuff from the begiig of the algorithm is wasteful! probability of success 5/7 3/5 iteratio

95 Istead a c a,b d b e f f g h g Cotract! c d e h This brach made a bad choice. a,b c d e f,g h Cotract! But it s okay sice this brach made a good choice. a,b c a,b,e d e f,g f,g h Cotract! FORK! a,b c Cotract! a,b d e f,g f,g,h h etc c d h c d e etc

96 I words Ru Karger salgorithm o G for a bit. Util there are u ( superodesleft. The split ito two idepedet copies, G 1 ad G 2 Ru Karger salgorithm o each of those for a bit. Util there are ^ ( = ( superodesleft i each. The split each of those ito two idepedet copies

97 I pseudocode KargerStei(G = (V,E)): V if < 4: fid a mi-cut by brute force Ru Karger salgorithm o G with idepedet repetitios util odes remai. ( G 1, G 2 copies of what s left of G S 1 = KargerStei(G 1 ) S 2 = KargerStei(G 2 ) returwhichever of S 1, S 2 is the smaller cut. \\time O(1)

98 Recursio tree odes ( odes Cotract a buch of edges odes Make 2 ( copies ( odes Cotract a buch of edges Cotract a buch of edges odes odes odes Make 2 copies odes odes Make 2 copies odes 8 odes O odes O odes O odes O odes

99 Recursio tree depth is log ( = t =2log () t ( () umber of leaves is 2 2log() = 2 odes This couts as oe level for this aalysis ( odes Cotract a buch of edges This couts as oe level for this aalysis Cotract a buch of edges odes ( odes Make 2 copies ( odes odes Cotract a buch of edges

100 Two questios Does this work? Is it fast?

101 At the j th level Cotract a buch of edges (ˆ/^ odes ( (ˆ v)/^ odes The amout of work per level is the amout of work eeded to reduce the umber of odes by a factor of 2. That s at most O( 2 ). sice that s the time it takes to ru Karger salgorithm oce, cuttig dow the umber of superodes to two. ( (ˆ v)/^ odes Make 2 copies ( (ˆ v)/^ odes Our recurrece relatio is T() = 2T(/ 2) + O( 2 ) The Master Theorem says T() = O( 2 log()) Jedi Master Yoda

102 Two questios Does this work? Is it fast? Yes, O( 2 log()).

103 Why / 2? Suppose we cotract t edges, util there are t superodes remaiig. Suppose the first -t edges that we choose are e 1,e 2,, e -t PR[ oe of the e i cross S* (up to the -t th) ] = PR[ e 1 does t cross S* ] PR[ e 2 does t cross S* e 1 does t cross S* ] PR[ e -t does t cross S* e 1,,e -t-1 do t cross S* ]

104 Why / 2? Suppose we cotract t edges, util there are t superodes remaiig. Suppose the first -t edges that we choose are e 1,e 2,, e -t PR[ oe of the e i cross S* (up to the -t th) ] = r( r rx = U (UrX) (rx) ] ] ^ ^rx = (rx) 1 2 r r( Choose t=/ 2 rv r whe is large rœ U X r U U U ( UrX U X

105 Recursio tree odes ( odes Cotract a buch of edges Pr[ failure ] = 1/2 Cotract a buch of edges Pr[ failure ] = 1/2 odes odes Make 2 ( copies ( odes odes Cotract a buch of edges Pr[ failure ] = 1/2 odes O odes Make 2 copies Pr[ failure ] = 1/2 odes O odes odes O odes Make 2 copies Pr[ failure ] = 1/2 etc. odes O odes

106 Probability of success Is the probability that there s a path from the root to a leaf with o failures. odes ( odes odes Make 2 ( copies ( odes or Each with probability 1/2 odes odes odes Make 2 copies odes odes Make 2 copies odes O odes O odes O odes O odes

107 The problem we eed to aalyze Let T be biary tree of depth 2log() Each ode of T succeeds or fails idepedetly with probability 1/2 What is the probability that there s a path from the root to ay leaf that s etirely successful?

108 Aalysis Say the tree has height d. Let p d be the probability that there s a path from the root to a leaf that does t fail. p = X ( Pr = X ( Pr Pr at least oe subtree has a successful path wis +Pr both wi wis Cotract a buch of edges 2 ( rx)/( odes 2 /( odes 2 ( rx)/( odes Make 2 copies 2 ( rx)/( odes = X p ( ( rx+p rx p rx = p rx X p ( ( rx

109 It s a recurrece relatio! p = p rx X p ( ( rx p Y =1 We are real good at those. I this case, the aswer is: Claim: for all d, p X X Prove this! (Or see hidde slide for a proof). Siggi the Studious Stork

110 Recurrece relatio p = p rx X p ( ( rx p Y =1 Claim: for all d, p X X Proof: iductio o d. Base case: 1 1. YEP. Iductive step: say d > 0. Suppose that p rx X. p = p rx X p ( ( rx X X ( X ^ X X X = X X This slide skipped i class

111 What does that mea for Karger-Stei? For d = 2log() that is, d = the height of the tree: Claim: for all d, p X X p (t () 1 2log ()+1 aka, Pr[ Karger-Stei is successful ] = Ω X t

112 Altogether ow We ca do the same trick as before to amplify the success probability. Ru Karger-Stei O log log X success probability 1 δ. Each iteratio takes time O ( log That s what we proved before. times to achieve Choosig δ=0.01as before, the total rutime is O ( log log = O ( log ( Much better tha O( 4 )!

113 What have we leared? Just repeatig Karger salgorithm is t the best use of repetitio. We re probably goig to be correct ear the begiig. Istead, Karger-Stei repeats whe it couts. If we wait util there are odes left, the probability ( that we fail is close to ½. This lets us fid a global miimum cut i a udirected graph i time O( 2 log 2 () ). Notice that we ca t do better tha 2 i a dese graph (we eed to look at all the edges), so this is pretty good.

114 Recap Some algorithms: Karger s algorithm for global mi-cut Improvemet: Karger-Stei Some cocepts: Mote Carlo algorithms: Might be wrog, are always fast. We ca boost their success probability with repetitio. Sometimes we ca do this repetitio very cleverly.

115 Next time Aother sort of mi-cut: s-t mi-cut also max-flow! Beforeext time Pre-lecture exercise: examples of cuts ad flows.

ORIE 633 Network Flows September 27, Lecture 8

ORIE 633 Network Flows September 27, Lecture 8 ORIE 633 Network Flows September 7, 007 Lecturer: David P. Williamso Lecture 8 Scribe: Gema Plaza-Martíez 1 Global mi-cuts i udirected graphs 1.1 Radom cotractio Recall from last time we itroduced the

More information

4.3 Growth Rates of Solutions to Recurrences

4.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 information

CSE 4095/5095 Topics in Big Data Analytics Spring 2017; Homework 1 Solutions

CSE 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 information

Lecture 2: April 3, 2013

Lecture 2: April 3, 2013 TTIC/CMSC 350 Mathematical Toolkit Sprig 203 Madhur Tulsiai Lecture 2: April 3, 203 Scribe: Shubhedu Trivedi Coi tosses cotiued We retur to the coi tossig example from the last lecture agai: Example. Give,

More information

Lecture 9: Hierarchy Theorems

Lecture 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 information

Sorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU.

Sorting 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 information

Math F215: Induction April 7, 2013

Math F215: Induction April 7, 2013 Math F25: Iductio April 7, 203 Iductio is used to prove that a collectio of statemets P(k) depedig o k N are all true. A statemet is simply a mathematical phrase that must be either true or false. Here

More information

CS 332: Algorithms. Quicksort

CS 332: Algorithms. Quicksort CS 33: Aorithms Quicsort David Luebe //03 Homewor Assiged today, due ext Wedesday Will be o web page shortly after class Go over ow David Luebe //03 Review: Quicsort Sorts i place Sorts O( ) i the average

More information

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials.

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials. Divide-ad-coquer algorithms Divide & Coquer Strategy: Divide the problem ito smaller subproblems of the same type of problem Solve the subproblems recursively Combie the aswers to solve the origial problem

More information

CS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia)

CS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia) 1 CS 332: Algorithms Liear-Time Sortig. Order statistics. Slide credit: David Luebke (Virgiia) Quicksort: Partitio I Words Partitio(A, p, r): Select a elemet to act as the pivot (which?) Grow two regios,

More information

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2 Geeral remarks Week 2 1 Divide ad First we cosider a importat tool for the aalysis of algorithms: Big-Oh. The we itroduce a importat algorithmic paradigm:. We coclude by presetig ad aalysig two examples.

More information

Analysis of Algorithms -Quicksort-

Analysis of Algorithms -Quicksort- Aalysis of Algorithms -- Adreas Ermedahl MRTC (Mälardales Real-Time Research Ceter) adreas.ermedahl@mdh.se Autum 2004 Proposed by C.A.R. Hoare i 962 Worst- case ruig time: Θ( 2 ) Expected ruig time: Θ(

More information

Chapter 22. Comparing Two Proportions. Copyright 2010 Pearson Education, Inc.

Chapter 22. Comparing Two Proportions. Copyright 2010 Pearson Education, Inc. Chapter 22 Comparig Two Proportios Copyright 2010 Pearso Educatio, Ic. Comparig Two Proportios Comparisos betwee two percetages are much more commo tha questios about isolated percetages. Ad they are more

More information

Test One (Answer Key)

Test 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 information

Data Structures Lecture 9

Data Structures Lecture 9 Fall 2017 Fag Yu Software Security Lab. Dept. Maagemet Iformatio Systems, Natioal Chegchi Uiversity Data Structures Lecture 9 Midterm o Dec. 7 (9:10-12:00am, 106) Lec 1-9, TextBook Ch1-8, 11,12 How to

More information

An Introduction to Randomized Algorithms

An 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 information

CS / MCS 401 Homework 3 grader solutions

CS / 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 information

Model of Computation and Runtime Analysis

Model of Computation and Runtime Analysis Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map

More information

Analysis of Algorithms. Introduction. Contents

Analysis of Algorithms. Introduction. Contents Itroductio The focus of this module is mathematical aspects of algorithms. Our mai focus is aalysis of algorithms, which meas evaluatig efficiecy of algorithms by aalytical ad mathematical methods. We

More information

This Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2

This 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 information

PRACTICE PROBLEMS FOR THE FINAL

PRACTICE PROBLEMS FOR THE FINAL PRACTICE PROBLEMS FOR THE FINAL Math 36Q Fall 25 Professor Hoh Below is a list of practice questios for the Fial Exam. I would suggest also goig over the practice problems ad exams for Exam ad Exam 2 to

More information

kp(x = k) = λe λ λ k 1 (k 1)! = λe λ r k e λλk k! = e λ g(r) = e λ e rλ = e λ(r 1) g (1) = E[X] = λ g(r) = kr k 1 e λλk k! = E[X]

kp(x = k) = λe λ λ k 1 (k 1)! = λe λ r k e λλk k! = e λ g(r) = e λ e rλ = e λ(r 1) g (1) = E[X] = λ g(r) = kr k 1 e λλk k! = E[X] Problem 1: (8 poits) Let X be a Poisso radom variable of parameter λ. 1. ( poits) Compute E[X]. E[X] = = kp(x = k) = k=1 λe λ λ k 1 (k 1)! = λe λ ke λλk λ k k! k =0 2. ( poits) Compute g(r) = E [ r X],

More information

Last time, we talked about how Equation (1) can simulate Equation (2). We asserted that Equation (2) can also simulate Equation (1).

Last time, we talked about how Equation (1) can simulate Equation (2). We asserted that Equation (2) can also simulate Equation (1). 6896 Quatum Complexity Theory Sept 23, 2008 Lecturer: Scott Aaroso Lecture 6 Last Time: Quatum Error-Correctio Quatum Query Model Deutsch-Jozsa Algorithm (Computes x y i oe query) Today: Berstei-Vazirii

More information

NUMERICAL METHODS FOR SOLVING EQUATIONS

NUMERICAL 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 information

Chapter 22. Comparing Two Proportions. Copyright 2010, 2007, 2004 Pearson Education, Inc.

Chapter 22. Comparing Two Proportions. Copyright 2010, 2007, 2004 Pearson Education, Inc. Chapter 22 Comparig Two Proportios Copyright 2010, 2007, 2004 Pearso Educatio, Ic. Comparig Two Proportios Read the first two paragraphs of pg 504. Comparisos betwee two percetages are much more commo

More information

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)

Classification 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 information

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Discrete 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 information

Lecture 14: Graph Entropy

Lecture 14: Graph Entropy 15-859: Iformatio Theory ad Applicatios i TCS Sprig 2013 Lecture 14: Graph Etropy March 19, 2013 Lecturer: Mahdi Cheraghchi Scribe: Euiwoog Lee 1 Recap Bergma s boud o the permaet Shearer s Lemma Number

More information

Lecture 4: Unique-SAT, Parity-SAT, and Approximate Counting

Lecture 4: Unique-SAT, Parity-SAT, and Approximate Counting Advaced Complexity Theory Sprig 206 Lecture 4: Uique-SAT, Parity-SAT, ad Approximate Coutig Prof. Daa Moshkovitz Scribe: Aoymous Studet Scribe Date: Fall 202 Overview I this lecture we begi talkig about

More information

Lecture 2. The Lovász Local Lemma

Lecture 2. The Lovász Local Lemma Staford Uiversity Sprig 208 Math 233A: No-costructive methods i combiatorics Istructor: Ja Vodrák Lecture date: Jauary 0, 208 Origial scribe: Apoorva Khare Lecture 2. The Lovász Local Lemma 2. Itroductio

More information

Lecture 9: Pseudo-random generators against space bounded computation,

Lecture 9: Pseudo-random generators against space bounded computation, Lecture 9: Pseudo-radom geerators agaist space bouded computatio, Primality Testig Topics i Pseudoradomess ad Complexity (Sprig 2018) Rutgers Uiversity Swastik Kopparty Scribes: Harsha Tirumala, Jiyu Zhag

More information

Recurrence Relations

Recurrence 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 information

A Probabilistic Analysis of Quicksort

A Probabilistic Analysis of Quicksort A Probabilistic Aalysis of Quicsort You are assumed to be familiar with Quicsort. I each iteratio this sortig algorithm chooses a pivot ad the, by performig comparisios with the pivot, splits the remaider

More information

Algorithms and Data Structures Lecture IV

Algorithms and Data Structures Lecture IV Algorithms ad Data Structures Lecture IV Simoas Šalteis Aalborg Uiversity simas@cs.auc.dk September 5, 00 1 This Lecture Aalyzig the ruig time of recursive algorithms (such as divide-ad-coquer) Writig

More information

MA131 - Analysis 1. Workbook 3 Sequences II

MA131 - 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 information

Disjoint set (Union-Find)

Disjoint 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 information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 018/019 DR. ANTHONY BROWN 8. Statistics 8.1. Measures of Cetre: Mea, Media ad Mode. If we have a series of umbers the

More information

Intro to Learning Theory

Intro to Learning Theory Lecture 1, October 18, 2016 Itro to Learig Theory Ruth Urer 1 Machie Learig ad Learig Theory Comig soo 2 Formal Framework 21 Basic otios I our formal model for machie learig, the istaces to be classified

More information

Infinite Sequences and Series

Infinite 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 information

HOMEWORK 2 SOLUTIONS

HOMEWORK 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 information

Lecture 3: Asymptotic Analysis + Recurrences

Lecture 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 information

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5 CIS 11 Data Structures ad Algorithms with Java Sprig 019 Code Sippets ad Recurreces Moday, February 4/Tuesday, February 5 Learig Goals Practice provig asymptotic bouds with code sippets Practice solvig

More information

P1 Chapter 8 :: Binomial Expansion

P1 Chapter 8 :: Binomial Expansion P Chapter 8 :: Biomial Expasio jfrost@tiffi.kigsto.sch.uk www.drfrostmaths.com @DrFrostMaths Last modified: 6 th August 7 Use of DrFrostMaths for practice Register for free at: www.drfrostmaths.com/homework

More information

AMS570 Lecture Notes #2

AMS570 Lecture Notes #2 AMS570 Lecture Notes # Review of Probability (cotiued) Probability distributios. () Biomial distributio Biomial Experimet: ) It cosists of trials ) Each trial results i of possible outcomes, S or F 3)

More information

Understanding Samples

Understanding Samples 1 Will Moroe CS 109 Samplig ad Bootstrappig Lecture Notes #17 August 2, 2017 Based o a hadout by Chris Piech I this chapter we are goig to talk about statistics calculated o samples from a populatio. We

More information

CS161 Design and Analysis of Algorithms. Administrative

CS161 Design and Analysis of Algorithms. Administrative CS161 Desig ad Aalysis of Algorithms Da Boeh 1 Admiistrative Lecture 1, April 3, 1 Web page http://theory.staford.edu/~dabo/cs161» Hadouts» Aoucemets» Late breakig ews Gradig ad course requiremets» Midterm/fial/hw»

More information

Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 21. Some Important Distributions

Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 21. Some Important Distributions CS 70 Discrete Mathematics for CS Sprig 2005 Clacy/Wager Notes 21 Some Importat Distributios Questio: A biased coi with Heads probability p is tossed repeatedly util the first Head appears. What is the

More information

MA131 - Analysis 1. Workbook 2 Sequences I

MA131 - 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 information

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m?

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m? MATH 529 The Boudary Problem The drukard s walk (or boudary problem) is oe of the most famous problems i the theory of radom walks. Oe versio of the problem is described as follows: Suppose a particle

More information

Data Structures and Algorithm. Xiaoqing Zheng

Data Structures and Algorithm. Xiaoqing Zheng Data Structures ad Algorithm Xiaoqig Zheg zhegxq@fudaeduc What are algorithms? A sequece of computatioal steps that trasform the iput ito the output Sortig problem: Iput: A sequece of umbers

More information

w (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.

w (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 information

The Binomial Theorem

The Binomial Theorem The Biomial Theorem Robert Marti Itroductio The Biomial Theorem is used to expad biomials, that is, brackets cosistig of two distict terms The formula for the Biomial Theorem is as follows: (a + b ( k

More information

CS583 Lecture 02. Jana Kosecka. some materials here are based on E. Demaine, D. Luebke slides

CS583 Lecture 02. Jana Kosecka. some materials here are based on E. Demaine, D. Luebke slides CS583 Lecture 02 Jaa Kosecka some materials here are based o E. Demaie, D. Luebke slides Previously Sample algorithms Exact ruig time, pseudo-code Approximate ruig time Worst case aalysis Best case aalysis

More information

Sums, products and sequences

Sums, products and sequences Sums, products ad sequeces How to write log sums, e.g., 1+2+ (-1)+ cocisely? i=1 Sum otatio ( sum from 1 to ): i 3 = 1 + 2 + + If =3, i=1 i = 1+2+3=6. The ame ii does ot matter. Could use aother letter

More information

V. Adamchik 1. Recursions. Victor Adamchik Fall of x n1. x n 2. Here are a few first values of the above sequence (coded in Mathematica)

V. Adamchik 1. Recursions. Victor Adamchik Fall of x n1. x n 2. Here are a few first values of the above sequence (coded in Mathematica) V. Adamchik Recursios Victor Adamchik Fall of 2005 Pla. Covergece of sequeces 2. Fractals 3. Coutig biary trees Covergece of Sequeces I the previous lecture we cosidered a cotiued fractio for 2 : 2 This

More information

CSE 5311 Notes 1: Mathematical Preliminaries

CSE 5311 Notes 1: Mathematical Preliminaries Chapter 1 - Algorithms Computig CSE 5311 Notes 1: Mathematical Prelimiaries Last updated 1/20/18 12:56 PM) Relatioship betwee complexity classes, eg log,, log, 2, 2, etc Chapter 2 - Gettig Started Loop

More information

Lecture 5: April 17, 2013

Lecture 5: April 17, 2013 TTIC/CMSC 350 Mathematical Toolkit Sprig 203 Madhur Tulsiai Lecture 5: April 7, 203 Scribe: Somaye Hashemifar Cheroff bouds recap We recall the Cheroff/Hoeffdig bouds we derived i the last lecture idepedet

More information

Seunghee Ye Ma 8: Week 5 Oct 28

Seunghee 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 information

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary

Recursive 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 information

PRACTICE PROBLEMS FOR THE FINAL

PRACTICE PROBLEMS FOR THE FINAL PRACTICE PROBLEMS FOR THE FINAL Math 36Q Sprig 25 Professor Hoh Below is a list of practice questios for the Fial Exam. I would suggest also goig over the practice problems ad exams for Exam ad Exam 2

More information

STA Learning Objectives. Population Proportions. Module 10 Comparing Two Proportions. Upon completing this module, you should be able to:

STA Learning Objectives. Population Proportions. Module 10 Comparing Two Proportions. Upon completing this module, you should be able to: STA 2023 Module 10 Comparig Two Proportios Learig Objectives Upo completig this module, you should be able to: 1. Perform large-sample ifereces (hypothesis test ad cofidece itervals) to compare two populatio

More information

Homework 5 Solutions

Homework 5 Solutions Homework 5 Solutios p329 # 12 No. To estimate the chace you eed the expected value ad stadard error. To do get the expected value you eed the average of the box ad to get the stadard error you eed the

More information

Polynomial identity testing and global minimum cut

Polynomial identity testing and global minimum cut CHAPTER 6 Polyomial idetity testig ad global miimum cut I this lecture we will cosider two further problems that ca be solved usig probabilistic algorithms. I the first half, we will cosider the problem

More information

( ) = p and P( i = b) = q.

( ) = p and P( i = b) = q. MATH 540 Radom Walks Part 1 A radom walk X is special stochastic process that measures the height (or value) of a particle that radomly moves upward or dowward certai fixed amouts o each uit icremet of

More information

1 Approximating Integrals using Taylor Polynomials

1 Approximating Integrals using Taylor Polynomials Seughee Ye Ma 8: Week 7 Nov Week 7 Summary This week, we will lear how we ca approximate itegrals usig Taylor series ad umerical methods. Topics Page Approximatig Itegrals usig Taylor Polyomials. Defiitios................................................

More information

Problem Set 2 Solutions

Problem 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 information

Matriculation number: You have 90 minutes to complete the exam of InformatikIIb. The following rules apply:

Matriculation 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 information

Lecture 9: Expanders Part 2, Extractors

Lecture 9: Expanders Part 2, Extractors Lecture 9: Expaders Part, Extractors Topics i Complexity Theory ad Pseudoradomess Sprig 013 Rutgers Uiversity Swastik Kopparty Scribes: Jaso Perry, Joh Kim I this lecture, we will discuss further the pseudoradomess

More information

CS 330 Discussion - Probability

CS 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 information

6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline

6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline 6.046 Recitatio 5: Biary Search Trees Bill Thies, Fall 2004 Outlie My cotact iformatio: Bill Thies thies@mit.edu Office hours: Sat 1-3pm, 36-153 Recitatio website: http://cag.lcs.mit.edu/~thies/6.046/

More information

How to walk home drunk. Some Great Theoretical Ideas in Computer Science for. Probability Refresher. Probability Refresher.

How to walk home drunk. Some Great Theoretical Ideas in Computer Science for. Probability Refresher. Probability Refresher. 15251 Some Great Theoretical Ideas i Computer Sciece for "My frieds keep askig me what 251 is like. I lik them to this video: http://youtube.com/watch?v=m275pjvwrli" Probability Refresher What s a Radom

More information

OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES

OPTIMAL 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 information

Lecture 4: April 10, 2013

Lecture 4: April 10, 2013 TTIC/CMSC 1150 Mathematical Toolkit Sprig 01 Madhur Tulsiai Lecture 4: April 10, 01 Scribe: Haris Agelidakis 1 Chebyshev s Iequality recap I the previous lecture, we used Chebyshev s iequality to get a

More information

Lecture 7: Solving Recurrences

Lecture 7: Solving Recurrences Lecture 7: Solvig Recurreces CSE 7: Data Structures ad Algorithms CSE 7 19 WI KASEY CHAMPION 1 Warm Up Writig Recurreces CSE 7 19 WI KASEY CHAMPION 2 Admiistriva HW 2 Part 1 due Friday git ruers will get

More information

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Recursive 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 information

Random Models. Tusheng Zhang. February 14, 2013

Random Models. Tusheng Zhang. February 14, 2013 Radom Models Tusheg Zhag February 14, 013 1 Radom Walks Let me describe the model. Radom walks are used to describe the motio of a movig particle (object). Suppose that a particle (object) moves alog the

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Desig ad Aalysis of Algorithms Probabilistic aalysis ad Radomized algorithms Referece: CLRS Chapter 5 Topics: Hirig problem Idicatio radom variables Radomized algorithms Huo Hogwei 1 The hirig problem

More information

1 Hash tables. 1.1 Implementation

1 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 information

Sequences I. Chapter Introduction

Sequences I. Chapter Introduction Chapter 2 Sequeces I 2. Itroductio A sequece is a list of umbers i a defiite order so that we kow which umber is i the first place, which umber is i the secod place ad, for ay atural umber, we kow which

More information

Merge and Quick Sort

Merge and Quick Sort Merge ad Quick Sort Merge Sort Merge Sort Tree Implemetatio Quick Sort Pivot Item Radomized Quick Sort Adapted from: Goodrich ad Tamassia, Data Structures ad Algorithms i Java, Joh Wiley & So (1998). Ruig

More information

Examples: data compression, path-finding, game-playing, scheduling, bin packing

Examples: data compression, path-finding, game-playing, scheduling, bin packing Algorithms - Basic Cocepts Algorithms so what is a algorithm, ayway? The dictioary defiitio: A algorithm is a well-defied computatioal procedure that takes iput ad produces output. This class will deal

More information

Advanced Course of Algorithm Design and Analysis

Advanced Course of Algorithm Design and Analysis Differet complexity measures Advaced Course of Algorithm Desig ad Aalysis Asymptotic complexity Big-Oh otatio Properties of O otatio Aalysis of simple algorithms A algorithm may may have differet executio

More information

Math778P Homework 2 Solution

Math778P Homework 2 Solution Math778P Homework Solutio Choose ay 5 problems to solve. 1. Let S = X i where X 1,..., X are idepedet uiform { 1, 1} radom variables. Prove that E( S = 1 ( 1 1 Proof by Day Rorabaugh: Let S = X i where

More information

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

Randomized 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 information

CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN

CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN CSI 5163 (95.5703) ALGORITHM ANALYSIS AND DESIGN (3 cr.) (T) Topics of curret iterest i the desig ad aalysis of computer algorithms for graphtheoretical

More information

Notes for Lecture 11

Notes for Lecture 11 U.C. Berkeley CS78: Computatioal Complexity Hadout N Professor Luca Trevisa 3/4/008 Notes for Lecture Eigevalues, Expasio, ad Radom Walks As usual by ow, let G = (V, E) be a udirected d-regular graph with

More information

Lecture Chapter 6: Convergence of Random Sequences

Lecture Chapter 6: Convergence of Random Sequences ECE5: Aalysis of Radom Sigals Fall 6 Lecture Chapter 6: Covergece of Radom Sequeces Dr Salim El Rouayheb Scribe: Abhay Ashutosh Doel, Qibo Zhag, Peiwe Tia, Pegzhe Wag, Lu Liu Radom sequece Defiitio A ifiite

More information

Final Review for MATH 3510

Final Review for MATH 3510 Fial Review for MATH 50 Calculatio 5 Give a fairly simple probability mass fuctio or probability desity fuctio of a radom variable, you should be able to compute the expected value ad variace of the variable

More information

Statistics 511 Additional Materials

Statistics 511 Additional Materials Cofidece Itervals o mu Statistics 511 Additioal Materials This topic officially moves us from probability to statistics. We begi to discuss makig ifereces about the populatio. Oe way to differetiate probability

More information

Model of Computation and Runtime Analysis

Model of Computation and Runtime Analysis Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map

More information

CS 171 Lecture Outline October 09, 2008

CS 171 Lecture Outline October 09, 2008 CS 171 Lecture Outlie October 09, 2008 The followig theorem comes very hady whe calculatig the expectatio of a radom variable that takes o o-egative iteger values. Theorem: Let Y be a radom variable that

More information

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 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 information

Math 155 (Lecture 3)

Math 155 (Lecture 3) Math 55 (Lecture 3) September 8, I this lecture, we ll cosider the aswer to oe of the most basic coutig problems i combiatorics Questio How may ways are there to choose a -elemet subset of the set {,,,

More information

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece 1, 1, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet

More information

CS 5150/6150: Assignment 1 Due: Sep 23, 2010

CS 5150/6150: Assignment 1 Due: Sep 23, 2010 CS 5150/6150: Assigmet 1 Due: Sep 23, 2010 Wei Liu September 24, 2010 Q1: (1) Usig master theorem: a = 7, b = 4, f() = O(). Because f() = log b a ε holds whe ε = log b a = log 4 7, we ca apply the first

More information

Spectral Partitioning in the Planted Partition Model

Spectral Partitioning in the Planted Partition Model Spectral Graph Theory Lecture 21 Spectral Partitioig i the Plated Partitio Model Daiel A. Spielma November 11, 2009 21.1 Itroductio I this lecture, we will perform a crude aalysis of the performace of

More information

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 12

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 12 Machie Learig Theory Tübige Uiversity, WS 06/07 Lecture Tolstikhi Ilya Abstract I this lecture we derive risk bouds for kerel methods. We will start by showig that Soft Margi kerel SVM correspods to miimizig

More information

Chapter 18 Summary Sampling Distribution Models

Chapter 18 Summary Sampling Distribution Models Uit 5 Itroductio to Iferece Chapter 18 Summary Samplig Distributio Models What have we leared? Sample proportios ad meas will vary from sample to sample that s samplig error (samplig variability). Samplig

More information

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman: Math 224 Fall 2017 Homework 4 Drew Armstrog Problems from 9th editio of Probability ad Statistical Iferece by Hogg, Tais ad Zimmerma: Sectio 2.3, Exercises 16(a,d),18. Sectio 2.4, Exercises 13, 14. Sectio

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Desig ad Aalysis of Algorithms CSE 53 Lecture 9 Media ad Order Statistics Juzhou Huag, Ph.D. Departmet of Computer Sciece ad Egieerig Dept. CSE, UT Arligto CSE53 Desig ad Aalysis of Algorithms Medias ad

More information