MathGroup Archive 2008

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

Search the Archive

Re: Manipulating a Binomial CDF

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94048] Re: [mg94035] Manipulating a Binomial CDF
  • From: Syd Geraghty <sydgeraghty at me.com>
  • Date: Wed, 3 Dec 2008 05:43:23 -0500 (EST)
  • References: <gh0jl6$5mk$1@smc.vnet.net> <200812020543.AAA19191@smc.vnet.net>

Hi Jamie,

The p-axis was being dynamically changed which resulted in the effect  
you saw.

With options PlotRange & AxesOrigin appropriately defined you can get  
what you want.


Manipulate[
  Grid[{{ListPlot[
      Table[Tooltip[{i, PDF[BinomialDistribution[n, p], i]}], {i, 0,  
n}],
      AxesOrigin -> {0, 0}, PlotRange -> {{0, n}, {0, 1}}, Filling ->  
Axis,
      FillingStyle -> Directive[Blue, Thick],
      PlotLabel -> Style["PDF 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}],
      AxesOrigin -> {0, 0}, PlotRange -> All, Filling -> Axis,
      FillingStyle -> Directive[Blue, Thick],
      PlotLabel -> Style["CDF 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}]


Hope that helps.

Cheers ... Syd

(PS   Nice looking presentation Jamie)


Syd Geraghty B.Sc, M.Sc.

sydgeraghty at mac.com

Mathematica 7.0.0 for Mac OS X x86 (64 - bit) (21st November, 2008)
MacOS X V 10.5.4
MacBook Pro 2.33 Ghz Intel Core 2 Duo  2GB RAM









On Dec 2, 2008, at 2:20 AM, Jamie Coventry 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
>



  • Prev by Date: RE: Manipulating a Binomial CDF
  • Next by Date: Re: Re: Re: v.7.0 issues
  • Previous by thread: RE: Manipulating a Binomial CDF
  • Next by thread: Vertex Colors