Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,45 @@
|
|||
PascalUT := proc(n::integer)
|
||||
local M := Matrix(n,n):
|
||||
local i:
|
||||
local j:
|
||||
M[1,1..n] := 1:
|
||||
for j from 2 to n do
|
||||
for i from 2 to n do
|
||||
M[i,j] := M[i,j-1] + M[i-1,j-1]:
|
||||
end:
|
||||
end:
|
||||
return M:
|
||||
end proc:
|
||||
|
||||
PascalUT(5);
|
||||
|
||||
PascalLT := proc(n::integer)
|
||||
local M := Matrix(n,n):
|
||||
local i:
|
||||
local j:
|
||||
M[1..n,1] := 1:
|
||||
for i from 2 to n do
|
||||
for j from 2 to n do
|
||||
M[i,j] := M[i-1,j] + M[i-1,j-1]:
|
||||
end:
|
||||
end:
|
||||
return M:
|
||||
end proc:
|
||||
|
||||
PascalLT(5);
|
||||
|
||||
Pascal := proc(n::integer)
|
||||
local M := Matrix(n,n):
|
||||
local i:
|
||||
local j:
|
||||
M[1..n,1] := 1:
|
||||
M[1,2..n] := 1:
|
||||
for i from 2 to n do
|
||||
for j from 2 to n do
|
||||
M[i,j] := M[i,j-1] + M[i-1,j]:
|
||||
end:
|
||||
end:
|
||||
return M:
|
||||
end proc:
|
||||
|
||||
Pascal(5);
|
||||
Loading…
Add table
Add a link
Reference in a new issue