对于下限,lg(n!) = lg(n)+lg(n-1)+...+lg(n/2)+...+lg2+lg1 >= lg(n/2)+lg(n/2)+...+lg(n/2)+ ((n-1)/2) lg 2 (leave last term lg1(=0); replace first n/2 terms as lg(n/2); replace last (n-1)/2 terms as lg2 which will make cancellation easier later) = n/2 lg(n/2) + (n/2) lg 2 - 1/2 lg 2 = n/2 lg n - (n/2)(lg 2) + n/2 - 1/2 = n/2 lg n - 1/2lg(n!)> =(1/2)(n lg n-1)结合两个界限:1/2(n lg n-1)<= lg(n!)<= n lg n通过选择大于(1/2)的下界常数,我们可以补偿括号内的-1。因此lg(n!)= Theta(n lg n)