0

$1+2+3+...+n=\theta(n^2)$ This is the equation.I tried to find the $\theta$ value but I am not sure if it is the right way to do this.I would appreciate any tips how to solve this one

saulspatz
  • 53,131

1 Answers1

1

$ f(n)=O{\bigl (}g(n){\bigr )}$ if there exist positive integer numbers $M$ and $n_0$ such that $f ( n )\le M g ( n )$ for all $n \ge n_0$

In your case $$f(n)=1+2+3+\ldots+n=\frac{n(n+1)}{2}=\frac{n^2}{2}+\frac{n}{2}$$ $$f(n)=O{\bigl (}n^2{\bigr )}$$ because for $M=1$ and $n_0=1$ we have $$\frac{n^2}{2}+\frac{n}{2}<n^2,\forall n\ge 1$$

Raffaele
  • 26,371