Give a big-O estimate for a function f(x), use a simple function g of the smallest order.












0












$begingroup$



Task



Find a function $g(x)$ that is Big-O of $f(x)$



$f(x)$ is $mathcal{O}(g(x))$



$f(x)=ncdot log(n^2+1)+n^2cdot log(n)$




I tried to follow/copy one of the examples in my book Discrete Mathematics and Its Applications. Rosen, 7e




Example from book



Give a big-O estimate for $f(x) = (x+1) log(x^2 + 1) + 3x^2$.



Solution:



First, a big-O estimate for $(x + 1) log(x^2 + 1)$ will be found. Note that $(x + 1)$ is $mathcal{O}(x)$. Furthermore, $x^2 + 1 ≤ 2x^2$ when $x > 1$. Hence,



$log(x^2+1) ≤ log(2x^2)=log(2)+log(x^2)=log(2)+2log(x)≤3log(x)$



if $x > 2$. This shows that $log(x^2 + 1)$ is $mathcal{O}(log(x))$.



From Theorem 3 it follows that $(x + 1) log(x^2 + 1)$ is $mathcal{O}(xcdot log(x))$. Because $3x^2$ is $mathcal{O}(x^2)$, Theorem 2 tells us that $f(x)$ is $mathcal{O}(max(xcdot log(x), x^2))$. Because $xcdot log(x) ≤ x^2$, for $x > 1$, it follows that $f(x)$ is $mathcal{O}(x^2)$.



Theorem 2



Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1 + f_2)(x)$ is $mathcal{O}(max(|g1(x)|, |g2(x)|))$



Theorem 3



Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1cdot f_2)(x)$ is $mathcal{O}(g_1(x)cdot g_2(x))$.




I did not managed to find the answer, nor do I know if what I did, I did correctly, but could anyone explain to me how to properly solve the task? This was what I managed to produce:




$log(n^2+1) ≤ log(2n^2) = log(2) + log(n^2) = log(2) + 2log(n) ≤ 3log(n) $



if $n>2$ then $log(n^2+1)$ is $mathcal{O}(log(n))$



if $n>1$ then $n$ is $mathcal{O}(n^2)$



Theorem 3 shows us that $ncdot log(n^2+1)$ is $mathcal{O}(n^2cdot log(n))$




What am I supposed to do now?










share|cite|improve this question









$endgroup$

















    0












    $begingroup$



    Task



    Find a function $g(x)$ that is Big-O of $f(x)$



    $f(x)$ is $mathcal{O}(g(x))$



    $f(x)=ncdot log(n^2+1)+n^2cdot log(n)$




    I tried to follow/copy one of the examples in my book Discrete Mathematics and Its Applications. Rosen, 7e




    Example from book



    Give a big-O estimate for $f(x) = (x+1) log(x^2 + 1) + 3x^2$.



    Solution:



    First, a big-O estimate for $(x + 1) log(x^2 + 1)$ will be found. Note that $(x + 1)$ is $mathcal{O}(x)$. Furthermore, $x^2 + 1 ≤ 2x^2$ when $x > 1$. Hence,



    $log(x^2+1) ≤ log(2x^2)=log(2)+log(x^2)=log(2)+2log(x)≤3log(x)$



    if $x > 2$. This shows that $log(x^2 + 1)$ is $mathcal{O}(log(x))$.



    From Theorem 3 it follows that $(x + 1) log(x^2 + 1)$ is $mathcal{O}(xcdot log(x))$. Because $3x^2$ is $mathcal{O}(x^2)$, Theorem 2 tells us that $f(x)$ is $mathcal{O}(max(xcdot log(x), x^2))$. Because $xcdot log(x) ≤ x^2$, for $x > 1$, it follows that $f(x)$ is $mathcal{O}(x^2)$.



    Theorem 2



    Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1 + f_2)(x)$ is $mathcal{O}(max(|g1(x)|, |g2(x)|))$



    Theorem 3



    Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1cdot f_2)(x)$ is $mathcal{O}(g_1(x)cdot g_2(x))$.




    I did not managed to find the answer, nor do I know if what I did, I did correctly, but could anyone explain to me how to properly solve the task? This was what I managed to produce:




    $log(n^2+1) ≤ log(2n^2) = log(2) + log(n^2) = log(2) + 2log(n) ≤ 3log(n) $



    if $n>2$ then $log(n^2+1)$ is $mathcal{O}(log(n))$



    if $n>1$ then $n$ is $mathcal{O}(n^2)$



    Theorem 3 shows us that $ncdot log(n^2+1)$ is $mathcal{O}(n^2cdot log(n))$




    What am I supposed to do now?










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$



      Task



      Find a function $g(x)$ that is Big-O of $f(x)$



      $f(x)$ is $mathcal{O}(g(x))$



      $f(x)=ncdot log(n^2+1)+n^2cdot log(n)$




      I tried to follow/copy one of the examples in my book Discrete Mathematics and Its Applications. Rosen, 7e




      Example from book



      Give a big-O estimate for $f(x) = (x+1) log(x^2 + 1) + 3x^2$.



      Solution:



      First, a big-O estimate for $(x + 1) log(x^2 + 1)$ will be found. Note that $(x + 1)$ is $mathcal{O}(x)$. Furthermore, $x^2 + 1 ≤ 2x^2$ when $x > 1$. Hence,



      $log(x^2+1) ≤ log(2x^2)=log(2)+log(x^2)=log(2)+2log(x)≤3log(x)$



      if $x > 2$. This shows that $log(x^2 + 1)$ is $mathcal{O}(log(x))$.



      From Theorem 3 it follows that $(x + 1) log(x^2 + 1)$ is $mathcal{O}(xcdot log(x))$. Because $3x^2$ is $mathcal{O}(x^2)$, Theorem 2 tells us that $f(x)$ is $mathcal{O}(max(xcdot log(x), x^2))$. Because $xcdot log(x) ≤ x^2$, for $x > 1$, it follows that $f(x)$ is $mathcal{O}(x^2)$.



      Theorem 2



      Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1 + f_2)(x)$ is $mathcal{O}(max(|g1(x)|, |g2(x)|))$



      Theorem 3



      Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1cdot f_2)(x)$ is $mathcal{O}(g_1(x)cdot g_2(x))$.




      I did not managed to find the answer, nor do I know if what I did, I did correctly, but could anyone explain to me how to properly solve the task? This was what I managed to produce:




      $log(n^2+1) ≤ log(2n^2) = log(2) + log(n^2) = log(2) + 2log(n) ≤ 3log(n) $



      if $n>2$ then $log(n^2+1)$ is $mathcal{O}(log(n))$



      if $n>1$ then $n$ is $mathcal{O}(n^2)$



      Theorem 3 shows us that $ncdot log(n^2+1)$ is $mathcal{O}(n^2cdot log(n))$




      What am I supposed to do now?










      share|cite|improve this question









      $endgroup$





      Task



      Find a function $g(x)$ that is Big-O of $f(x)$



      $f(x)$ is $mathcal{O}(g(x))$



      $f(x)=ncdot log(n^2+1)+n^2cdot log(n)$




      I tried to follow/copy one of the examples in my book Discrete Mathematics and Its Applications. Rosen, 7e




      Example from book



      Give a big-O estimate for $f(x) = (x+1) log(x^2 + 1) + 3x^2$.



      Solution:



      First, a big-O estimate for $(x + 1) log(x^2 + 1)$ will be found. Note that $(x + 1)$ is $mathcal{O}(x)$. Furthermore, $x^2 + 1 ≤ 2x^2$ when $x > 1$. Hence,



      $log(x^2+1) ≤ log(2x^2)=log(2)+log(x^2)=log(2)+2log(x)≤3log(x)$



      if $x > 2$. This shows that $log(x^2 + 1)$ is $mathcal{O}(log(x))$.



      From Theorem 3 it follows that $(x + 1) log(x^2 + 1)$ is $mathcal{O}(xcdot log(x))$. Because $3x^2$ is $mathcal{O}(x^2)$, Theorem 2 tells us that $f(x)$ is $mathcal{O}(max(xcdot log(x), x^2))$. Because $xcdot log(x) ≤ x^2$, for $x > 1$, it follows that $f(x)$ is $mathcal{O}(x^2)$.



      Theorem 2



      Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1 + f_2)(x)$ is $mathcal{O}(max(|g1(x)|, |g2(x)|))$



      Theorem 3



      Suppose that $f_1(x)$ is $mathcal{O}(g_1(x))$ and that $f_2(x)$ is $mathcal{O}(g_2(x))$. Then $(f_1cdot f_2)(x)$ is $mathcal{O}(g_1(x)cdot g_2(x))$.




      I did not managed to find the answer, nor do I know if what I did, I did correctly, but could anyone explain to me how to properly solve the task? This was what I managed to produce:




      $log(n^2+1) ≤ log(2n^2) = log(2) + log(n^2) = log(2) + 2log(n) ≤ 3log(n) $



      if $n>2$ then $log(n^2+1)$ is $mathcal{O}(log(n))$



      if $n>1$ then $n$ is $mathcal{O}(n^2)$



      Theorem 3 shows us that $ncdot log(n^2+1)$ is $mathcal{O}(n^2cdot log(n))$




      What am I supposed to do now?







      discrete-mathematics asymptotics






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Sep 24 '17 at 11:45









      AndreasAndreas

      2015




      2015






















          2 Answers
          2






          active

          oldest

          votes


















          0












          $begingroup$

          First of all, why did you specify that $log(n^2 + 1)$ is $mathcal{O}(log(n))$ "if $n ge 2$"? Big O notation describes the asymptotic behaviour of a function, so it is independent on the specific values assumed by the variable(s).



          That said, not only what you did is correct, but you are practically finished. Indeed, since $nlog(n^2 + 1)$ is $mathcal{O}(n^2log(n))$, from Theorem 2 $nlog(n^2 + 1) + n^2log(n)$ is $mathcal{O}(max{n^2log(n), : n^2log(n)}) = mathcal{O}(n^2log(n))$.



          Note that you could've improved your bound on $nlog(n^2 + 1)$, since actually it is also $mathcal{O}(nlog(n))$. However it doesn't matter in the end since the second summand ($n^2log(n)$) is the dominant one.






          share|cite|improve this answer









          $endgroup$





















            0












            $begingroup$

            I would do it much simpler: you can easily check that
            $$
            nlog(n^2+1)
            = o(n^2log n),
            quadtext{so}
            quad
            nlog(n^2+1)+n^2log nsim_infty n^2log n,
            $$

            which implies
            $$
            n log(n^2+1) + n^2log n
            =mathcal{O}( n^2log n).
            $$






            share|cite|improve this answer











            $endgroup$













              Your Answer





              StackExchange.ifUsing("editor", function () {
              return StackExchange.using("mathjaxEditing", function () {
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              });
              });
              }, "mathjax-editing");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "69"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2442987%2fgive-a-big-o-estimate-for-a-function-fx-use-a-simple-function-g-of-the-smalle%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0












              $begingroup$

              First of all, why did you specify that $log(n^2 + 1)$ is $mathcal{O}(log(n))$ "if $n ge 2$"? Big O notation describes the asymptotic behaviour of a function, so it is independent on the specific values assumed by the variable(s).



              That said, not only what you did is correct, but you are practically finished. Indeed, since $nlog(n^2 + 1)$ is $mathcal{O}(n^2log(n))$, from Theorem 2 $nlog(n^2 + 1) + n^2log(n)$ is $mathcal{O}(max{n^2log(n), : n^2log(n)}) = mathcal{O}(n^2log(n))$.



              Note that you could've improved your bound on $nlog(n^2 + 1)$, since actually it is also $mathcal{O}(nlog(n))$. However it doesn't matter in the end since the second summand ($n^2log(n)$) is the dominant one.






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                First of all, why did you specify that $log(n^2 + 1)$ is $mathcal{O}(log(n))$ "if $n ge 2$"? Big O notation describes the asymptotic behaviour of a function, so it is independent on the specific values assumed by the variable(s).



                That said, not only what you did is correct, but you are practically finished. Indeed, since $nlog(n^2 + 1)$ is $mathcal{O}(n^2log(n))$, from Theorem 2 $nlog(n^2 + 1) + n^2log(n)$ is $mathcal{O}(max{n^2log(n), : n^2log(n)}) = mathcal{O}(n^2log(n))$.



                Note that you could've improved your bound on $nlog(n^2 + 1)$, since actually it is also $mathcal{O}(nlog(n))$. However it doesn't matter in the end since the second summand ($n^2log(n)$) is the dominant one.






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  First of all, why did you specify that $log(n^2 + 1)$ is $mathcal{O}(log(n))$ "if $n ge 2$"? Big O notation describes the asymptotic behaviour of a function, so it is independent on the specific values assumed by the variable(s).



                  That said, not only what you did is correct, but you are practically finished. Indeed, since $nlog(n^2 + 1)$ is $mathcal{O}(n^2log(n))$, from Theorem 2 $nlog(n^2 + 1) + n^2log(n)$ is $mathcal{O}(max{n^2log(n), : n^2log(n)}) = mathcal{O}(n^2log(n))$.



                  Note that you could've improved your bound on $nlog(n^2 + 1)$, since actually it is also $mathcal{O}(nlog(n))$. However it doesn't matter in the end since the second summand ($n^2log(n)$) is the dominant one.






                  share|cite|improve this answer









                  $endgroup$



                  First of all, why did you specify that $log(n^2 + 1)$ is $mathcal{O}(log(n))$ "if $n ge 2$"? Big O notation describes the asymptotic behaviour of a function, so it is independent on the specific values assumed by the variable(s).



                  That said, not only what you did is correct, but you are practically finished. Indeed, since $nlog(n^2 + 1)$ is $mathcal{O}(n^2log(n))$, from Theorem 2 $nlog(n^2 + 1) + n^2log(n)$ is $mathcal{O}(max{n^2log(n), : n^2log(n)}) = mathcal{O}(n^2log(n))$.



                  Note that you could've improved your bound on $nlog(n^2 + 1)$, since actually it is also $mathcal{O}(nlog(n))$. However it doesn't matter in the end since the second summand ($n^2log(n)$) is the dominant one.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Sep 24 '17 at 12:17









                  cip999cip999

                  1,422517




                  1,422517























                      0












                      $begingroup$

                      I would do it much simpler: you can easily check that
                      $$
                      nlog(n^2+1)
                      = o(n^2log n),
                      quadtext{so}
                      quad
                      nlog(n^2+1)+n^2log nsim_infty n^2log n,
                      $$

                      which implies
                      $$
                      n log(n^2+1) + n^2log n
                      =mathcal{O}( n^2log n).
                      $$






                      share|cite|improve this answer











                      $endgroup$


















                        0












                        $begingroup$

                        I would do it much simpler: you can easily check that
                        $$
                        nlog(n^2+1)
                        = o(n^2log n),
                        quadtext{so}
                        quad
                        nlog(n^2+1)+n^2log nsim_infty n^2log n,
                        $$

                        which implies
                        $$
                        n log(n^2+1) + n^2log n
                        =mathcal{O}( n^2log n).
                        $$






                        share|cite|improve this answer











                        $endgroup$
















                          0












                          0








                          0





                          $begingroup$

                          I would do it much simpler: you can easily check that
                          $$
                          nlog(n^2+1)
                          = o(n^2log n),
                          quadtext{so}
                          quad
                          nlog(n^2+1)+n^2log nsim_infty n^2log n,
                          $$

                          which implies
                          $$
                          n log(n^2+1) + n^2log n
                          =mathcal{O}( n^2log n).
                          $$






                          share|cite|improve this answer











                          $endgroup$



                          I would do it much simpler: you can easily check that
                          $$
                          nlog(n^2+1)
                          = o(n^2log n),
                          quadtext{so}
                          quad
                          nlog(n^2+1)+n^2log nsim_infty n^2log n,
                          $$

                          which implies
                          $$
                          n log(n^2+1) + n^2log n
                          =mathcal{O}( n^2log n).
                          $$







                          share|cite|improve this answer














                          share|cite|improve this answer



                          share|cite|improve this answer








                          edited Nov 17 '18 at 9:55









                          Viktor Glombik

                          1,1861528




                          1,1861528










                          answered Sep 24 '17 at 11:59









                          BernardBernard

                          123k741117




                          123k741117






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Mathematics Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2442987%2fgive-a-big-o-estimate-for-a-function-fx-use-a-simple-function-g-of-the-smalle%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Plaza Victoria

                              Brian Clough

                              Cáceres