The Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.num-analysis

Topic: hypogeometric sum
Replies: 11   Last Post: Mar 31, 2008 3:25 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dann Corbit

Posts: 1,424
Registered: 12/8/04
Re: hypogeometric sum
Posted: Mar 28, 2008 4:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Mar 28, 4:06 am, gsgs <ster...@aol.com> wrote:
> how do I efficiently calculate or approximate
>
> SUM [i=0..k] hypergeometrical(i;r,n,w)
>
> ?
>
> hypergeometrical(i;r,n,w)=binomia(w,i)*binomial(n-w,r-i)/binomial(n,r)
>
> this is for testing large gene-databases for recombinations


I am assuming that all values are integral and that you have a
mathematics system that can compute the answers without overflow (not
always an easy task if the inputs are large).

Precompute the binomail coefficients and store them in a table.
Then you will have this:
binomial[w][i] * binomial[n-w][r-i]/binomial[n][r]
which is O(1).



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.