日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

算法导论第三版 第3章习题答案

發布時間:2023/12/10 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 算法导论第三版 第3章习题答案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2020/10/28:初稿,參考https://ita.skanev.com/,修訂參考文獻的部分錯誤

2020/10/30:修訂第二節第4題的證明錯誤(參考https://blog.csdn.net/qq_36414798/article/details/81028403)

3 Growth of Functions

3.1 Asymptotic notation

1.Let?f(n)?+?g(n)?be asymptotically nonnegative functions. Using the basic definition of?Θ-notation, prove that?max(f(n),g(n))=Θ(f(n)+g(n)).

From asymptotically nonnegative, we can assume that:

Let??, some obvious things for?:

From the last two inequalities, we get:

Which is the definition of?with?

2.Show that for any real constants?a?and?b, where?b>0,

The most significant term is? and this is obviously polynomially tightly bound.

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

The?O-notation provides an upper bound. "At least" implies a lower bound.

4.Is? ? Is?

Yes, because if we choose?2?for both constants in the?O-notation definition, we get an equality.

No, because?

5.Prove Theorem 3.1

The theorem states:

For any two functions?f(n)?and?g(n), we have?f(n)=Θ(g(n))?if and only if?f(n)=O(g(n))?and?f(n)=Ω(g(n))

6.Prove that the running time of an algorithm is?Θ(g(n))?if and only if its worst-case running time is?O(g(n))?and its best-case running time is?Ω(g(n)).

7.Prove?o(g(n))∩ω(g(n))?is the empty set.

8.We can extend our notation to the case of two parameters?n?and?m?that can go to infinity independently at different rates. For a given function?g(n,m)?we denote?O(g(n,m))?the set of functions:

Give corresponding definitions for?Ω(g(n,m))?and?Θ(g(n,m)).

3.2 Standard notations and common functions

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.

2.Prove equation (3.16)

3.Prove equation (3.19). Also prove that?n!=ω()?and?n!=o().

?4.Is the function??lgn?!?polynomially bounded? Is the function??lglgn?!?polynomially bounded?

?lgn?! is not polynomially bounded, but ?lglgn!??is.

If we take the definition of polynomially bound:

and take the logarithm of each side, we get:

Thus, a function is polynomially bound if?

In the following proofs, we will make use of the following two facts:

lg(n!) =?Θ(nlgn) (by equation (3.19))

?lgn??=?Θ(lgn), because

· ?lgn???≥?lgn

· ?lgn???≤?lgn + 1?≤?2lgn,?for all n?≥?2

lg(?lgn?!) =?Θ(?lgn?lg?lgn?) =?Θ(lgn lg lgn) =?ω(lgn).Therefore, lg(?lgn?!)?≠ Ο(lgn), and so??lgn?! is not polynomially bounded.

lg(?lglgn?!) =?Θ(?lglgn?lg?lglgn?) =?Θ(lglgn lg lglgn) =? =? ??=?ο(lgn) .

The last step above follows from the property that any polylogarithmic function grows more slowly than any positive polynomial function, i.e., that for constants a, b?>?0, we have =?. Substitute lgn for n, 2 for b, and 1 for a, giving.

Therefore, lg(?lglgn?!) =?Ο(lgn), and so??lglgn?! is polynomially bounded.

5.?Which is asymptotically larger:

The second, because:

6.Show that the golden ratio???and its conjugate??both satisfy the equation?.

7.Proove by induction that the?ith Fibonacci number satisfies the equality

Base:

Step:

8.Show that??implies?.

Problem

3.1?Asymptotic behavior of polynomials

3.2?Asymptotic behavior of polynomials

Indicate for each pair of expressions?(A,B)?in the table below, whether?A?is?O,?o,?Ω,?ω, or?Θ?of?B. Assume that?k≥1,??>0, and?c>1?are constants. Your answer should be in the form of the table with "yes" or "no" written in each box.

Note:

3.3 Ordering by asymptotic growth rates.?

a.Rank the following functions by order of growth;that is, find an arrangement??of the functions?. Partition your list into equivalence classes such that functions?f(n)?and?g(n)?are in the same class if and only if?.

b.Give an example of a single nonnegative function?f(n)?such that for all functions?gi(n)?in part (1),?f(n)?is neither??nor?.

The order is thus:

  • The asked function can be:

    3.4 Asymptotic notation properties

    3.5?Variations on?O?and?Ω

    3.6?Iterated functions

    總結

    以上是生活随笔為你收集整理的算法导论第三版 第3章习题答案的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。