Post Reply 
Dividing factorials on 15C CE
01-10-2024, 03:12 PM
Post: #15
RE: Dividing factorials on 15C CE
(01-09-2024 01:23 AM)Thomas Klemm Wrote:  This avoids rounding errors:

P(50, 45) = 1 * 50 * 49 * 48 * 47 * 46
C(50, 45) = 1 * 50/1 * 49/2 * 48/3 * 47/4 * 46/5
Th really cool think about computing combinations this way is that the divisions always result in an integer.

Computing combinations was discussed in great detail in PPC journal. I don't have a reference handy, but I recall one final trick to prevent overflow in the multiplication: you start with 1E-99 (or whatever the smallest exponent is) as your result, run the algorithm, and then multiply the result by 1E99.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Dividing factorials on 15C CE - philiph - 01-06-2024, 10:38 AM
RE: Dividing factorials on 15C CE - Werner - 01-06-2024, 02:13 PM
RE: Dividing factorials on 15C CE - Werner - 01-07-2024, 09:03 AM
RE: Dividing factorials on 15C CE - Johnh - 01-06-2024, 07:23 PM
RE: Dividing factorials on 15C CE - Johnh - 01-10-2024, 09:22 AM
RE: Dividing factorials on 15C CE - jthole - 01-07-2024, 09:29 AM
RE: Dividing factorials on 15C CE - David Hayden - 01-10-2024 03:12 PM



User(s) browsing this thread: 5 Guest(s)