       Re: BinomialDistribution

• To: mathgroup at smc.vnet.net
• Subject: [mg65226] Re: BinomialDistribution
• From: Bill Rowe <readnewsciv at earthlink.net>
• Date: Sun, 19 Mar 2006 03:19:03 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```On 3/18/06 at 6:40 AM, J.A.Solomon at city.ac.uk (Solomon, Joshua)
wrote:

>This makes me feel foolish.
>In:=Needs["Statistics`DiscreteDistributions`"]
>In:=Plot[PDF[BinomialDistribution[101,u],26],{u,0,0.5},PlotRange
>->All]

>This gives me a nice, bell-shaped curve, with a minimum of about 0
>and a maximum of about .09. Let's integrate it from 0 to .29.

>In:=Integrate[PDF[BinomialDistribution[101,u],26],{u,0,.29}]
>Out=-0.612253

>How can this be negative?

The problem is the default precision when Integrate substitutes values for u into the symbolic solution. The simplest solution is to use NIntegrate instead of Integrate, i.e.,

In:=
NIntegrate[PDF[BinomialDistribution[101,u],26],{u,0,.29}]

Out=
0.00731803

Equivalently, you could change the limits for integration to an exact number and convert the answer to a machine precision number using N, i.e,

In:=
Integrate[PDF[BinomialDistribution[101,u],26],{u,0,29/100}]//N

Out=
0.00731803
--
To reply via email subtract one hundred and four

```

• Prev by Date: Re: BinomialDistribution
• Next by Date: Re: Combined Graphics3D with Separate PlotRange?
• Previous by thread: Re: BinomialDistribution
• Next by thread: Re: BinomialDistribution