# Math Help - Big-O notation question

1. ## Big-O notation question

hi guys,
can someone pls explain big-o notation to me in easy to understand way with an easy example?? I am trying to understand it by reading my textbook but i am not getting it at all. It uses the following example: show that f(x) = x^2 + 2x + 1 is O(x^2)

My first question is, what value of x do i start with?? i dont know how one chooses a value of x to start with. in the book, it starts with x > 1. I dont understand how they came up with 1 instead of 2, 3 or any other number.

if someone could please answer my question and also explain the big-o notation in an easy to understand way with an example, it would be great. thanks a lot in advance! i really appriciate it.

2. Originally Posted by bokasoka
hi guys,
can someone pls explain big-o notation to me in easy to understand way with an easy example?? I am trying to understand it by reading my textbook but i am not getting it at all. It uses the following example: show that f(x) = x^2 + 2x + 1 is O(x^2)

My first question is, what value of x do i start with?? i dont know how one chooses a value of x to start with. in the book, it starts with x > 1. I dont understand how they came up with 1 instead of 2, 3 or any other number.

if someone could please answer my question and also explain the big-o notation in an easy to understand way with an example, it would be great. thanks a lot in advance! i really appriciate it.
$f(x) \in O(g(x))$

means that for big enough $\displaystyle x$: $|f(x)|$ is less than (or equal) some fixed multiple of $\displaystyle g(x)$. This means that there exists an $x_0$ such that for all $x\ge x_0$, and a $k>0$:

$|f(x)|\le k g(x)$

In the case of your example for all $x \ge 1$ ; $x^2\ge x$ and $x^2 \ge 1$. Hence for all $x \ge 1$

$|f(x)|=f(x)=x^2+2x+1\le x^2+2x^2+x^2=4x^2$

Hence $f(x) \in O(x^2)$ (using $x_0=1,\ k=4$)

CB