Name

specfun_pascal — Returns the Pascal matrix.

Calling Sequence

   P = specfun_pascal ( n )
   P = specfun_pascal ( n , k )
   
   

Parameters

n :

a matrix of floating point integers, must be positive

k :

a matrix of floating point integers, k=-1 returns the upper Pascal matrix, k=0 returns the symetric Pascal matrix, k=1 returns the lower triangular Pascal matrix, other values produce an error. Default k=0.

P :

a nxn matrix of floating point integers

Description

Returns the Pascal matrix.

The matrix U=specfun_pascal(n,1) is so that U'*U=S where S=specfun_pascal(n,0).

The performances of this algorithm have been optimized.

Examples

specfun_pascal(5) // symetric
specfun_pascal(5,-1) // upper
specfun_pascal(5,0) // symetric
specfun_pascal(5,1) // lower

// Check a famous identity
n = 5;
U = specfun_pascal(n,-1)
S = specfun_pascal(n,0)
L = specfun_pascal(n,1)
L*U - S

   

Authors

Copyright (C) 2009 - 2010 - Michael Baudin

Bibliography

http://bugzilla.scilab.org/show_bug.cgi?id=7670

http://en.wikipedia.org/wiki/Pascal_matrix