Talk:Pascal matrix generation: Difference between revisions

→‎range of numbers: Don't calculate factorials.
(→‎range of numbers: Don't calculate factorials.)
Line 9:
 
Because the Pascal symmetric matrix uses &nbsp; &nbsp; <big>'''i+j'''</big> &nbsp; &nbsp; in the computation of the binomial coefficients (combinations), the calculation of the factorials can exceed the (default) maximum amount for some computer programming languages (number types) unless specified otherwise. &nbsp; I found that with REXX's default digits of &nbsp; '''9''', &nbsp; it lead to generating numbers that weren't integers &nbsp; (close, but no cigar) &nbsp; with a matrix size of &nbsp; '''11'''. &nbsp; It would be interesting to know what the (practical) limitations of each language entry is, if any &nbsp; (as far as generating exact integers). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:07, 16 May 2015 (UTC)
 
:If you use the following instead of the factorial version then you can reduce the onset of overflow problems: <math>\frac{n(n-1)(n-2)\ldots(n-k+1)}{k(k-1)(k-2)\ldots 1}</math>
:By calculating the numerator and denominator and comparing them separately to 2<sup>x</sup> you could explore when overflow might affect the calculation. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:50, 17 May 2015 (UTC)
Anonymous user