RosettaCodeData/Task/Pascal-matrix-generation/Mathematica/pascal-matrix-generation-1.math
2023-07-01 13:44:08 -04:00

9 lines
336 B
Text

symPascal[size_] := NestList[Accumulate, Table[1, {k, size}], size - 1]
upperPascal[size_] := CholeskyDecomposition[symPascal@size]
lowerPascal[size_] := Transpose@CholeskyDecomposition[symPascal@size]
Column[MapThread[
Labeled[Grid[#1@5], #2, Top] &, {{upperPascal, lowerPascal,
symPascal}, {"Upper", "Lower", "Symmetric"}}]]