Matrices -- Module 3 -- Mathematics -IA


Index

  1. What are Matrices?
  2. What is a Vector?
  3. Vector Addition
  4. Scalar Multiplication
  5. Quick Recap Other Vector Operations
  6. Matrix multiplication
  7. Linear system of equations and how to solve them, methods of solving them
  8. Linear Independence
  9. Rank of a matrix
  10. Methods to find the rank of a matrix
  11. Cramer's rule
  12. The Matrix Inversion method.
  13. Matrix Inversion method (Adjugate matrix version)

What are Matrices?

1. What is a Matrix?

matrix is a rectangular array of numbers or symbols arranged in rows and columns. For example:

[234567]

2. Types of Matrices

a) Row Matrix

A matrix with just one row.

[234]

b) Column Matrix

A matrix with just one column.

[25]

c) Square Matrix

Number of rows equals number of columns.

[abcd]

d) Diagonal Matrix

A square matrix where all elements off the main diagonal are zero.

[100010001]

e) Scalar Matrix

A diagonal matrix where all diagonal elements are equal.

[2002]

f) Identity Matrix (Unit Matrix)

A diagonal matrix with all main diagonal elements equal to 1.

[100010001]

g) Zero Matrix (Null Matrix)

All elements are zero.

[0000]

3. Matrix Notation


Vectors

What is a Vector?

vector is an object that has both magnitude (length) and direction. In the context of algebra and matrices, a vector is typically represented as an ordered list of numbers, which can be written as a column or a row. For example, in 3D space:

v = [215]

This is a column vector in R3 (3-dimensional real space).

Pasted image 20250730141410.png


Types of Vectors

[215]

Vector Addition

If you have two vectors of the same size:

a = [a1a2an]  b = [b1b2bn]

Their sum is:

a + b = [a1 + b1a2 + b2an + bn]

Example:

a = [12],  b = [35] [1 + 32 + 5] = [47]

Geometric interpretation: Scalar multiplication stretches or shrinks the vector, and if the scalar is negative, it reverses its direction.

Pasted image 20250730142606.png

Note the differences in the length of the lines of the vector after addition


Scalar Multiplication

Given a scalar (number) k, and a vector a:

ka = k[a1a2an] = [ka1ka2kan]

Example:

k = 3, a = [24]  3a = [3×23×4] = [612]

Geometric interpretation: Scalar multiplication stretches or shrinks the vector, and if the scalar is negative, it reverses its direction.


Quick Recap: Other Vector Operations

Dot Product (Scalar Product)

Definition:
The dot product of two vectors a and b in Rn is a scalar given by:

a  b = a1b1 + a2b2 +  anbn

It can also be written as:

a  b = |a||b|  cosθ

where θ is the angle between the vectors.

Example 1:

Let a = [ 2,3,4 ] and b = [ 1,0,2 ]

a  b = 2(1) + 3(0) + 4(2)a  b = 2  8 = 6

Example 2:

Let:

a=[ 3 4 ]

and

b=[ 4 3 ]

We are asked to find the angle between these two vectors.

Step 1: Compute the dot product
a  b = 3×4 + 4×3 =24
Step 2: Compute the magnitudes
|a| = 32 + 42 =9+16 =25 = 5|b| = 42 + 32 = 16 + 9 = 25 = 5
Step 3: Plug into formula to find the angle:
a  b = |a||b|  cosθ24 = 25 × cos θcos θ = 2425θ = cos1(2425) = cos1(0.96)  16.26o

Cross Product(Vector Product)

Definition:
The cross product of two vectors in R3 a×b, is a vector perpendicular to both, with direction given by the right-hand rule and magnitude |a||b|sinθ, where θ is the angle between them.

The formula is:

a × b = |i^j^k^a1a2a3b1b2b3|=[ (a2b3  a3b2)i^, (a3b1  a1b3)j^, (a1b2  a2b1)k^ ]

Example:

Let a = [ 1,2,3 ] and b = [ 4,5,6 ]

a × b = [i^j^k^123456] = [((2×6)(5×3))i^((4×3)(6×1))j^((5×1)(4×2))k^]a×b = [3i^6j^3k^]

Matrix multiplication

https://www.youtube.com/watch?v=2spTnAiQg4M

What is Matrix Multiplication?

Matrix multiplication is an operation that takes two matrices and produces another matrix. It’s not just multiplying each corresponding entry; instead, you sum the products of rows and columns.


How to verify if the order of multiplication of two matrices is valid or not.

Take these two matrices from the video.

Pasted image 20250810145139.png

Note how their n (if you write n×m) or m if you write (m×n) but the order of a matrix is basically :

row × column.

If the number of columns of the first matrix, equates to the number of rows of the second matrix, then we can multiply the two matrices.

Which is why A×B is valid.

But if you try:

Pasted image 20250810145351.png

B×A , it's not valid since B has 2 columns and A has only 1 row. The numbers don't match.

So yes, the order of multiplication of matrices does matter here.


How to Multiply Two Matrices

You can either the watch the video, or read the following here:

Suppose:

A = [a11a12a21a22], B = [b11b12b21b22]

The element in the ith row and jth column of AB is:

(AB)ij = k=1naikbkj

Or in simple words: dot the i-th row of A with the j-th column of B.


Example

A = [2345], B = [6789]

We have to multiply these new matrices.

Let the product matrix be named : C

So,

So, the product of the two matrices A and B, C is :

A = [36416473]

Key Properties of Matrix Multiplication


Linear system of equations and how to solve them, methods of solving them

For people like me who are revisiting Semester 1 math after crossing semester 6, you will probably know the content bomb that I am about to drop here from sem 6 notes.

For first timers however, it will still be just as easily understandable to you.

The following content will cover:

  1. Gaussian Elimination method of solving a system of linear equations
  2. Gauss-Jordan method of solving a system of linear equations
  3. Matrix inversion method (using two ways) and using the method of matrix inversion to solve a system of linear equations
  4. Determinant of a matrix (2x2) and (3x3)
  5. Transpose of a matrix

By all means, enjoy:


Gaussian Elimination method to find the solution for a system of linear equations

This method converts a system of equations into an upper-triangular form (where all entries below the main diagonal are zero) so that you can then solve for the unknowns via back substitution.

https://www.youtube.com/watch?v=eDb6iugi6Uk

Example 1

So let's say we have this system of linear equations here

Pasted image 20250405122420.png

So first of what we will do is construct an augmented matrix using the coefficients of the equations.

[1112 2115 1221 ]

Now what we need to do is to convert this to a row-echelon form.

The row-echelon form of this matrix should be something like this :

Pasted image 20250405131719.png

Note that the bottom left half elements below the diagonal line are all zeroes. (Only works for perfect square matrices)

Pasted image 20250405132915.png

(Image generated by the new version of ChatGPT, not bad indeed.)

So with this matrix, let's call it A

[1112 2115 1221 ]

How do we convert it to a row-echelon form?

It's done by doing something called a matrix transformation via matrix row operations.

So first of all we select a pivot element. A pivot element is the first non-zero element we encounter in a matrix.

In R1 we have the first non-zero element as 1. So we select that as the pivot element.

Now all our operations will be centered around R1.

So we can do $$R_3 \rightarrow R_1 \ + \ R_3 $$

So the matrix becomes :

[1112 2115 0311 ]

Remember that when we add two rows, all elements of the rows are affected.

We can then try :

R2R2  2R1[1112 0339 0311 ]

Then we can do :

R3R3 + R2[1112 0339 0048 ]

We are already there

This can be done by simply for R2 as:

R2  13 ×R2[1112 0113 0048 ]

We have already reached the row-echelon form, but,

We can further simplify the matrix by performing an operation on R3 :

R3 14 ×8[1112 0113 0012 ]

Now we can convert the matrix back to equations as :

x + y  z = 2y  z = 3z = 2

Now with some simple substitution :

x + y  2 = 2 x + y = 0  x = y

Thus :

y  2 = 3  y = 3 + 2 y = 1

Therefore :

x = (1) =1

So we have the solution for the system of equations as:

x = 1; y = 1; z = 2

Summary:

Always use the format:

RtargetRtargetmRpivot

where :

m = Coefficient of target x ,y orzCoefficient of pivot x ,y orz

For example if we have the rows :


Example 2

Pasted image 20250405130111.png

So we can write the matrix as:

[2111 32110 2126 ]

Here we will select the pivot element as 2.

So all our operations will be centered around R1 for now.

So to solve remove the coefficients of x of R2 and R3 to zero, we will follow the rules mentioned above:

So the target row is R3 and the pivot row is R1.

So m = 22 =1

So $$R_3 \ \to \ R_3 \ - \ m \ \times R_1 \ \implies \ R_3 \ \to \ R_3 \ - \ \frac{2}{2} \ \times R_1 \ \implies R_3 \ - \ R_1$$

So

R3 =[[22], [1  1], [2  (1)], | 6  1]R3 = [0, 2 , 3 | 5]

Therefore the matrix becomes :

[2111 32110 0235 ]

Now for Row 2, we have :

m = 32

Thus Row 2 will be :

R2 R2  32 ×R1R2 =[ [3  3 ×22], [2  3 ×12], [1  3 × (1)2], | 10  3 ×12 ]R2 = [ 0, 0.5, 2.5 | 8.5 ]

Therefore the matrix now becomes :

[2111 00.52.58.5 0235 ]

Now let's remove the y component of R3 and set it to zero.

So our pivot component for y is 0.5 in R2.

But why change pivots now?

The reason is that each pivot is used to clear the entries below it in its column. R1​ has already been used to eliminate the x-terms in the lower rows. Now, to get the matrix into row-echelon form, the next pivot must appear in a lower row than R1​. In this case, that pivot is in R2​, and it is used to eliminate the y-term in R3​.

The way pivots are chosen are that they are taken from a column which hasn't been used for a pivot, yet.

So :

m = 212 = 2 ×2 = 4

Therefore R3 will become :

R3 R3 + 4R2

So R3 will be:

R3 = [ [0 + 4 ×0], [2 + 4 ×0.5], [3 + 4 ×2.5], | 5 + 4 ×8.5 ]

Thus,

R3 = [ 0, 0, 13 | 39]

So the matrix will become :

[2111 00.52.58.5 001339 ]

Now let's convert this matrix back to a system of equations :

2x + y  z = 10.5y + 2.5z = 8.513z = 39

So we get :

z = 30.5y + 2.5 ×3 = 8.5 0.5y + 7.5 = 8.5 0.5y = 1y = 1 ×21y = 2

And finally :

2x + 2  3 =1 2x 1 = 1 2x = 2 x = 1

Thus :

x=1, y=2, z=3

Gauss-Jordan Elimination Method

This is similar to the previous method, except here we reduce the matrix even further, to something called a "reduced row echelon form".

https://www.youtube.com/watch?v=eYSASx8_nyg

Pasted image 20250405201153.png

Now this, is the reduced row echelon form.

where a,d,f=1 , essentially resulting in the identity matrix (for square matrices only).

The identity matrix is :

Pasted image 20250405220936.png

where the diagonal elements of the matrix are 1 and all the other elements are zero.

So let's say we have this system of equations here:

Pasted image 20250405182359.png

We will solve them in the same manner as we did before, only that there will be a few more operations now.

So let's convert this system of equations to an augmented matrix first.

[1117 1123 2119 ]

Let's set the pivot element to 1 for the x component.

So the target row is R2.

Thus,

m = 11 = 1

So, R2 will be:

R2  R2  R1R2 = [ [0], [2], [3], | 4 ]

So the matrix becomes :

[1117 0234 2119 ]

Now the target is R3. So :

m = 21 = 2

So:

R3  R3  m ×R1R3 = [ [2  2], [1  2], [1  2(1)], | 9  14  ]R3 = [ [0], [1], [3] | 5 ]

So the matrix becomes:

[1117 0234 0135 ]

Now we set the pivot element to -2 for the y component of R3

Thus,

m = 12 = 12

So :

R3  R3  12 × R2 R3 = [ [012 ×0], [1  (12 ×2)], [3  (12 ×3)] | 5  (12 ×4)  ]R3 = [ [0], [0], [1.5] | 3]

So, the matrix now becomes :

[1117 0234 001.53 ]

Now for the z component for R2 , we can set the pivot to 1 of R3. by doing R3 23 ×R3

[1117 0234 0012 ]

So:

m = 31 = 3

Note: If we instead tried to set R1's -1 as the pivot, it would then affect R2's x component while calculation. So it's better to use a row which won't be affected in future, that being R3

So,

R2  R2  3R3 R2 = [ 0, 2, 0 | 2 ]

So, the matrix becomes :

[1117 0202 0012 ]

Now for R1, :

m = 11 = 1

So :

R1  R1 + R3R1 = [ 1, 1, 0 | 5 ]

Thus the matrix becomes :

[1105 0202 0012 ]

Now, for the y component of R1, this may seem like that we are going against the rules of selecting a pivot where we can't reuse an already selected element for a pivot again, but during RREF (reduced row echelon form) there are two types of eliminations :

Forward Elimination vs. Backward Elimination

  1. Forward Elimination:

    • Key Point: Once a pivot is chosen in a column, it is used to clear entries downward. You do not worry about entries above because those rows haven't been processed yet.

      We did this when we were processing the elements below the diagonal line.

  2. Backward Elimination (or Back Substitution for RREF):
    Once the matrix is in row-echelon form (all entries below each pivot are zero), you perform backward elimination to clear entries above each pivot. This step ensures that each pivot is the only nonzero entry in its column.

    We are now about to do this with the y component of R1.

    • Why This is Valid:

      • The forward phase ensures that each pivot has zeros below it.

      • The backward phase then uses each pivot to clear above it.

      • Even though the pivot in Row 2 was already used to clear entries below (in Row 3), it must also clear any nonzero entry above it (in Row 1) to satisfy the RREF condition (each pivot column has zeros everywhere except for the pivot itself).

So we can safely select -2 as the pivot.

So :

m = 12

Before that we scale R2 by R2  12 ×R2

[1105 0101 0012 ]

Now m = 1, (for R1)

So, proceeding with R1 :

R1 R1  R2R1 = [1,0,0 | 6]

So, the final matrix becomes :

[1006 0101 0012 ]

Now we can easily convert them back to equations and get the values of x, y and z.

So,

x = 6y = 1z = 2

So the solutions are :

x = 6, y = 1, z = 2

The Matrix Inversion method.

Let's walk through the matrix inversion method step by step. The idea is that if you have a system of linear equations in the form

Ax=b

and the coefficient matrix A is invertible (its determinant is nonzero), then the unique solution is given by :

x = A1b

Pre-requisites before using this method (must) (skip ahead if you already know these).

  1. Knowing how to find out the determinants of 2x2 and 3x3 matrix. (https://www.youtube.com/watch?v=3ROzG6n4yMc)
  2. Transpose of a matrix.
  3. Knowing how to find the inverses of 2x3 and 3x3 matrix. (https://www.youtube.com/watch?v=aiBgjz5xbyg) (2x2) and (https://www.youtube.com/watch?v=Fg7_mv3izR0) (3x3)

1. The Determinant of a 2×2 matrix.

The determinant of a 2x2 matrix is given by :

Pasted image 20250406113901.png

Let's say we have this example :

Pasted image 20250406114138.png

So the determinant of this matrix will be:

det|7843|[7 ×3]  [4 ×8]= 21  32= 11

2. Determinant of a 3×3 matrix

Let's say we have a 3x3 matrix here

[123456789]

The determinant is given by :

det|123456789|

which evaluates to :

Pasted image 20241107213319.png

So let's say we have this example here :

Pasted image 20250406114726.png

The determinant of this 3x3 matrix will be:

det|243576819| +2[ (7×9)  (1×6) ]  4[ (5×9)  (8×6) ] + (3)[ (5×1)  (8×7) ]= +2 [57]  4[93]  3[61]= 114  372  183441

3. Determinant of a 4×4 matrix.


4. Transpose of a matrix.

The transpose of a matrix is just it's rows and columns interchanged.

[123456789]

The transpose of this matrix will be :

[147258369]

Same for a 2x2 matrix :

[abcd]

The transpose will be:

[acbd]

4. Inverse of a 2x2 matrix.

Note: Before trying to invert a matrix, you must first verify if the matrix is invertible or not.
This is done by finding the determinant of the matrix and checking whether it's zero or not.

If the determinant is zero, the matrix is not invertible, else the matrix is invertible.

So if we have a 2x2 matrix

[abcd]

The inverse is given by :

Pasted image 20250406115846.png

where $$\frac{1}{ad \ - \ bc}$$
is the determinant of the 2x2 matrix.

So let's say we have this matrix example.

Pasted image 20250406120248.png

So starting off, let's find the determinant of this matrix.

det|72175|= [7×5]  [17×2]= 35  34= 1

Now to find the inverse of this matrix :

A1 = 11 ×[dbca]

or

A1 = [52177]

5. Inverse of a 3x3 matrix

Now there are two ways to find the inverse of a 3x3 matrix.

Method 1 : Using Gauss-Jordan Elimination

One way is to use matrix row operations and using the method of Gauss-Jordan elimination to find the inverse of the 3x3 matrix.

https://www.youtube.com/watch?v=Fg7_mv3izR0

So if you have this matrix for example :

Pasted image 20250406125451.png

We write it out as in the picture, by augmenting the matrix with the identity matrix.

Then the goal is to perform row operations such that the identity matrix (reduced row echelon form) is on the LHS and on the RHS we get the inverted matrix.

The procedure is the same as Gauss-Jordan elimination, so if you want to see how that's done you can either watch the video in the link or just scroll up to the section of Gauss-Jordan elimination.


Method 2: Using the method of matrix of minors, co-factors and adjugate matrix.

This method is a much less time consuming one that the Gauss-Jordan elimination method.

https://www.khanacademy.org/math/in-in-grade-12-ncert/xd340c21e718214c5:determinants/xd340c21e718214c5:adjoint-and-inverse-of-a-matrix-using-minors-and-cofactors/v/inverting-3x3-part-1-calculating-matrix-of-minors-and-cofactor-matrix

https://www.khanacademy.org/math/in-in-grade-12-ncert/xd340c21e718214c5:determinants/xd340c21e718214c5:adjoint-and-inverse-of-a-matrix-using-minors-and-cofactors/v/inverting-3x3-part-2-determinant-and-adjugate-of-a-matrix

So we start off with a 3x3 matrix

Pasted image 20250406133327.png

We will create something called a "matrix of minors".

The matrix of minors is of this format:

Pasted image 20250406182630.png

which is basically :

  1. Choose an element.
  2. Hide the row and column in which that element is.
  3. Write the remaining elements in their existing order within a determinant format as singular element of a larger matrix.
  4. Keep repeating till all the elements in the original matrix, have been chosen.

So with our example matrix it will be :

Pasted image 20250406182920.png

Now after solving the individual determinants :

Pasted image 20250406182951.png

This is the matrix of minors.

Next up is the co-factor matrix.

Simply apply this sign pattern (we see this pattern during the determinant of a 3x3 matrix) :

Pasted image 20250406183042.png

to the elements of the matrix of minors.

Pasted image 20250406183107.png

Which now becomes the Co-Factor matrix.

Now we are halfway there!

Next up is the adjugate matrix.

The adjugate matrix is just the transpose of the Co-Factor matrix (rows and columns interchanged).

Pasted image 20250406183323.png

So the final inverse of our 3x3 matrix is the product of the determinant times the adjugate matrix

A3×31 = det(A) × adjugate(A)

So we already know how to find the determinant of a 3x3 matrix, so I will be skipping that here

The determinant of this matrix is :

Pasted image 20250406183602.png

So the final inverse is :

Pasted image 20250406183618.png

which will result in :

Pasted image 20250406183634.png


Finding the solution to a system of equations using the matrix inversion method.

So now that we have all the pre-requisites out of the way we can proceed with the matrix inversion method of finding the solution to a system of equations.

Let's proceed with the example we used in the Gauss-Jordan elimination method, better to proceed with a known problem as an example.

So we have the system of equations

Pasted image 20250405182359.png

So let's convert this system of equations to an augmented matrix first.

[1117 1123 2119 ]

However here we will do two things.

We split the augmented matrix into two separate matrices.

One will be the coefficient matrix, let's call it A

[111112211]

And the variables matrix, let's call it x

x = [xyz]

And the other one will be the constant matrix, let's call it b:

b = [739]

Now we need to find :

x = A1b

We will try to invert the coefficient matrix

So let's find out the determinant first:

det(A) = +1 [ 1  2 ]  1 [ 1  4 ] +(1) [ 1 + 2 ]= +1[ 3 ]  1[ 3 ]  1[ 3 ]= 3 + 3  3= 3

Since det(A)0 , this means the coefficient matrix is invertible.

So I will proceed with the second method here, as it's much faster than doing row operations.

Starting with the matrix of minors :

[111112211]

will be:

[|1211||1221||1121||1111||1121||1121||1112||1112||1111|]

(That was quite painful to type and render, but atleast faster than drawing with a mouse).

Now we solve the individual determinants :

[333231132]

So this is the matrix of minors.

Now we apply the sign scheme to get the co-factor matrix:

[333231132]

Now we find the adjugate matrix by transposing the co-factor matrix :

[321333312]

Now we compute the inverse of the matrix :

A1 = 13 × [321333312]

which will be :

[1231311111323]

Now using the formula :

x = A1b

we can find out the value of x, y and z.

So :

[xyz] = [1231311111323] ×[739]

For x, multiply each element of b to each element of the first row of A1 and add :

x = 7 ×1 + 23 ×3 + 13 ×9x = 7 + 2  3x = 6

Similarly :

y = 7 3 +9y = 1

And lastly :

z = 7 13 ×3 + 23 ×9z = 7  1 + 6z = 2

So we get a unique solution this time as :

x = 6, y = 1, z = 2

Simple recap example for the above 3 methods

Example

Given a simple 2×2 matrix:

[2341] [xy] = [97]

Here's the solution via all 3 methods, Gaussian Elimination, Gauss-Jordan Elimination and Matrix inversion method (Adjugate matrix version)

Gaussian Elimination

Pasted image 20250801134854.png


Gauss-Jordan Elimination

Pasted image 20250801134933.png


Matrix Inversion method (Adjugate matrix version)

Pasted image 20250801135004.png

That should clear up any confusions left.


Linear Independence

What is Linear Independence?

Definition:
A set of vectors {v1,v2,...,vn} is said to be linearly independent if the only solution to:

c1v1 + c2v2 +  + cnvn=0

is c1 = c2 =  = cn = 0


Geometric Independence


How to Test for Linear Independence (Algebraic Methods)

1. Equation Approach

Write the vector equation:

c1v1 + c2v2 +  + cnvn=0

Set up and solve the corresponding system. If only the trivial solution (ci=0) exists, the set is independent.

Let's understand this in a little more depth:

What is a Trivial Solution?

When testing if a set of vectors is linearly independent, we ask:

For scalars: c1, c2,  ,cn:

c1v1 + c2v2 +  + cnvn=0

If the only solution is:

c1=0, c2=0,  ,cn=0

then these zeroes are called the trivial solution.

If there exists another set of scalars (not all zero) that solves the above, it’s called a non-trivial solution.


2. Matrix Rank / Row-Reduction


3. Determinant Criterion (for Square Matrices) (Easy)


Example

Case 1: Linearly Dependent Vectors

Let:

a = [12], b = [24]

To check independence, solve:

c1 [12] + c2 [24] = [00]

Write them as a system of linear equations:

c1 + 2c2 = 02c1 + 4c2 = 0

Solve them however you want.

Now, if we set c2 = t

Then from the first equation, c1 = 2t

So, for any t,

c1 = 2t, c2 = t

Not both are always zero (unless t=0), so a non-trivial solution exists:
These vectors are linearly dependent.
(Geometrically: they point in the same direction; one is a multiple of the other. (So they are parallel to each other as well))


Case 2: Linearly Independent Vectors

Let,

p = [10], q = [01]

Solve:

c1 [10] + c2 [01] = [00]

So,

c1 = 0, c2 = 0

The only solution is c1 = 0, c2 = 0 — this is the trivial solution.
These vectors are linearly independent.
(Geometrically: they point along different axes.)


Rank of a matrix

What is the Rank of a Matrix?

Definition:
The rank of a matrix is the maximum number of linearly independent rows or columns in the matrix.


How to Find the Rank

1. Row Reduction (Echelon Form)

2. Largest Non-Zero Minor


Methods to find the rank of a matrix

1. By Normal form

https://www.youtube.com/watch?v=kaphHRq39JI&list=PLF-vWhgiaXWPZ7Ogw6zIZMg4aqUXEwrnJ&index=3

Pasted image 20250801144316.png

Let's use the given matrix in the example.

Yes, now we are dealing with non-square matrices.

Using normal form you can either use:

And then count the number of non-zero rows to get the rank of the matrix.

Remember that

Pasted image 20250801144957.png

Pasted image 20250801145716.png

It is an identity matrix in the case of square matrices.

For non-square matrices:

[123401650097]

However it is important to note that:

When solving equations, you do not always get an identity on the diagonal—RREF simply ensures all pivots are 1 and alone in their column. The rest of the structure depends on the rank and shape of the matrix.


IMPORTANT NOTE ON HOW TO DECIDE THAT THE REF or RREF has been reached in a non-square matrix.

Key properties of the Row-Echelon Form

What is a Pivot?

A bit late in the proper clarification definition, but here we go:

pivot is the first nonzero entry from the left in a row (when moving left to right).

For example:

Row 1: [ 0 0 5 7 ] Pivot is 5

Now,

When you find that the all the entries below the pivot in the pivot column are zero, you reach the Row-Echelon Form


For RREF in non-square matrices

[10ab01cd0000]

Where:


Example:

[123246011134]

Suppose, we have this matrix.

Now, we have to find the rank of a matrix:

Method 1: By Normal Form:

We can either use Gaussian Elimination or Gauss-Jordan Elimination to get the rank.

So, let's use Gaussian Elimination for this.

For R21 , pivot = R11 = 1

m = 2

R2  R2  2R1[123000011134]

For R41 , pivot is still R11 = 1, m = 1

R4  R4  R1[123000011011]

For R42, pivot can be set to R32 = 1, m = 1

R4  R4  R3[123000011000]

And now, we have achieved the row-echelon form, so we can stop here.

Judging by the number of non-zero rows, the rank of this matrix is 2.

Let's test now if the Gauss-Jordan elimination results in the same answer or not.

Continuing from the matrix,

For R13, we can set the pivot to R33, so m = 31 = 3

So, $$R_1 \ \rightarrow \ R_1 \ - \ 3R_3$$

[110000011000]

And for R12, pivot can be set to R32 = 1, so m = 1

So,

R1  R1 + R3[101000011000]

This is an acceptable RREF form, and the number of non-zero rows is 2, so the rank of this matrix is 2.


Method 2: By PAQ form.

You can still watch this video if you need extra clarity, but the explanation there is slightly confusing in my opinion.

https://www.youtube.com/watch?v=bVjjQXnVQ6U&list=PLF-vWhgiaXWPZ7Ogw6zIZMg4aqUXEwrnJ&index=4

This is easy, you just have to convert the matrix to an identity matrix, and then find out the rank by calculating the number of non-zero rows.

We can proceed the same till RREF to get:

[101000011000]

Now, to get the identity matrix, just swap R2 with R3

[101011000000]

To get the identity matrix.

And this is the PAQ form. The rank is achieved by counting the number of non-zero rows, which in this case is 2, so the rank of the matrix is 2.


Method 3: By Definition of Rank.

https://www.youtube.com/watch?v=-9jSv_F9Hz0&list=PLF-vWhgiaXWPZ7Ogw6zIZMg4aqUXEwrnJ&index=6

Note: This method is only for square matrices.

Steps:

1. Check if the determinant of the largest possible square matrix is non-zero
2. If the determinant is zero, check all (n-1)×(n-1) square submatrices
3. If all these are zero, check all (n-2)×(n-2) submatrices
4. Continue down to 1×1 submatrices (individual entries)

Example

Just follow the example matrix as shown in the video here:

https://www.youtube.com/watch?v=-9jSv_F9Hz0&list=PLF-vWhgiaXWPZ7Ogw6zIZMg4aqUXEwrnJ&index=6


Cramer's rule

What is Cramer’s Rule?

https://www.youtube.com/watch?v=vXqlIOX2itM (2x2 matrix)

https://www.youtube.com/watch?v=Ot87qLTODdQ (3x3 matrix)

Cramer’s Rule provides a solution to a system of n linear equations in n variables, where the coefficient matrix is square and has a non-zero determinant.


System:

Ax = b

where


Formula:

For each variable xk :

xk = det(Ak)det(A)

where:


Example

Solve:

2x + y = 5x  3y = 1

Step 1:

Write as Ax = b

A = [2113], x =[xy], b =[51]

Step 2:

Compute the determinant of A

det(A) = 61 = 7

Since det(A)  0, the system has a unique solution


Step 3: Compute the determinants by swapping both the columns of A with b

[5113]det(A1) = 15+1 = 14 [2511]det(A2) = 25 = 7

Step 4: Compute Variables

x = det(A1)det(A) = 147 = 2y = det(A2)det(A) = 77 = 1

When Can You Use Cramer’s Rule?