Home TechnologyProgramming Subscribe to RSS

How Do I Show That If F(n)=O(n2),g(n)=O(n3) That F(n)+g(n)=O(n3)?

Answer Question

1 Answer - Sort by: Date | Rating

    Are you sure that's not

    f(n) + g(n) = O(n5)?

    As that's what I would have thought, and some people's written 3s can look like 5s, so maybe the worksheet problem you've been set is wrong.

    The example looks like a chemistry problem.  So I am assuming the example O(n2) really means O * n(subscript 2).  That means "2 of substance n", so adding 2 of them to 3 of them would still suggest n (subscript 5) -- five of item n.

    Show what I'm saying with

    f(n) = O(n2)= O * (n + n).
    g(n) = O(n3) = O * ( n + n + n).

    f(n) + g(n) = O * n2 + O * n3 = O (n2 + n3) = O (n + n + n + n + n ) = O(n5).

    Of course, the 2 and 3 in f(n) and g(n) could be superscripts -- ^ -- "raised to the power of".  Basic algebra stuff.
      But that would make the supposed answer even more impossible to work out.
    0 0

    Scavenger 

    answered 3 years ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International