Help finding Complexity in Big-O notation

Click For Summary

Discussion Overview

The discussion revolves around determining the Big-O complexity of a given algorithm expressed through a complex summation. Participants explore how to analyze the expression to establish whether it is bounded by n^3 or n^4, focusing on theoretical aspects of algorithm complexity.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a complex summation and seeks assistance in finding its Big-O notation, suggesting it might be bounded by n^3 based on empirical testing.
  • Another participant proposes a simplification of the summation, indicating that certain terms can be estimated and suggesting that the overall complexity could be O(n^3) or O(n^4) depending on the evaluation of the innermost sum.
  • A third participant expresses a desire to confirm that the complexity is n^3 but acknowledges the uncertainty in their empirical observations and considers the possibility of it being n^4 if simplifications do not yield the desired result.
  • A fourth participant challenges the n^3 assumption, asserting that they expect the complexity to be O(n^4) and believes it can be demonstrated easily.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the complexity of the algorithm. There are competing views, with some suggesting it could be O(n^3) while others argue for O(n^4).

Contextual Notes

The discussion includes various assumptions about the behavior of the summation and the application of Big-O notation, but these assumptions remain unresolved. The exact nature of the terms and their contributions to the overall complexity is not fully explored.

pandrade
Messages
4
Reaction score
0

Homework Statement



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 proved that it's bounded by n^3or n^4 ? Thank you!

Homework Equations



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

The Attempt at a Solution



I run 1000 numbers and apparently it is bounded by n^3.
 
Last edited by a moderator:
Physics news on Phys.org
First simplification step:
\sum_{j=3}^{n} \left[O(n)O(n) + O(n^2) + <br /> \sum_{k=2}^{j-2}\left[k(j-(k+1))+\sum_{i=k}^{j-2}(i)\right]\right]
To get O(n^3) I think you have to evaluate the innermost sum to cancel some parts of the k(j-(k+1)), but apart from that (or for an O(n^4)-boundary) you can always estimate those terms as bounded by n, with rules like O(n)O(n)=O(n^2) and so on.
 
I see.
To be honest I would like to get a n^3 :-), but I see what you are saying.
I have plotted it against n^3 for n from 1 to 10,000 and I guess I got carried away because it seemed to be asymptotically bounded, but of course, there's no guarantee, at all.
I will try to open the sum and see if it cancels out, as you suggested, if not, I'll consider n^4.
Thank you so much!
 
I don't think this is O(n^3).
I would expect O(n^4), and this is easy to show.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K