算法导论(第三版)参考答案:思考题3.1,思考题3.2,思考题3.3,思考题3.4,思考题3.5,思考题3.6
Problem 3-1
Let
>p(n)=∑i=0daini>
where ad>0 , be a degree- d polynomial inn , and let k be a constant. Use the definitions of the asymptotic notations to prove the following properties.
- If
k≥d , then p(n)=O(nk) .
- If k≤d , then p(n)=Ω(nk) .
- If k=d , then p(n)=Θ(nk) .
- If k>d , then p(n)=o(nk) .
- If k<d , then p(n)=ω(nk) .
情况 1:
0≤∑i=0daini=adnd+ad−1nd−1+…+a1n+a0≤cnk
不等式左边显然成立。对等式右边同时除以 nd ,
ad+ad−1n+ad−2n2+…+a0ndadnk−d+ad−1nk−d+1+ad−2nk−d+2+…+a0nk−d≤cnk−d≤c
当 c=d+1 ,只要 n0=max(ad−−√k−d,ad−1−−−−√k−d+1,…,a0−−√k) ,可以证明 p(n)=O(nk) 。
情况 2:
0≤cnkc≤∑i=0daini=adnd+ad−1nd−1+…+a1n+a0≤ad+ad−1nk−d+1+…+a0nk
当 c=ad−1 , n0=1 时。 p(n)=Ω(nk)
情况 3:
0≤c1nkc1≤adnd+ad−1nd−1+…+a1n+a0≤c2nk≤ad+ad−1nk−d+1+…+a0nk≤c2
当 c1=ad−1,c2=ad+d,