J
Jerry W. Lewis
This is intended as an addendum to
http://groups.google.com/group/microsoft.public.excel/browse_thread/thread/36affa04b5577be3
which I cannot reply to directly because the MS community interface appears
to no longer support replying to the microsoft.public.excel group, my ISP no
longer supports NNTP newsgroups at all, and Google does not support posts
without displaying my real e-mail address.
An obvious calculation for Combin(n,r) is
EXP( GAMMALN(n+1)-GAMMALN(r+1)-GAMMALN(n-r+1) )
For large n, accuracy can be reduced due to cancellation problems. Ian
Smith discussed how to avoid these cancellation problems through a simple
auxilary function; unfortunately, AOL stopped hosting his web page.
In Excel, accuracy is also lost because the Excel implementation of GAMMALN
only gives about 10-figure accuracy, which is curious, because COMBIN's
results seem consistent with an underlying machine precision implementation
of GAMMALN.
Since Excel does not support the (mathematically and statistically useful)
analyitic continuation of COMBIN to non-integers, it is sloppy that they did
not round the result to an integer when that result is <= 2^53-1 =
9007199254740991; but it is an easy matter for the user to rectify this in
practice.
Jerry
http://groups.google.com/group/microsoft.public.excel/browse_thread/thread/36affa04b5577be3
which I cannot reply to directly because the MS community interface appears
to no longer support replying to the microsoft.public.excel group, my ISP no
longer supports NNTP newsgroups at all, and Google does not support posts
without displaying my real e-mail address.
An obvious calculation for Combin(n,r) is
EXP( GAMMALN(n+1)-GAMMALN(r+1)-GAMMALN(n-r+1) )
For large n, accuracy can be reduced due to cancellation problems. Ian
Smith discussed how to avoid these cancellation problems through a simple
auxilary function; unfortunately, AOL stopped hosting his web page.
In Excel, accuracy is also lost because the Excel implementation of GAMMALN
only gives about 10-figure accuracy, which is curious, because COMBIN's
results seem consistent with an underlying machine precision implementation
of GAMMALN.
Since Excel does not support the (mathematically and statistically useful)
analyitic continuation of COMBIN to non-integers, it is sloppy that they did
not round the result to an integer when that result is <= 2^53-1 =
9007199254740991; but it is an easy matter for the user to rectify this in
practice.
Jerry