TY - JOUR
T1 - Upper tail analysis of bucket sort and random tries
AU - Bercea, Ioana O.
AU - Even, Guy
N1 - Publisher Copyright:
© 2021
PY - 2021/12/4
Y1 - 2021/12/4
N2 - Bucket Sort is known to run in expected linear time when the input keys are distributed independently and uniformly at random in the interval [0,1). The analysis holds even when a quadratic time algorithm is used to sort the keys in each bucket. We show how to obtain linear time guarantees on the running time of Bucket Sort that hold with very high probability. Specifically, we investigate the asymptotic behavior of the exponent in the upper tail probability of the running time of Bucket Sort. We consider large additive deviations from the expectation, of the form cn for large enough (constant) c, where n is the number of keys that are sorted. Our analysis shows a profound difference between variants of Bucket Sort that use a quadratic time algorithm within each bucket and variants that use a Θ(blogb) time algorithm for sorting b keys in a bucket. When a quadratic time algorithm is used to sort the keys in a bucket, the probability that Bucket Sort takes cn more time than expected is exponential in Θ(nlogn). When a Θ(blogb) algorithm is used to sort the keys in a bucket, the exponent becomes Θ(n). We prove this latter theorem by showing an upper bound on the tail of a random variable defined on tries, a result which we believe is of independent interest. This result also enables us to analyze the upper tail probability of a well-studied trie parameter, the external path length, and show that the probability that it deviates from its expected value by an additive factor of cn is exponentially small in Θ(n).
AB - Bucket Sort is known to run in expected linear time when the input keys are distributed independently and uniformly at random in the interval [0,1). The analysis holds even when a quadratic time algorithm is used to sort the keys in each bucket. We show how to obtain linear time guarantees on the running time of Bucket Sort that hold with very high probability. Specifically, we investigate the asymptotic behavior of the exponent in the upper tail probability of the running time of Bucket Sort. We consider large additive deviations from the expectation, of the form cn for large enough (constant) c, where n is the number of keys that are sorted. Our analysis shows a profound difference between variants of Bucket Sort that use a quadratic time algorithm within each bucket and variants that use a Θ(blogb) time algorithm for sorting b keys in a bucket. When a quadratic time algorithm is used to sort the keys in a bucket, the probability that Bucket Sort takes cn more time than expected is exponential in Θ(nlogn). When a Θ(blogb) algorithm is used to sort the keys in a bucket, the exponent becomes Θ(n). We prove this latter theorem by showing an upper bound on the tail of a random variable defined on tries, a result which we believe is of independent interest. This result also enables us to analyze the upper tail probability of a well-studied trie parameter, the external path length, and show that the probability that it deviates from its expected value by an additive factor of cn is exponentially small in Θ(n).
KW - Analysis of running time
KW - Randomized algorithms
KW - Sorting
UR - http://www.scopus.com/inward/record.url?scp=85117240722&partnerID=8YFLogxK
U2 - 10.1016/j.tcs.2021.09.029
DO - 10.1016/j.tcs.2021.09.029
M3 - מאמר
AN - SCOPUS:85117240722
VL - 895
SP - 55
EP - 67
JO - Theoretical Computer Science
JF - Theoretical Computer Science
SN - 0304-3975
ER -