5.2.2. Application: Bucket Sort: 12-Feb-15 Mat-72306 Randal, Spring 2015 207
5.2.2. Application: Bucket Sort: 12-Feb-15 Mat-72306 Randal, Spring 2015 207
1
2/12/2015
2
2/12/2015
3
2/12/2015
1 1) + 1) 1
=
!
• When and are large compared to , the
second factor on the RHS is approx. ,
and the third factor is approx.
4
2/12/2015
!
and the expected number of bins with exactly
balls is approximately
Pr =
!
MAT-72306 RandAl, Spring 2015 12-Feb-15 215
]= Pr
=
!
1)!
!
• Because probabilities sum to 1
MAT-72306 RandAl, Spring 2015 12-Feb-15 216
5
2/12/2015
=
!
)
!
.
6
2/12/2015
• Differentiating yields:
+ 1)
• Setting = 0 gives
+1
+1
+1
7
2/12/2015
Pr
=
The proof of 2 is similar.
8
2/12/2015
lim Pr = .
!
MAT-72306 RandAl, Spring 2015 12-Feb-15 223
lim Pr = .
!
matching the earlier approximation
MAT-72306 RandAl, Spring 2015 12-Feb-15 224
9
2/12/2015
10
2/12/2015
11
2/12/2015
) )
Theorem 5.6: The distribution ,…,
)
conditioned on is the same as
) )
,…, , regardless of the value of .
) ) )
Pr ,…, = ,…,
Pr )
= )
Pr
12
2/12/2015
13
2/12/2015
14
2/12/2015
15
2/12/2015
!
We need to choose so that , for
then (by Thm 5.7) we will have that the probability
that the maximum load is not at least in the
exact case is at most <1 .
This will give the lemma
Because the maximum load is clearly
monotonically increasing in the number of balls,
we could also apply the slightly better Thm 5.10,
but this would not affect the argument substantially
It therefore suffices to show that ln , or
equivalently that ln ! < ln ln ln ln
From Lemma 5.8 (not shown), it follows that:
MAT-72306 RandAl, Spring 2015 12-Feb-15 238
16
2/12/2015
17
2/12/2015
18
2/12/2015
19
2/12/2015
20
2/12/2015
21
2/12/2015
22
2/12/2015
23
2/12/2015
24
2/12/2015
25
2/12/2015
26