Size Compatibility: You can only add matrices that have the same dimensions, meaning they must have the same number of rows and the same number of columns.
Element-wise Operation: To add two matrices together, you simply add the corresponding elements (the elements that occupy the same position) in each matrix.
Matrix Subtraction
Size Compatibility: You can only subtract matrices that have the same dimensions, just like with addition.
Element-wise Operation: To subtract one matrix from another, you subtract the corresponding elements in each matrix.
Matrix Multiplication
Size Compatibility: In matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix for the multiplication to be defined. In other words, if you have two matrices, A and B, where A has dimensions m x n (m rows and n columns) and B has dimensions n x p (n rows and p columns), then you can multiply them.
Element-wise Calculation: To calculate the result of matrix multiplication, you take the dot product of rows from the first matrix with columns from the second matrix. Here's how it works:
Take the first row of the first matrix (let's call it A) and multiply it element by element with the first column of the second matrix (let's call it B). Add up these products to get the first element in the result matrix.
Repeat this process for each row of the first matrix and each column of the second matrix to fill in the elements of the result matrix.
To calculate the product AB, you would do the following:
First element (first row of A * first column of B):
Second element (first row of A * second column of B):
Third element (second row of A * first column of B):
Fourth element (second row of A * second column of B):
In essence, matrix multiplication involves multiplying and summing elements in a systematic way, and the resulting matrix has dimensions that depend on the original matrices' dimensions
Matrix Inversion
Square Matrix: Matrix inversion only applies to square matrices, which have the same number of rows and columns. For example, a 2x2, 3x3, or 4x4 square matrix can be inverted, but a non-square matrix like a 2x3 or 3x2 cannot.
Determinant: To find the inverse of a square matrix, you first need to calculate its determinant. The determinant is a single number that summarizes certain properties of the matrix. If the determinant is zero, the matrix doesn't have an inverse. If it's not zero, you can proceed to find the inverse.
Multiplicative Property: Once you have the inverse matrix, you can use it to "undo" the effects of the original matrix when multiplying. When you multiply a matrix by its inverse, you get the identity matrix.
Matrix Identity
Square Matrix: An identity matrix is always a square matrix, meaning it has the same number of rows and columns. For example, a 2x2 identity matrix has 2 rows and 2 columns, a 3x3 identity matrix has 3 rows and 3 columns, and so on.
Diagonal Ones: In an identity matrix, all the elements along the main diagonal (from the top left to the bottom right) are set to "1."
Off-diagonal Zeros: All the elements outside the main diagonal are set to "0."