Re: Manipulating a Binomial CDF
- To: mathgroup at smc.vnet.net
- Subject: [mg94054] Re: [mg94035] Manipulating a Binomial CDF
- From: Jamie Coventry <jcoventry at renaissance.edu.hk>
- Date: Wed, 3 Dec 2008 05:44:28 -0500 (EST)
- References: <20081202064214.GVI2O.357986.imail@eastrmwml42>
Aaargh, thanks Bob. I'm feeling particularly stupid for missing the
obvious.
Jamie
On Dec 2, 2008, at 7:42 PM, Bob Hanlon wrote:
> The PlotRange is changing (particularly for the CDF) and the x-axes
> crossing is not at 0. Use the PlotRange option to control this
> (e.g., PlotRange -> {0, 1} )
>
>
> Bob Hanlon
>
> ---- Jamie Coventry <jcoventry at renaissance.edu.hk> wrote:
>
> =============
> Hi,
>
> I have a query with a plot I'm doing with the code below. When I take
> the "probability of success" slider down to values less than 0.2, the
> graph of the BinomialCDF displays strange behaviour at n=0. The value
> of P(N=E2=89=A40) is calculated correctly, but the point is
> displayed below
> the horizontal axes.
>
> Can anyone explain this?
>
> Here's the code:
>
> Manipulate[
> Grid[{{
> ListPlot[
> Table[Tooltip[{i, PDF[BinomialDistribution[n, p], i]}], {i, 0,
> n}],
> Filling -> Axis, FillingStyle -> Directive[Blue, Thick],
> PlotLabel -> Style["Probability density", 14, Bold],
> ImageSize -> {280, 280}, AxesLabel -> {"n", "p"},
> PlotStyle -> {Thick, PointSize[Large]}],
> ListPlot[
> Table[Tooltip[{i, CDF[BinomialDistribution[n, p], i]}], {i, 0,
> n}],
> Filling -> Axis, FillingStyle -> Directive[Blue, Thick],
> PlotLabel -> Style["Probability density", 14, Bold],
> ImageSize -> {280, 280}, AxesLabel -> {"n", "p"},
> PlotStyle -> {Thick, PointSize[Large]}],
> }}]
> , {{n, 10, "Number of terms"}},
> {{p, 0.5, "Probability of success"}, 0, 1, 0.01}]
>
> Thanks in advance,
>
> Jamie
>
>
> --
>
> Bob Hanlon
>
>