Differences between revisions 4 and 10 (spanning 6 versions)
Revision 4 as of 2022-03-16 05:29:25
Size: 1877
Comment:
Revision 10 as of 2025-09-24 17:48:02
Size: 4170
Comment: Simplifying matrix page names
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

These '''special matrices''' are core concepts to linear algebra.

<<TableOfContents>>

----

Line 5: Line 13:
The '''identity matrix''' multiplied by matrix A returns matrix A. The '''identity matrix''' is a diagonal line of ones in a square matrix of zeros.
Line 7: Line 15:
This matrix is simply a diagonal line of 1s in a matrix of 0s. Any matrix '''''A''''' multiplied by the (appropriately sized) identity matrix returns matrix '''''A'''''.
Line 10: Line 18:
┌ ┐
│ 1 0 0│
│ 0 1 0│
│ 0 0 1│
└ ┘
julia> using LinearAlgebra

julia> Matrix{Int8}(I,3,3)
3×3 Matrix{Int8}:
 1 0 0
 0 1 0
 0 0 1
Line 16: Line 26:

----
Line 19: Line 31:
== Permutation Matrix == == Permutation Matrices ==
Line 21: Line 33:
A '''permutation matrix''' multiplied by matrix A returns matrix C which is a row-exchanged transformation of A. A '''permutation matrix''' is a square matrix of zeros with a one in each row. Multiplying a permutation matrix by some matrix '''''A''''' ('''''PA''''') results in a row-exchanged '''''A'''''. Multiplying some matrix '''''A''''' by a permutation matrix ('''''AP''''') results in a column-exhanged '''''A'''''.
Line 23: Line 35:
For 3 by 3 matrices, there are 6 possible permutation matrices. They are often denoted based on the rows they exchange, such as P,,2 3,,. {{{
julia> P = Matrix{Int8}(I,3,3)[:,[3,2,1]]
3×3 Matrix{Int8}:
 0 0 1
 0 1 0
 1 0 0

julia> A = [1 2 3; 4 5 6; 7 8 9]
3×3 Matrix{Int64}:
 1 2 3
 4 5 6
 7 8 9

julia> P * A
3×3 Matrix{Int64}:
 7 8 9
 4 5 6
 1 2 3

julia> A * P
3×3 Matrix{Int64}:
 3 2 1
 6 5 4
 9 8 7
}}}

The transpose permutation matrix is the same as the inverse permutation matrix: '''''P'''^T^ = '''P'''^-1^''.

The transpose permutation matrix multiplied by the permutation matrix is the same as the identity matrix: '''''P'''^T^'''P''' = '''I'''''



=== Counting Permutations ===

For 3 by 3 matrices, there are 6 possible permutation matrices. They are often denoted based on the rows they exchange, such as '''''P''',,2 3,,''.
Line 35: Line 81:
Note that a permutation matrix can mirror either the rows or columns of matrix A, depending simply on the order. For any ''n'' by ''n'' matrix, there are ''n''! possible permutation matrices.
Line 37: Line 83:
{{{
┌ ┐┌ ┐ ┌ ┐
│ 0 1││ 1 2│ │ 3 4│
│ 1 0││ 3 4│=│ 1 2│
└ ┘└ ┘ └ ┘

┌ ┐┌ ┐ ┌ ┐
│ 1 2││ 0 1│ │ 2 1│
| 3 4|│ 1 0│=│ 4 3│
└ ┘└ ┘ └ ┘
}}}
----
Line 51: Line 87:
== Inverse Matrices == == Upper Triangular Matrices ==
Line 53: Line 89:
An '''inverse matrix''' is denoted as A^-1^. If a matrix is multiplied by its inverse matrix, it returns the identity matrix. If a square matrix has only zeros below the diagonal, it is an '''upper triangular matrix'''.
Line 55: Line 91:
If A^-1^ exists, then A is '''invertible''' and '''non-singular'''. Not all matrices are invertible. [[LinearAlgebra/Elimination|Gauss-Jordan elimination]] results in a '''row echelon form''' of '''''A''''' which, if '''''A''''' is square, is also upper triangular.
Line 57: Line 93:
For a square matrix A, the left inverse is the same as the right inverse. AA^-1^ = A^-1^A = I [[LinearAlgebra/Orthonormalization|Gram-Schmidt orthonormalization]] is characterized as '''''A = QR''''' where '''''R''''' is upper triangular.

----



== Lower Triangular Matrices ==

If a square matrix has only zeros above the diagonal, it is a '''lower triangular matrix'''.

If [[LinearAlgebra/Elimination|Gauss-Jordan elimination]] is continued into backwards elimination, it results in a '''reduced row echelon form''' of '''''A'''''. If '''''A''''' is square, it will be both upper and lower triangular.

----



== Symmetric Matrices ==

A '''symmetric matrix''' is equal to its [[LinearAlgebra/Transposition|transpose]].

Only a square matrix can be symmetric.

These matrices have several useful properties:
 * The [[LinearAlgebra/EigenvaluesAndEigenvectors|eigenvalues]] are always real.
 * The [[LinearAlgebra/EigenvaluesAndEigenvectors|eigenvectors]] can be chosen to be [[LinearAlgebra/Orthogonality#Orthonormality|orthonormal]].
 * The [[LinearAlgebra/Diagonalization|diagonalization]] of a symmetric matrix is expressed as '''''A''' = '''QΛQ'''^-1^ = '''QΛQ'''^T^'' using the orthonormal eigenvectors.
 * The signs of the pivots are the same as the signs of the eigenvalues.

[[LinearAlgebra/Projection|Projection matrices]] are always symmetric, and symmetric matrices are combinations of orthogonal projection matrices.

Multiplying a rectangular matrix '''''R''''' by its transpose '''''R'''^T^'' will always create a symmetric matrix. This can be proven with the above properties: ''('''R'''^T^'''R''')^T^ = '''R'''^T^('''R'''^T^)^T^ = '''R'''^T^'''R'''''.

Special Matrices

These special matrices are core concepts to linear algebra.


Identity Matrix

The identity matrix is a diagonal line of ones in a square matrix of zeros.

Any matrix A multiplied by the (appropriately sized) identity matrix returns matrix A.

julia> using LinearAlgebra

julia> Matrix{Int8}(I,3,3)
3×3 Matrix{Int8}:
 1  0  0
 0  1  0
 0  0  1


Permutation Matrices

A permutation matrix is a square matrix of zeros with a one in each row. Multiplying a permutation matrix by some matrix A (PA) results in a row-exchanged A. Multiplying some matrix A by a permutation matrix (AP) results in a column-exhanged A.

julia> P = Matrix{Int8}(I,3,3)[:,[3,2,1]]
3×3 Matrix{Int8}:
 0  0  1
 0  1  0
 1  0  0

julia> A = [1 2 3; 4 5 6; 7 8 9]
3×3 Matrix{Int64}:
 1  2  3
 4  5  6
 7  8  9

julia> P * A
3×3 Matrix{Int64}:
 7  8  9
 4  5  6
 1  2  3

julia> A * P
3×3 Matrix{Int64}:
 3  2  1
 6  5  4
 9  8  7

The transpose permutation matrix is the same as the inverse permutation matrix: PT = P-1.

The transpose permutation matrix multiplied by the permutation matrix is the same as the identity matrix: PTP = I

Counting Permutations

For 3 by 3 matrices, there are 6 possible permutation matrices. They are often denoted based on the rows they exchange, such as P2 3.

┌      ┐          ┌      ┐ ┌      ┐ ┌      ┐ ┌      ┐ ┌      ┐
│ 1 0 0│          │ 1 0 0│ │ 0 1 0│ │ 0 1 0│ │ 0 0 1│ │ 0 0 1│
│ 0 1 0│          │ 0 0 1│ │ 1 0 0│ │ 0 0 1│ │ 1 0 0│ │ 0 1 0│
│ 0 0 1│          │ 0 1 0│ │ 0 0 1│ │ 1 0 0│ │ 0 1 0│ │ 1 0 0│
└      ┘          └      ┘ └      ┘ └      ┘ └      ┘ └      ┘
(identity matrix)   P        P        (and so on...)
                     2,3      1,2

For any n by n matrix, there are n! possible permutation matrices.


Upper Triangular Matrices

If a square matrix has only zeros below the diagonal, it is an upper triangular matrix.

Gauss-Jordan elimination results in a row echelon form of A which, if A is square, is also upper triangular.

Gram-Schmidt orthonormalization is characterized as A = QR where R is upper triangular.


Lower Triangular Matrices

If a square matrix has only zeros above the diagonal, it is a lower triangular matrix.

If Gauss-Jordan elimination is continued into backwards elimination, it results in a reduced row echelon form of A. If A is square, it will be both upper and lower triangular.


Symmetric Matrices

A symmetric matrix is equal to its transpose.

Only a square matrix can be symmetric.

These matrices have several useful properties:

  • The eigenvalues are always real.

  • The eigenvectors can be chosen to be orthonormal.

  • The diagonalization of a symmetric matrix is expressed as A = QΛQ-1 = QΛQT using the orthonormal eigenvectors.

  • The signs of the pivots are the same as the signs of the eigenvalues.

Projection matrices are always symmetric, and symmetric matrices are combinations of orthogonal projection matrices.

Multiplying a rectangular matrix R by its transpose RT will always create a symmetric matrix. This can be proven with the above properties: (RTR)T = RT(RT)T = RTR.


CategoryRicottone

LinearAlgebra/SpecialMatrices (last edited 2025-09-24 17:48:02 by DominicRicottone)