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


Newest CodeGuru.com Articles:

  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2
  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 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 November 4th, 2009, 11:11 AM
    arcticm arcticm is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 1
    arcticm is an unknown quantity at this point (<10)
    Bound for a function

    Hey everybody!
    Really need some help cause I'm lost!
    I need to find an asymptotically tight bound (theta) for this sum
    http://img231.imageshack.us/img231/1606/32830911.jpg
    , and I know u can't bound a sum, so I can't figure out a way to do it!! I'd REALLY appreciate if someone could explain to me (in the most simple way possible) what I need to do in a situation where I have a sum to bound)
    THANK YOU!!!!
    Reply With Quote
      #2    
    Old November 4th, 2009, 01:29 PM
    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: Bound for a function

    A sum is just a different name for a function where the variable is the upper bound of the sum (the number above the sigma).
    You can show that a function with a sum in it is asymptotically bounded by another function in exactly the same fashion you would for any regular function.

    Showing that a specific Theta bound applies is equivalent to showing that both Big-Oh and Omega bounds apply (with a given bounding function).

    You should probably start with some intuition - try to evaluate what the bound will be and then prove it is so. My hunch is that it's at least O(N^3) since you sum N times something that is at most N^2. Now we can try to show that N^3 also applies for the lower bound(Omega).

    In your sum function, the input variable is N (the big N above the sigma).

    Let's start with Big-Oh:
    Code:
    Sum{1..N} [ n*(n-1) / 2 ]  <= Sum{1..N} [ n*(n-1) ] <= Sum{1..N} [n^2] <= N * N^2 = N^3 
    Therefore:
    Sum{1..N} [ n*(n-1) / 2 ] = O(N^3)
    As for Omega, you can think for yourself, I can give you a small hint:
    what would happen if the sum lower bound(the number below the sigma) was something like N/2 and not 1 ?, that is you have a function that looks like this:
    Code:
    Sum{N/2 .. N} [ n*(n-1) / 2 ]
    Obviously the original sum function is lower bounded by the new function I just described. Try to show that it is Omega(N^3).

    Regards,
    Zachm
    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 12:38 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.