简体   繁体   English

了解上限,下限算法分析的实例

[英]Understanding an instance of upper bound, lower bound algorithmic analysis

I am continuing on my task of understanding asymptotic analysis. 我正在继续了解渐近分析的任务。 It may be best to just have a meta post, if mods would prefer. 如果mod愿意,最好只发布一个meta帖子。 Anyway: 无论如何:

I have two functions: 我有两个功能:

 f(n) = n^2
 g(n) = (log n)^80

From analysis with l'Hopitals rule: 根据l'Hopitals规则进行分析:

 lim(n->∞) f(n)/g(n) = f'(n)/g'(n)

Which leaves us with us with: 这给我们留下了:

 f'(n)/g'(n) = 2n/(80*(log n / √2)

Which will eventually lead us to: 最终将导致我们:

 0/g''(n) = 0 

Which, as I understand it, shows that f(n) = o(g(n)) 据我了解,这表明f(n)= o(g(n))

Is my understanding correct? 我的理解正确吗?

You can apply L'Hopital rule either if both of numerator and denominator converge to zero or infinity. 如果分子和分母都收敛到零或无穷大,则可以应用L'Hopital规则。 So Your approach is true in general. 因此,您的方法通常是正确的。 But you made mistake to compute g'(n). 但是您在计算g'(n)时出错。

g'(n) = (80 * log(n)) * 1/(2 ln (n))
  => f'(n)/g'(n) = 2n / ((80 * log(n)^79) * 1/(n ln(2))) 
   = 2n^2 / 80log(n)^79 ln(2)

At the moment, the limit of f'(n)/g'(n) is ∞/∞ too. 此刻,f'(n)/ g'(n)的极限也为∞/∞。 So you can apply L'Hopital rule again. 因此,您可以再次应用L'Hopital规则。 But the result is same. 但是结果是一样的。 But after 80th apply, you have this: 但是在第80次申请后,您将获得以下信息:

2^80 n^2 / 80! ln(2)^80
  =>  lim(n->∞) f(n)/g(n) = ∞ 

Thus, g(n) = o(f(n)) . 因此, g(n)= o(f(n))

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

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