Question: Why does sum do something different?

Hi.

I defined the following functions:

 

h1:=t->piecewise(t < 0, 0, binomial(n, t)*p^t*(1-p)^(n-t));
k1:=t->piecewise(type(h1(t), And(realcons,Not(infinity) ) ), h1(t), 0);
u1:=t->-exp(-a*t);

 

Afterwards I assigned values:

n:=1000;
a:=1;
p:=0.25;

 

And now I defined another function:

T:=t->k1(t)*u1(t);

Now

sum(T(i),i=1..2);

equals zero, while

T(1.)+T(2.);

gives out another value.

 

May anyone tell me, why this is the case and how I can use the sum-command to evaluate the right solution?

Thanks.

 


 

 

Please Wait...