Pascal matrix generation: Difference between revisions
Content added Content deleted
imported>Maxima enthusiast No edit summary |
mNo edit summary |
||
Line 1:
{{task|Matrices}}
A pascal matrix is a two-dimensional square matrix holding numbers from [[Pascal's triangle]], also known as [[Evaluate binomial coefficients|binomial coefficients]] and which can be shown as <big><sup>n</sup>C<sub>r</sub>.</big>
Line 44:
The [[Cholesky decomposition]] of a Pascal symmetric matrix is the Pascal lower-triangle matrix of the same size.
<br><br>
=={{header|11l}}==
{{trans|Python}}
<syntaxhighlight lang="11l">F pascal_upp(n)
V s = [[0] * n] * n
Line 1,261:
=={{header|BQN}}==
<code>C</code> is the combinations function, taken from BQNcrate. The rest of the problem is simple with table (<code>⌜</code>).
<syntaxhighlight lang="bqn">C←(-÷○(×´)1⊸+)⟜↕
Line 1,821 ⟶ 1,820:
=={{header|Delphi}}==
See [https://rosettacode.org/wiki/Pascal_matrix_generation Pascal].
=={{header|Elixir}}==
<syntaxhighlight lang="elixir">defmodule Pascal do
Line 2,722:
=={{header|J}}==
<syntaxhighlight lang="j"> !/~ i. 5
1 1 1 1 1
Line 4,616 ⟶ 4,615:
=={{header|Racket}}==
<syntaxhighlight lang="racket">#lang racket
(require math/number-theory)
Line 5,244 ⟶ 5,242:
=={{header|Stata}}==
Here are variants for the lower matrix.
|