# Thread:

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
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 15, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.946499764919281, "perplexity_flag": "head"}