Randomness in Computing LECTURE 5 Last time Bernoulli
Randomness in Computing LECTURE 5 Last time • Bernoulli and binomial RVs • Jensen’s inequality • Conditional expectation Today • Conditional expectation • Branching process • Geometric RVs • Coupon collector problem 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Conditional expectation: definition • 2/27/2021
Law of total expectation: compact form • 2/27/2021
Law of total expectation: application • 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Branching process 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Geometric random variables • 2/27/2021
Exercise • What is the distribution of the number of rolls of a die until you see a 6? • What is the expected number of rolls until you see a 6? 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Exercise • 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Exercise • 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Coupon Collector’s Problems • 2/27/2021 Sofya Raskhodnikova; Randomness in Computing
Quicksort: divide and conquer • Find a pivot element • Divide: Find the correct position of the pivot by comparing it to all elements. A: pivot 1 • Conquer: Recursively sort the two parts, resulting from removing the pivot. sort Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Quicksort Initial call: Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 j 5 8 3 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 j 5 8 3 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 j 8 3 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 6 5 5 8 3 2 11 13 10 j 8 3 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 6 5 5 8 3 2 11 13 10 8 j 3 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 6 5 5 8 3 2 11 13 10 8 3 j 2 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 8 13 j 2 11 10 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 8 13 2 j 11 10 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 10 8 13 2 11 6 5 3 2 8 13 10 11 j Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 10 8 13 2 11 6 5 3 2 8 13 10 11 j Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 10 8 13 2 11 6 5 3 2 8 13 10 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson j
Example of partitioning 6 10 13 5 8 3 2 11 6 5 13 10 8 3 2 11 6 5 3 10 8 13 2 11 6 5 3 2 8 13 10 11 2 5 3 6 8 13 10 11 Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson
Partitioning algorithm ? j Sofya Raskhodnikova; based on notes by E. Demaine and C. Leiserson r
- Slides: 25