Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A Bug?

  • To: mathgroup at
  • Subject: [mg35307] Re: [mg35277] A Bug?
  • From: BobHanlon at
  • Date: Mon, 8 Jul 2002 03:15:39 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 7/6/02 7:23:26 AM, 
johannes.ludsteck at 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)]


For i equal to n it is indeterminate because

Limit[x^(n-i), x->0],
  i->n, Direction->1]


Limit[x^(n-i), i->n], x->0]


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


Binomial[n, i]*DiscreteDelta[n-i] /. i->n


The sum would then be one.



Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: AppendTo VERY slow
  • Next by Date: RE: A Bug?
  • Previous by thread: A Bug?
  • Next by thread: RE: A Bug?