       RE: A Bug?

• To: mathgroup at smc.vnet.net
• Subject: [mg35322] RE: [mg35277] A Bug?
• From: "DrBob" <majort at cox-internet.com>
• Date: Mon, 8 Jul 2002 03:17:26 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```There's a bug, but not the one you think.

and i==n, we have the term

Binomial[n, n] 1^n (1 - 1)^(n - n)

This involves 0^0, which is Indeterminate.  Contrast this with what
happens when you use SetDelayed rather than Set:

Clear[F, oStatCDF]
oStatCDF[x_, r_, n_, F_] :=
Sum[Binomial[n, i] F[x]^i (1 - F[x])^(n - i), {i, r, n}]
F[x_] := 1
oStatCDF[x, r, n, F]

0

THAT is a bug.

Bobby

-----Original Message-----
From: Johannes Ludsteck
To: mathgroup at smc.vnet.net
[mailto:johannes.ludsteck at wiwi.uni-regensburg.de]
Subject: [mg35322] [mg35277] A Bug?

Dear MathGroup members,

let Mathematica evaluate
In:= oStatCDF[x_,r_,n_,F_]=
Sum[Binomial[n,i] F[x]^i (1-F[x])^(n-i), {i,r,n}]

Out= (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:= F[x_]:=1
and substitute this into oStatCDF
In:= oStatCDF[x,r,n,F]
Out= 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:= simp[r_,n_]=Sum[Binomial[n,i] ,{i,r,n}]
Out= (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:= simp[5,10]
Out= 638

Of course, 638 != Indeterminate

Is this a Bug or did I make a mistake?

Best regards,
Johannes Ludsteck

<><><><><><><><><><><><>
Johannes Ludsteck
Economics Department
University of Regensburg
Universitaetsstrasse 31
93053 Regensburg
Phone +49/0941/943-2741

```

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