[Date Index]
[Thread Index]
[Author Index]
Re: error with Sum and Infinity
*To*: mathgroup at smc.vnet.net
*Subject*: [mg102250] Re: [mg102245] error with Sum and Infinity
*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>
*Date*: Mon, 3 Aug 2009 05:44:19 -0400 (EDT)
*References*: <200908021001.GAA01730@smc.vnet.net>
On 2 Aug 2009, at 19:01, Llewlyn wrote:
> Hi experts,
>
> i'm very new to Mathematica and this is my first problem. I define a
> function that is 0 everywhere:
> t[i_] := 0
> expect for point i =3 that is:
> t[3] = 1
> If now i evaluate the finite sum i obtain 1 as expected
> Sum[ t[i], {i, 1, 10}]
> Out = 1
> but if i try do the same with infinity i obtain
> In[808]:= Sum[ t[i], {i, 1, Infinity}]
> Out[808]= 0
> instead of 1 expected. Any advice?
>
> tb
>
What do you mean by "advice"? This is exactly the expected behaviour.
When you evaluate Sum[ t[i], {i, 1, 10}] Mathematica simply adds up
the 10 numbers, one of them being 3 and the other all 0, you get zero.
When you evaluate Sum[ t[i], {i, 1, Infinity}] Mathematica does not
try to add up infinitely many numbers because it can't be done 0. It
never, ever sees the value t[3].
All this shows is that computer programs are not human, which is
hardly surprising.
However, this works as you intended:
Sum[KroneckerDelta[i, 3], {i, 1, Infinity}]
1
Andrzej Kozlowski
Prev by Date:
**Re: The audience for Mathematica (Was: Show doesn't**
Next by Date:
**Re: error with Sum and Infinity**
Previous by thread:
**Re: error with Sum and Infinity**
Next by thread:
**Re: error with Sum and Infinity**
| |