Help finding Complexity in Big-O notation

194 Views Asked by At

I have found the complexity of an algorithm as the expression below. How can I find the complexity in big O notation for such expression? Or prove that it's bounded by $n^3$ or $n^4$. Can I use triple integral to approximate? If so, do I have to consider any error (I just want the highest degree of the resulting polynomial)?

I run 10000 numbers and apparently it is bounded by $n^3$ (can't say for sure).

$\sum_{j=3}^{n} \left[(j-1)[2(j-2)-1] + \sum_{i=2}^{j-2}(i) + \sum_{k=2}^{j-2}\left[k(j-(k+1))+\sum_{i=k}^{j-2}(i)\right]\right]$

Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

Using various forms of the key relation $\sum\limits_{s=1}^ts^a=O(t^{a+1})$ when $t\to\infty$, for each $a\geqslant0$, one sees that the $n$th sum $S_n$ is $$ S_n=\sum_{j\leqslant n}j^2+O(j^2)+O(j^3)+jO(j^2)=\sum_{j\leqslant n}O(j^3)=O(n^4). $$