lecture 7-cs648
TRANSCRIPT
![Page 1: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/1.jpg)
Randomized AlgorithmsCS648
Lecture 7
Two applications of Union Theorem
• Balls into Bin experiment : Maximum load
• Randomized Quick Sort: Concentration of the running time
1
![Page 2: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/2.jpg)
Union theorem
2
![Page 3: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/3.jpg)
Union theorem
3
![Page 4: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/4.jpg)
APPLICATION 1 OF THE UNION THEOREM
BALLS INTO BINS: MAXIMUM LOAD
4
![Page 5: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/5.jpg)
Balls into Bins
5
1 2 3 … i … n
1 2 3 4 5 … m-1 m
![Page 6: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/6.jpg)
Balls into Bins
6
1 2 3 … j … n
1 2 3 4 5 … m-1 m
![Page 7: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/7.jpg)
Balls into BinsThe main difficulty and the way out
7
1 2 3 … j … n
1 2 3 4 5 … m-1 m
![Page 8: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/8.jpg)
8
1 2 3 … j … n
1 2 3 4 5 … m-1 m
![Page 9: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/9.jpg)
9
1 2 3 … j … n
1 2 3 4 5 … m-1 m
![Page 10: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/10.jpg)
10
![Page 11: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/11.jpg)
11
![Page 12: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/12.jpg)
Balls into Bins
12
![Page 13: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/13.jpg)
APPLICATION 2 OF THE UNION THEOREM
RANDOMIZED QUICK SORT:THE SECRET OF ITS POPULARITY
13
![Page 14: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/14.jpg)
Concentration of Randomized Quick Sort
14
A
![Page 15: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/15.jpg)
Concentration of Randomized Quick SortTools needed
15
![Page 16: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/16.jpg)
Randomized QuickSortThe main difficulty and the way out
16
Elements of A arranged in Increasing order of values
![Page 17: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/17.jpg)
Randomized QuickSortThe main difficulty and the way out
17
Elements of A arranged in Increasing order of values
![Page 18: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/18.jpg)
18
Elements of A arranged in Increasing order of values
![Page 19: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/19.jpg)
19
![Page 20: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/20.jpg)
Randomized QuickSortA new way to count the comparisons
20
Elements of A arranged in Increasing order of values
![Page 21: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/21.jpg)
Randomized QuickSortApplying Union theorem
21
![Page 22: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/22.jpg)
22
![Page 23: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/23.jpg)
Randomized Quick Sort
Definition: a recursive call is good if the pivot is selected from the middle half, and bad otherwise.
P(a recursive call is good) = ??
Notation: The size of a recursive call is the size of the subarray it sorts.
23
middle-half
Increasing order of values
…
![Page 24: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/24.jpg)
Randomized Quick Sort
24
middle-half
Increasing order of values
…
![Page 25: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/25.jpg)
Randomized Quick Sort
25
middle-half
Increasing order of values
…
![Page 26: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/26.jpg)
26
![Page 27: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/27.jpg)
Randomized Quick SortFinal result
27
![Page 28: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/28.jpg)
SOME WELL KNOWN AND WELL STUDIED
RANDOM VARIABLES
28
![Page 29: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/29.jpg)
Bernoulli Random Variable
29
![Page 30: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/30.jpg)
Binomial Random Variable
30
![Page 31: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/31.jpg)
Geometric Random Variable
31
![Page 32: Lecture 7-cs648](https://reader035.vdocuments.mx/reader035/viewer/2022070323/5597df371a28ab69388b474f/html5/thumbnails/32.jpg)
Negative Binomial Random Variable
32