Post Reply 
(19C/29C) (k-)Permutations, Combinations, Linear Regression and Pseudo-random number
01-15-2020, 08:16 PM
Post: #4
RE: (19C/29C) (k-)Permutations, Combinations, Linear Regression and Pseudo-random number
In the factorial function, you could remove steps 7 and 8 (GSB 2, RTN) and just let control fall through to LBL 2.

Also, the combinations function looks like it will overflow for large N and small K. You can avoid this by alternately multiplying and dividing. For example, compute 10C3 by doing 8 * 9 / 2 * 10 / 3. This has the remarkable property that the divisions always result in an integer value!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (19C/29C) (k-)Permutations, Combinations, Linear Regression and Pseudo-random number - David Hayden - 01-15-2020 08:16 PM



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