简体   繁体   English

渐近增长率的排序函数

[英]Ordering functions by Asymptotic Growth Rate

List the following functions in non-descending order of asymptotic growth rate. 以渐近增长率的降序排列以下功能。 If two or more functions have the same asymptotic growth rate then group them together. 如果两个或多个函数具有相同的渐近增长率,则将它们组合在一起。

g1(n) = n g1(n)= n

g2(n) = n^3 +4n g2(n)= n ^ 3 + 4n

g3(n) = 2n log(base 2) n g3(n)= 2n log(以2为底)n

g4(n) = 2^n g4(n)= 2 ^ n

g5(n) = 3 ^ (3 * log(base 3) n) g5(n)= 3 ^(3 * log(以3为底的n)n)

g6(n) = 10^n g6(n)= 10 ^ n

I've been looking through several examples online but I have no idea how to do this, it just seems like a completely foreign concept to me. 我一直在网上浏览几个示例,但是我不知道该怎么做,对我来说这似乎是一个完全陌生的概念。 If anyone could help me, that would be much appreciated. 如果有人可以帮助我,将不胜感激。 how do I even calculate the growth rate? 我什至如何计算增长率?

Many of the techniques that you might find most useful here are tricks for manipulating expressions involving logs and exponents. 您可能在这里发现最有用的许多技术都是处理涉及对数和指数的表达式的技巧。

First, you might want to review the power rule for logarithms: 首先,您可能想查看对数的幂规则:

a log b c = log b c a . a log b c = log b c a

Next, there's the fact that exponents and logarithms are inverses of one another: 接下来,存在一个事实,即指数和对数彼此相反:

log b b n = b log b n = n log b b n = b log b n = n

These rules might help you rewrite g 5 (n), for example. 例如,这些规则可以帮助您重写g 5 (n)。

Here's another helpful rule: 这是另一个有用的规则:

(a b ) c = a bc = (a c ) b . (a bc = a bc =(a cb

You can actually use the two previous rules to change the bases of exponential functions. 您实际上可以使用前面的两个规则来更改指数函数的基数。 For example, suppose you want to compare 2 n to 5 n . 例如,假设您要比较2 n与5 n Notice that 注意

5 n = (2 log 2 5 ) n 5 n =(2 log 2 5n

= (2 n ) log 2 5 . =(2 nlog 2 5

Does that make it easier to see which of these two functions will grow more rapidly? 这样是否更容易看出这两个功能中的哪一个将更快地增长?

Finally, you might want to use the following fact: all polynomials grow slower than all exponents whose base is greater than 1. This means that n k grows strictly slower than a n for any n > 1. Similarly, all polynomials grow strictly faster than all logarithms, so log b n < n k for all k > 0. 最后,您可能想使用以下事实:所有多项式的增长都比所有底数大于1的指数慢。这意味着,对于任何n> 1,n k的增长都比n严格慢。类似地,所有多项式的增长都比所有对数,因此对于所有k> 0,记录b n <n k

Using the above rules, see if you can try to rewrite each of these expressions as either a logarithm of n, a polynomial in n, or something exponential in n. 使用以上规则,查看是否可以尝试将每个表达式重写为n的对数,n中的多项式或n中的指数形式。 From there, you can then rank the logarithmic expressions against themselves, the polynomials against themselves, and the exponentials against themselves, then write them out in order. 然后,您可以从那里对数表达式对自己,对多项式对自己,对指数对自己进行排序,然后按顺序将它们写出来。

Generally speaking, the techniques mentioned here are super useful going forward. 一般来说,这里提到的技术在将来很有用。 I hope that this gets you on the right track! 我希望这能使您走上正确的道路!

There's a very simple rule that can help out with these problems. 有一个非常简单的规则可以解决这些问题。 It's very easy to prove using the basic definitions of calculus and complexity (and it might be a good exercise to boot). 使用微积分和复杂性的基本定义很容易证明(并且可能是一个很好的启动方法)。

Given two functions, f(n) and g(n) : 给定两个函数f(n)g(n)

  • if lim n → ∞ f(n) / g(n) = 0 , then f(n) = o(g(n) . 如果lim n→∞f (n)/ g(n)= 0 ,则f(n)= o(g(n)

  • if lim n → ∞ f(n) / g(n) = ∞ , then f(n) = w(g(n) (this follows from the previous point). 如果lim n→∞f (n)/ g(n)=∞ ,则f(n)= w(g(n) (从上一点起)。

  • if lim n → ∞ f(n) / g(n) = c , 0 < c < ∞ , then f(n) = Θ(g(n) . 如果lim n→∞f (n)/ g(n)= c0 <c <∞ ,则f(n)=Θ(g(n)

Looking at your examples here, they can each and every one of which be solved using these. 在这里查看您的示例,可以使用它们解决每一个示例。 Eg, lim n → ∞ g1(n) / g2(n) = 0 , so g1(n) = o(g2(n)) . 例如, lim n→ ∞g1(n)/ g2(n)= 0 ,所以g1(n)= o(g2(n))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM