CSC263H1 Lecture Notes - Lecture 12: Binary Logarithm, Las Vegas Algorithm, Telescoping Series

35 views3 pages
27 Oct 2015
School
Course
Professor

Document Summary

Sample space sn = { all permutations of [1, 2, . , n]} with uniform probability distribution (not necessarily a good assumption in general). Note implicit assumption in our choice of sn: no repeated element. Input s one permutation from sn. tn(s) = # of comparisons on input s in sn. Let i = rst element of s. this will be the pivot. t0(s) = 0, t1(s) = 0, tn(s) = n 1 + ti 1(l) + tn 1(g) Because of our choice of probability distribution over the sample space, all permutations are equally likely. , n} equally likely to be rst in s. Pivot equal 1 with probability 1/n, . Also, after parition, l, g equally likely to be in any order. This leads to recurrence for t (cid:48)(n) = e[tn]: 1 n n(cid:88) i=1 (n 1 + t (i 1) + t (n i)) n 1(cid:88) j=1. First, write down expressions for t (cid:48)(n) and t (cid:48)(n 1):

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions