Section 1 · 9 min read
Linear algebra
Matrix types, determinants, rank, solving linear systems, eigenvalues and eigenvectors with their shortcut properties, Cayley-Hamilton, and LU decomposition.
On this page
Linear algebra questions in GATE CS are mostly computational: an eigenvalue or determinant to find, a rank to determine, a system to classify as having zero, one or infinitely many solutions. Most can be solved in under two minutes if you use the shortcut properties instead of expanding characteristic polynomials by brute force.
Matrix basics
Special matrices
| Type | Definition | Useful fact |
|---|---|---|
| Symmetric | real eigenvalues, orthogonal eigenvectors | |
| Skew-symmetric | diagonal is zero; odd order implies ; eigenvalues are 0 or purely imaginary | |
| Orthogonal | , eigenvalues have $ | |
| Idempotent | eigenvalues are 0 or 1; rank equals trace | |
| Nilpotent | for some | all eigenvalues are 0 |
| Involutory | eigenvalues are | |
| Triangular | zero above or below the diagonal | eigenvalues and determinant come from the diagonal |
Every square matrix is the sum of a symmetric and a skew-symmetric matrix: .
Determinants
Properties for matrices:
- , , .
- . Watch the exponent.
- Swapping two rows changes the sign. Adding a multiple of one row to another changes nothing. Multiplying one row by multiplies the determinant by .
- Two equal or proportional rows give .
- , and .
Rank
The rank of is the number of linearly independent rows (equal to the number of independent columns), which is the number of nonzero rows in its row echelon form.
- for an matrix.
- .
- Rank-nullity: (number of columns).
- A square is invertible iff iff iff 0 is not an eigenvalue.
- A nonzero matrix of the form has rank 1.
Systems of linear equations
For with unknowns, compare and :
| Condition | Solutions |
|---|---|
| none (inconsistent) | |
| exactly one | |
| infinitely many, with free variables |
The homogeneous system always has . It has a nonzero solution iff ; for square , iff . The solution set of is a subspace of dimension .
For questions with parameters, row reduce once with the parameters kept symbolic, then read off which values make a pivot vanish.
Eigenvalues and eigenvectors
is an eigenvalue of with eigenvector if . The eigenvalues are the roots of the characteristic polynomial .
Shortcut properties
For an matrix with eigenvalues (counted with multiplicity):
- and .
- For : .
- Eigenvalues of a triangular or diagonal matrix are its diagonal entries.
- has the same eigenvalues as (eigenvectors may differ).
- If then for any polynomial , . So , , have eigenvalues , , with the same eigenvectors.
- has eigenvalues , and has eigenvalues (for invertible ).
- and have the same eigenvalues.
- If every row sums to , then is an eigenvalue with eigenvector .
- A rank 1 matrix has eigenvalue 0 with multiplicity at least ; the remaining eigenvalue equals the trace.
Multiplicity and diagonalization
The algebraic multiplicity of is its multiplicity as a root. The geometric multiplicity is , the number of independent eigenvectors for . Always
is diagonalizable () iff for every eigenvalue the two multiplicities match, iff has independent eigenvectors. Sufficient conditions: distinct eigenvalues, or real symmetric. Eigenvectors for distinct eigenvalues are always linearly independent.
When , , which is how large powers are computed.
Cayley-Hamilton theorem
Every square matrix satisfies its own characteristic equation. For : Uses: express as a polynomial in , or reduce a high power to a combination of and .
LU decomposition
with lower triangular and upper triangular. In Doolittle form has 1s on its diagonal; in Crout form does.
How to get Doolittle factors by elimination: run Gaussian elimination without row swaps. is the final upper triangular matrix. The entry () is the multiplier used to clear position , that is, .
Facts:
- in Doolittle form (product of the pivots).
- For an invertible matrix, the factorization without row swaps exists iff every leading principal minor is nonzero (so no pivot becomes zero). Otherwise use with a permutation matrix . Example: has no LU factorization without a row swap.
- Solving : first by forward substitution, then by back substitution, each . The factorization costs once and is reused for many right-hand sides.
Worked examples
Worked example 1: Eigenvalues by trace and determinant
has one eigenvalue equal to 5. Find the others.
- Each row sums to 5, so 5 is an eigenvalue with eigenvector .
- , so the other two sum to 2.
- , so the other two multiply to 1.
- gives .
Eigenvalues: . Since has rank 1, the eigenvalue 1 has 2 independent eigenvectors and is diagonalizable.
Worked example 2: Classifying a system
For which does , have infinitely many solutions? No solution?
- . For , unique solution.
- For the second equation is , exactly twice the first. Rank 1 for both and : infinitely many solutions.
- There is no giving no solution, because was chosen proportional. If the right side were 7 instead of 6, would give no solution.
Worked example 3: Power via Cayley-Hamilton
. Express in terms of and .
- , , so .
- .
- .
Check through eigenvalues 1 and 2: and .
Worked example 4: Doolittle factorization
Factor .
- Multiplier .
- .
- , .
Check: , and .
Worked example 5: Rank-nullity
A matrix has rank 3. What is the dimension of the solution space of ?
Nullity . Note is the number of columns (unknowns), not rows.
Common traps
- , not .
- Sum of eigenvalues is the trace, product is the determinant. Swapping these is a frequent error.
- Eigenvalues of are not sums of eigenvalues of and in general.
- A repeated eigenvalue does not automatically mean "not diagonalizable". Check the rank of .
- Row operations change eigenvalues. Do not row reduce before finding eigenvalues.
- In rank-nullity, use the number of columns.
- Forgetting that a homogeneous system is never inconsistent.
- In LU, the multiplier goes into with a plus sign: if you did , then .
Quick revision
- ; ; .
- Rank + nullity = number of columns.
- : no solution. : unique. : infinitely many.
- , .
- Triangular: eigenvalues on the diagonal. Equal row sums : is an eigenvalue.
- has eigenvalues ; has .
- Symmetric: real eigenvalues, diagonalizable. Distinct eigenvalues: diagonalizable.
- Geometric multiplicity .
- Cayley-Hamilton (): .
- Doolittle LU: holds the elimination multipliers, is the echelon form, .