1

Recently been looking into algorithms and trying to understand the big O notation. On the wikipedia website it gives an example linked below to image in reference.

I'm struggling to understand why we can simplify the $-2x^3$ to $+2x^3$, and then on line 2 why we can further simplify to $+2x^4 + 5x^4$ ? Thanks in advance for guidance! \

$| 6x^4 - 2x^3 + 5 | ≤ 6x^4 + | 2x^3 | + 5$
$| 6x^4 - 2x^3 + 5 | ≤ 6x^4 + 2x^4 + 5x^4$
$| 6x^4 - 2x^3 + 5 | ≤ 13x^4$

wiki-big-o-notation-example
https://en.wikipedia.org/wiki/Big_O_notation

cookies
  • 13
  • Could you please directly add the stuff you are talking about in the form of text or image? – Tereza Tizkova Oct 03 '21 at 13:02
  • 1
    Apologies I would have included an image, however I do not have the required amount of points (10+) to upload an image. On the wikipedia page for big o notation it's the #Example section I'm referencing in the question. I've edited the text in my answer. – cookies Oct 03 '21 at 13:19
  • 1
  • The absolute value of a sum is known to be no greater than the sum of absolute values. 2) If $x>1$, then $x^3<x^4$ and $5<5x^4$.
  • –  Oct 03 '21 at 13:23
  • https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation – Roddy MacPhee Oct 03 '21 at 14:19
  • @RoddyMacPhee thank you for the article, really enjoyable read. Still struggling to understand the rules that allow us to simplify ($2x^4$ and $5x^4$)...might just be taking a while to sink in. – cookies Oct 03 '21 at 19:20
  • Asymptotics discusses what happens as inputs get larger, most constant factors are small enough that in a reasonable range they don't make the difference between classifications. $5x^4< x^5$ any time $x>5$ – Roddy MacPhee Oct 03 '21 at 19:24
  • @RoddyMacPhee that makes sense, thanks! Also going to leave this link here in case it's useful to anyone else stumbling across big O notation for computer science https://www.bigocheatsheet.com/ – cookies Oct 03 '21 at 20:15