Subject: Calc Binomial Dist. Function.

From: Iraj Daizadeh <[email-masked]>
Date: Sun, 28 Nov 1999 13:49:43 -0500 (EST)

Hello.

The binomial prob. density function is ubiquitous in stat mech:

P(x) = (N,n) * p^n * (1-p)^(N-n)

The question is how does one-- practically -- compute
the above formula for very large N and n. 

I have been playing around with the numerical recipes BICO function for N
around 206 and n around 106---it returns

inf or nan()--- thus P(x) is inf or nan...

We understand that bico uses something akin to stirling's approx... using
the relation: n! = Gamma(n+1) where Gamma is the gamma function...

Is there a trick to calculation this density function...Maybe calculating
first the product of the p's then dividing then multiplying by e(ln(N))...

Thanks. Iraj.

Iraj Daizadeh, Ph.D.
Harvard University
Department of Cellular and Molecular Biology
The Biological Laboratories
16 Divinity Avenue
Cambridge, MA 02138
Phone:   (617) 495-0783
         (617) 495-0560
Fax:     (617) 496-4313
Email:   [email-masked]
WebPage: http://mcb.harvard.edu/gilbert/daizadeh