V137: Binomial Random Numbers

Author(s): D. Drijard, K.S. Kölbig Library: MATHLIB
Submitter: Submitted: 15.10.1994
Language: Fortran Revised:

Subroutine subprogram RNBNML generates a random integer N>0 according to the binomial distribution

displaymath70

where the 'sample size' M>0 and the probability P ( tex2html_wrap_inline76 ) are specified by the user.

Structure:

SUBROUTINE subprogram
User Entry Names: RNBNML
External References: RANLUX

Usage:

    CALL RNBNML(M,P,N,IERR)
M
(INTEGER) Sample size M.
P
(REAL) Probability P.
N
(INTEGER) The generated random number N, binomially distributed in the interval tex2html_wrap_inline84 with mean tex2html_wrap_inline86 .
IERR
(INTEGER) Error flag.
tex2html_wrap_inline88 Normal case,
tex2html_wrap_inline90 tex2html_wrap_inline92 or tex2html_wrap_inline94 .

Notes:

RNBNML should not be used when M is 'large' (say >100 ). The normal approximation is then recommended instead (with mean tex2html_wrap_inline98 and standard deviation tex2html_wrap_inline100 ).
tex2html_wrap_inline102


Michel Goossens Wed Jun 5 08:50:09 METDST 1996