Accelerating the pace of engineering and science

# pascal

Pascal matrix

A = pascal(n)
A = pascal(n,1)
A = pascal(n,2)

## Description

A = pascal(n) returns a Pascal's Matrix of order n: a symmetric positive definite matrix with integer entries taken from Pascal's triangle. The inverse of A has integer entries.

A = pascal(n,1) returns the lower triangular Cholesky factor (up to the signs of the columns) of the Pascal matrix. It is involutary, that is, it is its own inverse.

A = pascal(n,2) returns a transposed and permuted version of pascal(n,1). A is a cube root of the identity matrix.

## Examples

pascal(4) returns

```1     1     1     1
1     2     3     4
1     3     6    10
1     4    10    20```

A = pascal(3,2) produces

```A =
1     1     1
-2    -1     0
1     0     0```

expand all

### Pascal's Matrix

Pascal's triangle is a triangle formed by rows of numbers. The first row has entry 1. Each succeeding row is formed by adding adjacent entries of the previous row, substituting a 0 where there is no adjacent entry. Pascal's matrix is generated by selecting the portion of Pascal's triangle that corresponds to the specified matrix dimensions, as outlined in the graphic. The matrix outlined corresponds to the MATLAB® command pascal(4).