MathGroup Archive 2002

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

Search the Archive

Re: binomial distribution

  • To: mathgroup at
  • Subject: [mg33670] Re: [mg33658] binomial distribution
  • From: "Johannes Ludsteck" <johannes.ludsteck at>
  • Date: Sat, 6 Apr 2002 00:48:44 -0500 (EST)
  • Organization: Universitaet Regensburg
  • Sender: owner-wri-mathgroup at

Dear Nadia,
you seem to be one of the millions of users trying
to obtain good answers to *bad* questions!
How should someone answer your question if he does
not know
1) How large were N and X[[N]] when the error
	message was given, was it 500 or 10^20?
2) how is p defined?
3) Which program do you use to generate the lists,
	Nest, FoldList, Do, For?

By the way: X[[n]] may increase rapidly
(of course, depending on the definition of p).
Thus, if for example X[[n]] == 1000, it becomes
computationally very demanding to draw 'good' random
numbers from a binomial distribution.
(If you are interested in the details,
have a look at the Package where
the random draws are programmed.
A simple algorithm is to make thousand (!)
draws from a Bernoulli Distribution with
parameter p.) 
However, it is **highly!** inefficient to
draw from a binomial distribution if X[[n]] > 100,
since (you should have learned this in
an introductory statistics course)
the binomial distribution converges rapidly
to a normal distribution
and it is computationally very 'cheap'
to draw from a normal distribution. Thus
you simply have to transform the binomial distribution
to a normal if X > 100 or so.

When I replicate your what you *probably* did, I obtain




Though my values in p are between 0.1 and 0.5 and
X[[1]] = 1, X[[40]] is larger than 2000.
Therefore I advise you to use the normal distribution

Best regards,

On 4 Apr 2002, at 19:40, Nadia Lalam wrote:


I have to define a sequence recursively with the binomial distribution
in the following way :

X[[n+1]]=X[[n]]+Random[BinomialDistribution[X[[n]],p[[n]]], n ranging
from 1 to some N 

The first terms of the sequence are well constructed with Mathematica
but as X[[n]] grows, I had the message 

Internal counter overflow.
Some expression evaluations may not run to their
final fixed points.  Try redoing your computation
on a 64-bit enhanced version of Mathematica.

Could you tell me how to solve this problem?

Thanks in advance,


  • Prev by Date: Re: Beginner question on local vars./scoping
  • Next by Date: RE: WorldGraphics Question
  • Previous by thread: binomial distribution
  • Next by thread: HTMLSave