MathGroup Archive 2009

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

Search the Archive

Calculate n in binomial distribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101212] Calculate n in binomial distribution
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Fri, 26 Jun 2009 06:55:37 -0400 (EDT)

Suppose I have the following distribution:

cf[n_,p_,k_]=CDF[BinomialDistribution[n,p],k]

Now I want to calculate n so that the biggest n such that e.g.

cf[n,0.2,7]<0.3

I made a ListPlot

ListPlot[Abs[cf[#,0.2,7]-0.3]&/@Range[60]], where I see, that a value of
about n=46 gives an approximation nearest to 0.3

To get this value of n I tried

Minimize[{Abs[cf[n,0.2,7]-0.3],n>7},n,Integers]

Out:  {0.699765, {n->11}}

which is obviously wrong.

Why? 

Is it, because Abs isn't differentiable at the peak?

I tried other ways too, like Reduce NMinimize, FindMinimum, but no success.

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Simple question about named variables.
  • Next by Date: Re: Re: how to make .nbp?
  • Previous by thread: Re: Simple question about named variables.
  • Next by thread: Re: Calculate n in binomial distribution