Matrix addition and multiplication

Matrix addition and multiplication

Matrix Addition

  • Matrix addition is performed between two matrices of the same size.
  • Each element in the resulting matrix is the sum of the corresponding elements in the original matrices.
  • If A is a matrix of order m×n and B is also a matrix of order m×n, then their sum A+B is a matrix of order m×n, where each element is the sum of the corresponding elements in matrices A and B.
  • Matrix addition is both commutative and associative meaning, A + B = B + A and A + (B + C) = (A + B) + C.

Matrix Subtraction

  • Matrix subtraction also requires two matrices of the same size.
  • Each element in the resulting matrix is the difference between the corresponding elements in the original matrices.
  • If A and B are matrices of the same order m×n, then their difference A-B is a matrix of order m×n, where each element is the difference between the corresponding elements in matrices A and B.

Matrix Multiplication

  • Matrix multiplication, unlike addition and subtraction, does not require the matrices to be of the same size but the number of columns in the first matrix must be the same as the number of rows in the second.
  • The value of an element in the product matrix is the dot product of the corresponding row in the first matrix and column in the second.
  • Matrix multiplication is not commutative, meaning A × B ≠ B × A.
  • Matrix multiplication is associative, (AB)C = A(BC), and also distributive over addition, A(B + C) = AB + AC and (B + C)A = BA + CA.

Scalar Multiplication

  • Scalar multiplication involves multiplying a matrix by a number, known as a scalar.
  • Every element in the matrix is multiplied by this scalar value.
  • Scalar multiplication is both commutative and associative. For a scalar k, if k(AB) = (kA)B = A(kB) and k(mA) = (km)A where m is another scalar and A and B are matrices.