Talk:Pascal matrix generation: Difference between revisions
Content added Content deleted
(→task clarification: 3.) |
(→range of numbers: Don't calculate factorials.) |
||
Line 9: | Line 9: | ||
Because the Pascal symmetric matrix uses <big>'''i+j'''</big> 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. I found that with REXX's default digits of '''9''', it lead to generating numbers that weren't integers (close, but no cigar) with a matrix size of '''11'''. It would be interesting to know what the (practical) limitations of each language entry is, if any (as far as generating exact integers). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:07, 16 May 2015 (UTC) |
Because the Pascal symmetric matrix uses <big>'''i+j'''</big> 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. I found that with REXX's default digits of '''9''', it lead to generating numbers that weren't integers (close, but no cigar) with a matrix size of '''11'''. It would be interesting to know what the (practical) limitations of each language entry is, if any (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) |