From chemistry-request@server.ccl.net  Sun Nov 28 14:53:31 1999
Received: from nucleus.harvard.edu (nucleus.harvard.edu [140.247.90.196])
	by server.ccl.net (8.8.7/8.8.7) with ESMTP id OAA26951
	for <chemistry@ccl.net>; Sun, 28 Nov 1999 14:53:31 -0500
Received: from localhost (daizadeh@localhost)
	by nucleus.harvard.edu (8.9.3/8.9.3) with ESMTP id NAA25947
	for <chemistry@ccl.net>; Sun, 28 Nov 1999 13:49:43 -0500 (EST)
Date: Sun, 28 Nov 1999 13:49:43 -0500 (EST)
From: Iraj Daizadeh <daizadeh@nucleus.harvard.edu>
To: chemistry@ccl.net
Subject: Calc Binomial Dist. Function.
Message-ID: <Pine.SUN.4.10.9911281341480.25945-100000@nucleus.harvard.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


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:   daizadeh@nucleus.harvard.edu
WebPage: http://mcb.harvard.edu/gilbert/daizadeh


From chemistry-request@server.ccl.net  Sun Nov 28 16:03:07 1999
Received: from mail.rwth-aachen.de (mail.RWTH-Aachen.DE [137.226.144.9])
	by server.ccl.net (8.8.7/8.8.7) with ESMTP id QAA27311
	for <CHEMISTRY@ccl.net>; Sun, 28 Nov 1999 16:03:06 -0500
Received: from ac.rwth-aachen.de (zosia.dorf.RWTH-Aachen.DE)
 by mail.rwth-aachen.de (PMDF V5.1-12 #D3869)
 with ESMTP id <01JIVUXRGYS00007H6@mail.rwth-aachen.de> for CHEMISTRY@ccl.net;
 Sun, 28 Nov 1999 20:58:36 +0100
Date: Sun, 28 Nov 1999 21:56:46 +0100
From: Krzysztof Radacki <krys.radacki@ac.rwth-aachen.de>
Subject: g98 opt=(qst3, path=...  question.
Sender: krzys@mail.rwth-aachen.de
To: CCL <CHEMISTRY@ccl.net>
Message-id: <3841970E.2C1C9AB9@ac.rwth-aachen.de>
Organization: RWTH Aachen
MIME-version: 1.0
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en

Hi,
can somebody explain what are Initial Parameters from job with 
opt=(qst3, path=10).
I have 11 atoms (10 +one dummy). In above mentioned table I can see
10 Rs (OK), 15 angles and 16 dihedral angels. Are these extra-angles 
just for information and I need to select a set defining my molecules, 
or there is something other wrong?

regards
From chemistry-request@server.ccl.net  Sun Nov 28 16:14:04 1999
Received: from mtiwmhc02.worldnet.att.net (mtiwmhc02.worldnet.att.net [204.127.131.37])
	by server.ccl.net (8.8.7/8.8.7) with ESMTP id QAA27380
	for <chemistry@ccl.net>; Sun, 28 Nov 1999 16:14:04 -0500
Received: from [12.77.88.179] by mtiwmhc02.worldnet.att.net
          (InterMail v03.02.07.07 118-134) with SMTP
          id <19991128200745.BYBF1865@[12.77.88.179]>;
          Sun, 28 Nov 1999 20:07:45 +0000
X-Sender: eaabbott@postoffice.worldnet.att.net
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0
Date: Sun, 28 Nov 1999 15:06:18 -0500
To: Iraj Daizadeh <daizadeh@nucleus.harvard.edu>
From: "Elizabeth A. Abbott" <eaabbott@worldnet.att.net>
Subject: Re: CCL:Calc Binomial Dist. Function.
Cc: chemistry@ccl.net
In-Reply-To: <Pine.SUN.4.10.9911281341480.25945-100000@nucleus.harvard.e
 du>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Message-Id: <19991128200745.BYBF1865@[12.77.88.179]>

Hi Iraj,

You might want to check out _Introduction to Algorithms_ by Cormen,
Leiserson, and Rivest (Chapter 6: counting and probability) and/or Knuth's
_Art of Computer Programming_ Vol 2: Seminumerical Algorithms.

CL&R give upper and lower bounds for (N,k).

Lower bound:
(n,k) = n(n-1)...(n-k+1)
           --------------------
           k(k-1)...1

        = (n/k) ( (n-1)/(k-1) ) ... ( (n-k+1)/1 )

        >= (n/k) ^k

Upper bound:
(n,k) = n(n-1)...(n-k+1)
           ----------------------
           k(k-1)...1

        <= n^k / k!

         <= (en / k ) ^k 

since we know k! >= (k/e)^k from Stirling's apx.


CL&R also give an upper bound for the binomial prob. dist.

b(k;n,p) <= (np/k) ^k  *  (nq/(n-k) ^ (n-k)

(q is just 1 -p)

Sorry to switch notation from N,n to n,k on you, but I have a hard enough
time getting it onto the screen without translating, too.  :)  Hope this is
of some help.  Check out Knuth.

-Liz
(can you tell I wandered into comp chem from cs and applied math?? :-)

At 28-11-99 13:49 -0500, you wrote:
>
>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:   daizadeh@nucleus.harvard.edu
>WebPage: http://mcb.harvard.edu/gilbert/daizadeh
>
>
>
>-= This is automatically added to each message by mailing script =-
>CHEMISTRY@ccl.net -- To Everybody    |   CHEMISTRY-REQUEST@ccl.net -- To
Admins
>MAILSERV@ccl.net -- HELP CHEMISTRY or HELP SEARCH
>CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher: gopher.ccl.net 70
>Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan: jkl@ccl.net
> 
