Results 1 to 5 of 5

Math Help - Summation Question

  1. #1
    Newbie
    Joined
    May 2010
    Posts
    8

    Summation Question

    I'm not sure which board this post should be in. If a mod could move it to the appropriate board if this isn't the correct one, that'd be great.

    So let A be an array of n integers A[0],...,A[n-1]. where n is a positive number.
    If i = 0, is S = \sum^{i-1}_{j=0}A[j] = 0?

    If not, how would you write in summation notation, S is the sum of all the values stored in the array A up to the i'th element, where i < n?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by TheMute View Post
    So let A be an array of n integers A[0],...,A[n-1]. where n is a positive number.
    If i = 0, is S = \sum^{i-1}_{j=0}A[j] = 0?
    Did you make a typo? If i = 0, then i - 1 = -1 and you have

    \sum_{j=0}^{i-1}A[j] = \sum_{j=0}^{-1}A[j]

    I'm not sure if there is a generally accepted convention when the upper index is less than the lower index. For example, we might interpret this as the empty sum (0), or we might consider this equivalent to

    \sum_{j=-1}^0A[j]

    which would then be undefined since A[-1] is undefined.

    Quote Originally Posted by TheMute View Post
    If not, how would you write in summation notation, S is the sum of all the values stored in the array A up to the i'th element, where i < n?
    You can write S_i = \sum_{j=0}^iA[j],\ 0\leq i<n. Here we mean up to and including the i'th element.

    In practice, if you're writing a program, you'll generally be using either set notation or a loop with a boolean condition, and it will be clear how to make certain inputs return the empty sum (0), if desired.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2010
    Posts
    8
    Quote Originally Posted by undefined View Post
    Did you make a typo? If i = 0, then i - 1 = -1 and you have

    \sum_{j=0}^{i-1}A[j] = \sum_{j=0}^{-1}A[j]

    I'm not sure if there is a generally accepted convention when the upper index is less than the lower index. For example, we might interpret this as the empty sum (0), or we might consider this equivalent to

    \sum_{j=-1}^0A[j]

    which would then be undefined since A[-1] is undefined.
    Not a typo. :P

    You can write S_i = \sum_{j=0}^iA[j],\ 0\leq i<n. Here we mean up to and including the i'th element.


    In practice, if you're writing a program, you'll generally be using either set notation or a loop with a boolean condition, and it will be clear how to make certain inputs return the empty sum (0), if desired.
    The problem is when I have i = 0, I want the summation to equal 0.

    This is a me trying to simplify a question I have on a loop invariant problem I have... maybe I should just post that whole problem in the Discrete Mathematics board...
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by TheMute View Post
    Not a typo. :P
    Gotcha

    Quote Originally Posted by TheMute View Post
    The problem is when I have i = 0, I want the summation to equal 0.

    This is a me trying to simplify a question I have on a loop invariant problem I have... maybe I should just post that whole problem in the Discrete Mathematics board...
    In this case I would say your initial formulation is correct, you should just define your terms so that everyone knows exactly what you mean. I haven't seen that notation used in proofs, but my experience is limited and it seems like a reasonable enough use of notation.

    So you'll end up having S_0 = 0, S_1 = A[0], S_2 = A[0]+A[1], etc., which it seems you're going for.

    Whether or not a sum from 0 to -1 is conventionally considered the empty sum, I think you can rest easy because mathematicians make up and adapt notation for their purposes all the time.

    Edit: Here's a decent list of some ambiguously defined mathematical terms I got from a Google search, just to illustrate. Like I said, I'm not sure about a universally accepted notation in your case, but at least, it's uncommon enough that Wikipedia seemed not to mention it, etc.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    May 2010
    Posts
    8
    Quote Originally Posted by undefined View Post
    In this case I would say your initial formulation is correct, you should just define your terms so that everyone knows exactly what you mean. I haven't seen that notation used in proofs, but my experience is limited and it seems like a reasonable enough use of notation.

    So you'll end up having S_0 = 0, S_1 = A[0], S_2 = A[0]+A[1], etc., which it seems you're going for.

    Whether or not a sum from 0 to -1 is conventionally considered the empty sum, I think you can rest easy because mathematicians make up and adapt notation for their purposes all the time.
    That's exactly what I'm going for! Ok, thanks.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Summation question
    Posted in the Algebra Forum
    Replies: 5
    Last Post: February 2nd 2011, 07:26 AM
  2. summation question
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: October 2nd 2010, 07:53 AM
  3. summation question
    Posted in the Differential Geometry Forum
    Replies: 4
    Last Post: June 21st 2010, 05:57 PM
  4. Question about summation
    Posted in the Calculus Forum
    Replies: 3
    Last Post: October 22nd 2009, 10:33 AM
  5. summation question
    Posted in the Algebra Forum
    Replies: 4
    Last Post: May 25th 2007, 11:38 AM

Search Tags


/mathhelpforum @mathhelpforum