CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old September 11th, 2009, 07:25 PM
    coder752 coder752 is offline
    Member
     
    Join Date: Jul 2009
    Location: USA
    Posts: 47
    coder752 is an unknown quantity at this point (<10)
    Resolved Tricky question that deals with big O notation and little o notation

    Hi,

    I have this question that seems trivial to me.

    I need to find a function which is not o(1) but where f(2009) = 0 <---fyi this is a zero
    using the fact that f(x) is a function such that f(x) = O(1) <---fyi this is big O notation


    I was thinking the following:

    f(x) = 2009/x

    and make x equal to 0....but it doesn't satisfy for f(2009) part.

    My intuition is that I need some sort of function that deals with the 2009 since the 2009 plays a part at the second part which somehow has to get 0 as an answer.

    Anyway, thanks so much in advance for help.

    Help is greatly appreciated,

    coder752
    Reply With Quote
      #2    
    Old September 13th, 2009, 03:57 AM
    Zachm's Avatar
    Zachm Zachm is offline
    Member +
     
    Join Date: Oct 2006
    Posts: 519
    Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+)
    Re: Tricky question that deals with big O notation and little o notation

    Quote:
    Originally Posted by coder752 View Post
    I need to find a function which is not o(1) but where f(2009) = 0 <---fyi this is a zero
    using the fact that f(x) is a function such that f(x) = O(1) <---fyi this is big O notation
    Your definition is not clear to me. What is the difference between the function marked in green and the function marked in red ? are they the same function ? different functions ?

    Does the function you need to find must make use of the f(x) function ?

    Regards,
    Zachm
    Reply With Quote
      #3    
    Old September 14th, 2009, 09:24 PM
    coder752 coder752 is offline
    Member
     
    Join Date: Jul 2009
    Location: USA
    Posts: 47
    coder752 is an unknown quantity at this point (<10)
    Re: Tricky question that deals with big O notation and little o notation

    Ok, I'll give you the whole statement.

    This is a two parter question to be treated separate.
    Suppose f(x) is a function such that f(x) = O(1).

    Can e^{f(x)} = o(1)? Yes or no, provide explanation.

    Find one such function f(x) which is not o(1) but where f(2009) =0.

    Hope that cleared it up for your eyes.

    Last edited by coder752; September 14th, 2009 at 09:27 PM. Reason: revision to question
    Reply With Quote
      #4    
    Old September 15th, 2009, 01:10 AM
    Zachm's Avatar
    Zachm Zachm is offline
    Member +
     
    Join Date: Oct 2006
    Posts: 519
    Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+) Zachm  is a jewel in the rough (300+)
    Re: Tricky question that deals with big O notation and little o notation

    Quote:
    Originally Posted by coder752 View Post
    Suppose f(x) is a function such that f(x) = O(1).

    Can e^{f(x)} = o(1)? Yes or no, provide explanation.
    You should check the little-O notation definition in order to answer this.

    If e^(f(x)) = o(1) then it would mean that:
    Code:
       lim {x->∞} ( (e^(f(x)) / 1 ) = lim{x->∞} ( e^(f(x) ) = 0
    This would be true if and only if:
    Code:
      lim {x->∞} ( f(x) ) = -∞
    But f(x) = O(1) and therefore (big-O definition):
    Code:
     there exists some constant C and a positive real number r such that for each x > r, 
    |f(x)| < C
    This would be in contradiction with this demand from f(x):
    Code:
      lim{x->∞}( f(x) ) = -∞
    Thus, such a function doesn't exist.

    Quote:
    Originally Posted by coder752 View Post
    Find one such function f(x) which is not o(1) but where f(2009) =0.
    This is still not clear to me,
    - f(x) is not o(1), is it O(1) ?
    - Does this requirement still hold ?
    Code:
    e^{f(x)} = o(1)
    Regards,
    Zachm
    Reply With Quote
      #5    
    Old September 15th, 2009, 11:55 AM
    coder752 coder752 is offline
    Member
     
    Join Date: Jul 2009
    Location: USA
    Posts: 47
    coder752 is an unknown quantity at this point (<10)
    Resolved Re: Tricky question that deals with big O notation and little o notation

    I suppose it is.

    Does that help any bit?

    Basically I believe its asking for a function that is not little o(1) but when you plug in the number 2009 in the new function it will equal to 0 thus agrees both situations.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:54 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.