*T*_{BS} = 4n + *T*_{IS}n + 3

Let *n*_{i} = number of elements in bucket B[i].

The expected time to sort elements in B[i] =
*E*(*O*(*n*_{i}^{2})) =
*O*(*E*(*n*_{i}^{2})).

Note that the **expected value** of a random variable X as described in
Chapter 6, is

The variable x here represents the value of X, and Pr(X=x) represents the probability that the value of X is x.

The variance of a random variable X with mean E[X] is notated Var[X].

- E[
*X*^{2}] = Var[X] +*E*^{2}[X] - P(X=k) = This is the binomial distribution for n trials.