算法导论(第三版)参考答案:练习3.2-1,练习3.2-2,练习3.2-3,练习3.2-4,练习3.2-5,练习3.2-6,练习3.2-7,练习3.2-8
Exercise 3.2-1
Show that if f(n) and g(n) are monotonically increasing functions, then so are the functions f(n)+g(n) and f(g(n)) , and if f(n) and g(n) are in addition nonnegative, then f(n)⋅g(n) is monotonically increasing.
f(n) , g(n) 单调递增,则:
f(m)≤f(n) for m≤ng(m)≤f(n) for m≤n
可得:
f(m)+g(m)≤f(n)+g(n)f(g(m))≤f(g(n))f(m)⋅g(m)≤f(n)⋅g(n),if f(n),g(n) are nonnegative.
所以,得证。
Exercise 3.2-2
Prove equation (3.16)
>alogbc=clogba>
alogbc=alogaclogab=(alogac)1logab=clogba
Exercise 3.2-3
Prove equation (3.19). Also prove that n!=ω(2n) and n!=o(nn) .
>lg(n!)=Θ(nlgn)>(3.19)
根据斯特林近似公式:
lg(n!)=lg(2πn−−−√(