Re: A Bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg35307] Re: [mg35277] A Bug?
- From: BobHanlon at aol.com
- Date: Mon, 8 Jul 2002 03:15:39 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 7/6/02 7:23:26 AM, johannes.ludsteck at wiwi.uni-regensburg.de writes: >let Mathematica evaluate >In[1]:= oStatCDF[x_,r_,n_,F_]= > Sum[Binomial[n,i] F[x]^i (1-F[x])^(n-i), {i,r,n}] > >Out[1]= (1 - F[x])^(n - r) F[x]^r Gamma[1 + n] > Hypergeometric2F1[1,-n + r, 1 + r, > -F[x]/(1 - F[x])]/ > (Gamma[1 + n - r] Gamma[1 + r]) > >Looks fine, but now define >In[2]:= F[x_]:=1 >and substitute this into oStatCDF >In[3]:= oStatCDF[x,r,n,F] >Out[3]= Indeterminate > >This does not look fine, since I would expect a more >determinate result. Now try to help Mathematica by >substituting F[x_]=1 by hand. Then >F[x]^i (1-F[x])^(n-i) simplifies to 1^i 0^(n-i) == 1 > >In[4]:= simp[r_,n_]=Sum[Binomial[n,i] ,{i,r,n}] >Out[4]= (Gamma[1+n] Hypergeometric2F1[1,-n+r,1+r,-1]) > / (Gamma[1+n-r] Gamma[1+r]) > >Now apply simp to r = 5 and n = 100 to obtain >In[5]:= simp[5,10] >Out[5]= 638 > >Of course, 638 != Indeterminate > >Is this a Bug or did I make a mistake? > 1^i *0^(n-i) does not equal one. It is zero unless i equals n. For example, With[{i=5, n=9},1^i*0^(n-i)] 0 For i equal to n it is indeterminate because Limit[ Limit[x^(n-i), x->0], i->n, Direction->1] 0 Limit[ Limit[x^(n-i), i->n], x->0] 1 If by convention you want to use the latter result, 1^i *0^(n-i) would then be equal to KroneckerDelta[n, i] or DiscreteDelta[n-i]. All the terms of the sum are then zero except for the term when i equals n Binomial[n, i]*KroneckerDelta[n,i] /. i->n 1 Binomial[n, i]*DiscreteDelta[n-i] /. i->n 1 The sum would then be one. FullSimplify[ Sum[Binomial[n,i]*DiscreteDelta[n-i],{i,r,n}], 0<=r<=n] 1 Bob Hanlon Chantilly, VA USA