I am studying a Big-O example but I just do not get the idea. I have already seen that this question was asked in this forum but I am still confused. Can someone please provide another explanation so I can have more options to analyze? My main question in the part that says "Because each of the integers in the sum of the first n positive integers does not exceed n". How can I get to this reasoning?
The problem is as follows:
How can big-O notation be used to estimate the sum of the first n positive integers? Solution: Because each of the integers in the sum of the first n positive integers does not exceed n, it follows that 1 + 2+· · ·+n ≤ n + n+· · ·+n = n2. From this inequality it follows that 1 + 2 + 3+· · ·+n is O(n2), taking C = 1 and k = 1 as witnesses. (In this example the domains of the functions in the big-O relationship are the set of positive integers.)
[Assuming I understood what you need]: essentially you have a function $S(n)$ on LHS and $n^2$ on RHS and you ask youself, for which $n \geq n_0 $ and $c_1$ will $S_{n \geq n_0} \leq c n^2$. In a sense $ c n^2$ is an upper bound for the rate of growth of $S_n$.
Hence, first you bound the sum by $n^2$ and then notice that $n^2 \in O(n^2)$ with $c=1$ and $n_0=1$. Therefore, $S_n \in O(n^2)$.