简体   繁体   English

渐近上界

[英]Asymptotic Upper Bound

Hi I solved a question with recursion tree method. 嗨,我用递归树方法解决了一个问题。 Then I reached the below equatition. 然后我达到了以下装备。 n ∑ 3^(i-1)(n - (i - 1)) i=1

I need to find asymptotic upper bound for that equation. 我需要找到该方程的渐近上限。 Any help would be appreciated. 任何帮助,将不胜感激。

Wolfram Alpha is a great tool for this: https://www.wolframalpha.com/input/?i=sum(3%5E(i-1)(n+-+i+%2B+1)+for+i+%3D+1..n) Wolfram Alpha为此非常有用: https : //www.wolframalpha.com/input/?i= sum(3%5E(i-1)(n+-+i+%2B+1)+for+ i+%3D + 1..n)

That tool simplifies the sum to: (-2n + 3^(n+1) - 3)/4 . 该工具将总和简化为: (-2n + 3^(n+1) - 3)/4

In terms of big-O, that's O(3^n). 用big-O表示,就是O(3 ^ n)。

Let u(n) = 3^(n-1) + 2*3^(n-2) + ... + n, then 令u(n)= 3 ^(n-1)+ 2 * 3 ^(n-2)+ ... + n
u(n+1) = (3^n + 3^(n-1) + ... + 1) + 3^(n-1) + 2*3^(n-2) + ... + n = (3^(n+1)-1)/2 + u(n) = 3*u(n) + n + 1 u(n) = (3^(n+1) - 2n - 3) / 4. u(n + 1)=(3 ^ n + 3 ^(n-1)+ ... + 1)+ 3 ^(n-1)+ 2 * 3 ^(n-2)+ ... + n =(3 ^(n + 1)-1)/ 2 + u(n)= 3 * u(n)+ n + 1 u(n)=(3 ^(n + 1)-2n-3)/ 4 。

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

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