Solutions_to_Introduction_to_Algorithm_3nd_Exercise_3

3.1-1 Let f(n) and g(n) be asymptotically nonnegative functions. Using the basic definition of Θ-notation, prove that max(f(n),g(n))=Θ(f(n)+g(n)).
  Let f(n),g(n) be asymptotically nonnegative. Show that max(f(n),g(n)) = Θ(f(n)+g(n)). This means that there exists positive constants c1,c2 and n0 such that, 0<= c1(f(n)+g(n))<=max(f(n),g(n))<=c2(f(n)+g(n)), for all n>=n0.
  Selecting c2=1 clearly shows the third inequality since the maximum must be smaller than the sum. c1 should be selected as 1/2 since the maximum is always greater than the weighted average of f(n) and g(n). Note tha significance of the "asymptotically nonnegative" assumption. The first inequality could be satisfied otherwise

3.1-2 Show that for any real constants a and b, where b>0,

  To show that , we want to find constants c1,c2,n0>0 such that 

  Note that  and Thus,Since b>0, the inequality still holds when all parts are raised to the power b:



Thus, satisfy the definition.


3.1-3 Explain why the statement, "The running time of algorithm A is at least," is meaningless.

  Let the running time be T(n).   means that  for some function f(n) in the set , This statement holds for any running time T(n), since the function g(n)=0 for all n is in,and running times are always nonnegative. Thus, the statement tells us nothing about the running time.


3.1-4 Is ? Is ?

  ,but .

  To show that, we must find constants c, such that .

  Since  for all n, we can satisfy the definition with c=2 and 

  To show that , assume there exist constants c, such that .

  Then . But no constant is greater than all , and so the assumption leads to contradiction.





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值