Post Reply 
XCas sum limit confusion
08-26-2020, 09:58 PM (This post was last modified: 11-23-2020 07:24 PM by Albert Chan.)
Post: #2
RE: XCas sum limit confusion
This may explain the reason for (a,b) → (b+1,a-1), if a>b+1
Say, we have a function F(x) = sum(f(t), t=-inf .. x-1)

If a ≤ b, S1 = sum(f(t), t=a .. b) = F(b+1) - F(a)

If a > b, we could flip the limit, just like doing integrals.

S2 = - sum(f(t), t=b .. a) = -(F(a+1) - F(b)) = F(b) - F(a+1)

But, S1 != -S2. To aim for symmetry, we shift the limit a bit:

S2 = - sum(f(t), t=b+1 .. a-1) = F(a) - F(b+1) = -S1

Sympy Gamma:  Sum(k, (k, 5, 1)) = -(2 + 3 + 4) = -9
But, the cure maybe worse than the disease.

Mathematica also does closed end limit, but generated a list. (conceptually)
If the list is empty, there is nothing to sum.
We lost the symmetry, but it is simple to understand.

Mathematica:     Sum(k, (k, 5, 1)) = 0

Open-ended sum is very elegant:

S1 = sum(f(t), t = a .. b-1) = F(b) - F(a)
S2 = sum(f(t), t = b .. a-1) = F(a) - F(b)

We got nice symmetry, without worrying a, b sort order.

Also of interest: Should array indices start at 0 or 1 ?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
XCas sum limit confusion - Albert Chan - 08-26-2020, 07:48 PM
RE: XCas sum limit confusion - Albert Chan - 08-26-2020 09:58 PM
RE: XCas sum limit confusion - Albert Chan - 09-02-2023, 12:54 PM



User(s) browsing this thread: 1 Guest(s)