$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
Asked
Active
Viewed 33 times
0
-
4See this https://math.stackexchange.com/q/2798125/42969 for what $\theta(n^2)$ means. – Martin R Feb 04 '21 at 20:45
1 Answers
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