⚠️ Warning: This is a draft ⚠️

This means it might contain formatting issues, incorrect code, conceptual problems, or other severe issues.

If you want to help to improve and eventually enable this page, please fork RosettaGit's repository and open a merge request on GitHub.

When this Rosetta Code task asked ''··· to write functions ···'' it seemed to imply to write a function for each form of the Pascal matrices. Is the coding of a singular function to generate all three forms of Pascal matrices acceptable? -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:07, 16 May 2015 (UTC)

:Individual functions was my intention. Is there really that much to gain by having one function parametrised with the output required? :I guess if there is documented language style for having one parameterised function in a similar area then it might be good to reference the standard library function(s) that you copying the style of then have the one function, but three functions is what the task expects. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:37, 17 May 2015 (UTC)

:: Should I remove the 2nd REXX entry then? ... and will you be marking other entries as "needing improvement" or somesuch? The 2nd Rexx entry uses a singular function to generate all three forms of Pascal matrices. However, in its defense, it does read better. But, a lot of whitespace added to the 1st REXX version would add a significant vertical whitespace. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:14, 17 May 2015 (UTC)

::: Well, I started that (after my sloppy reading of the task specs). My functions are pascal & comb although comb is, strictly speaking, not a function :-) --[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 07:35, 17 May 2015 (UTC)

:How about you add a note? I guess the focus should be on getting comparable entries. What do others think? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:53, 17 May 2015 (UTC)

:: A note was added to the 2nd REXX entry. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:36, 27 March 2016 (UTC)

### range of numbers

Because the Pascal symmetric matrix uses '''i+j''' 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: $\frac\left\{n\left(n-1\right)\left(n-2\right)\ldots\left(n-k+1\right)\right\}\left\{k\left(k-1\right)\left(k-2\right)\ldots 1\right\}$ :By calculating the numerator and denominator and comparing them separately to 2x you could explore when overflow might affect the calculation. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:50, 17 May 2015 (UTC)

:: The above formula is indeed the method that the REXX versions use, plus a refinement to optimize using the smaller factorial products. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:07, 17 May 2015 (UTC)

:::I thought you might have but was too lazy to check but then thought it might be good to leave the comment for others so left it. (Such poor justification for laziness, I know). :::--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:58, 17 May 2015 (UTC)

:::: Yes, computing the factorial product using the smaller numbers is indeed quite a bit faster. Of course, it only makes a noticeable difference if a large number of factorial products are being computed, or if the numbers being used are on the gihugeic side. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:30, 27 March 2016 (UTC)