What is Matrix, Basics, Operations, and Matrix Multiplication Explained.

 

Introduction

Matrices are fundamental concepts in mathematics that have wide-ranging applications in fields such as physics, computer science, and economics. This blog will introduce you to the basics of matrices, their types, and the operations that can be performed on them, including matrix multiplication. Understanding matrices is crucial for solving complex problems and performing linear transformations efficiently.

What is a Matrix?

A matrix is a rectangular array of numbers, symbols, or expressions arranged in rows and columns. The numbers within a matrix are called elements. Matrices are typically denoted by uppercase letters like AA, and each element in a matrix is represented by aija_{ij}, where ii is the row number and jj is the column number.

Some Real-World Applications

  1. Computer Graphics: Matrices are used to perform linear transformations such as rotation, scaling, and translation of images. This is fundamental in rendering graphics in video games and simulations.
  2. Economics: Input-output models in economics use matrices to represent the flow of goods and services in an economy.
  3. Physics and Engineering: Matrices are used to solve systems of linear equations that describe physical phenomena, such as electrical circuits, mechanical systems, and quantum mechanics.

Order of a Matrix

The order of a matrix is given by the number of rows and columns it has. For example, a matrix with mm rows and nn columns is said to be of order m×nm \times n

Types of Matrices

Let's take a closer look at the various types of matrices with examples to deepen our understanding.

  1. Square Matrix: A matrix with the same number of rows and columns.

    • Example 1:
    A=[4572]A = \begin{bmatrix} 4 & 5 \\ 7 & 2 \end{bmatrix}
    • Example 2:
    B=[213456789]B = \begin{bmatrix} 2 & 1 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}
  2. Row Matrix: A matrix that consists of a single row.

    • Example 1:
    C=[638]C = \begin{bmatrix} 6 & 3 & 8 \end{bmatrix}
    • Example 2:
    D=[215]D = \begin{bmatrix} 2 & -1 & 5 \end{bmatrix}
  3. Column Matrix: A matrix that consists of a single column.

    • Example 1:
    E=[715]E = \begin{bmatrix} 7 \\ 1 \\ 5 \end{bmatrix}
    • Example 2:
    F=[423]F = \begin{bmatrix} 4 \\ -2 \\ 3 \end{bmatrix}
  4. Diagonal Matrix: A square matrix in which all elements outside the main diagonal are zero.

    • Example 1:
    G=[900030006]G = \begin{bmatrix} 9 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 6 \end{bmatrix}
    • Example 2:
    H=[4007]H = \begin{bmatrix} 4 & 0 \\ 0 & 7 \end{bmatrix}
  5. Identity Matrix: A diagonal matrix where all diagonal elements are 1.

    • Example 1:
    I2=[1001]I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
    • Example 2:
    I3=[100010001]I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}
  6. Zero Matrix: A matrix in which all elements are zero.

    • Example 1:
    J=[0000]J = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}
    • Example 2:
    K=[000000]K = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}

Basic Operations on Matrices

1. Addition and Subtraction

Matrices can be added or subtracted element-wise, provided they have the same dimensions.

  • Addition Example 1:

    A=[2435],B=[1726]A = \begin{bmatrix} 2 & 4 \\ 3 & 5 \end{bmatrix}, \quad B = \begin{bmatrix} 1 & 7 \\ 2 & 6 \end{bmatrix}
    A+B=[2+14+73+25+6]=[311511]A + B = \begin{bmatrix} 2 + 1 & 4 + 7 \\ 3 + 2 & 5 + 6 \end{bmatrix} = \begin{bmatrix} 3 & 11 \\ 5 & 11 \end{bmatrix}
  • Addition Example 2:

    C=[1042],D=[3528]C = \begin{bmatrix} -1 & 0 \\ 4 & 2 \end{bmatrix}, \quad D = \begin{bmatrix} 3 & 5 \\ -2 & 8 \end{bmatrix}
    C+D=[1+30+5422+8]=[25210]C + D = \begin{bmatrix} -1 + 3 & 0 + 5 \\ 4 - 2 & 2 + 8 \end{bmatrix} = \begin{bmatrix} 2 & 5 \\ 2 & 10 \end{bmatrix}
  • Subtraction Example 1:

    E=[8347],F=[5236]E = \begin{bmatrix} 8 & 3 \\ 4 & 7 \end{bmatrix}, \quad F = \begin{bmatrix} 5 & 2 \\ 3 & 6 \end{bmatrix}
    EF=[85324376]=[3111]E - F = \begin{bmatrix} 8 - 5 & 3 - 2 \\ 4 - 3 & 7 - 6 \end{bmatrix} = \begin{bmatrix} 3 & 1 \\ 1 & 1 \end{bmatrix}
  • Subtraction Example 2:

    G=[7924],H=[4513]G = \begin{bmatrix} 7 & 9 \\ 2 & 4 \end{bmatrix}, \quad H = \begin{bmatrix} 4 & 5 \\ 1 & 3 \end{bmatrix}GH=[74952143]=[3411]G - H = \begin{bmatrix} 7 - 4 & 9 - 5 \\ 2 - 1 & 4 - 3 \end{bmatrix} = \begin{bmatrix} 3 & 4 \\ 1 & 1 \end{bmatrix}

2. Scalar Multiplication

When multiplying a matrix by a scalar, each element in the matrix is multiplied by that scalar (a single number). This operation can be used to scale the matrix.

  • Example 1:

    c=3,A=[2435]c = 3, \quad A = \begin{bmatrix} 2 & 4 \\ 3 & 5 \end{bmatrix}
    3×A=[3×23×43×33×5]=[612915]3 \times A = \begin{bmatrix} 3 \times 2 & 3 \times 4 \\ 3 \times 3 & 3 \times 5 \end{bmatrix} = \begin{bmatrix} 6 & 12 \\ 9 & 15 \end{bmatrix}
  • Example 2:

    d=2,B=[1045]d = -2, \quad B = \begin{bmatrix} -1 & 0 \\ 4 & -5 \end{bmatrix}
    2×B=[2×12×02×42×5]=[20810]-2 \times B = \begin{bmatrix} -2 \times -1 & -2 \times 0 \\ -2 \times 4 & -2 \times -5 \end{bmatrix} = \begin{bmatrix} 2 & 0 \\ -8 & 10 \end{bmatrix}

Matrix Multiplication

Matrix multiplication involves multiplying two matrices to produce a third matrix. Matrix multiplication is an essential operation that enables us to combine linear transformations. It's important to understand that matrix multiplication is not commutative, meaning  AB≠BA in general

Importance of Matrix Multiplication

Matrix multiplication is a powerful tool because it allows us to perform multiple linear transformations in one step. For instance, in computer graphics, matrices are used to rotate, scale, and translate objects in a 2D or 3D space.

How to Multiply Matrices

To find the element in the ii-th row and jj-th column of the product matrix CC:

  1. Multiply the elements of the ii-th row of the first matrix by the corresponding elements of the jj-th column of the second matrix.
  2. Sum all these products.
  • Example 1:
A=[102131],B=[312110]A = \begin{bmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 3 & 1 \\ 2 & 1 \\ 1 & 0 \end{bmatrix}AB=[(1×3+0×2+2×1)(1×1+0×1+2×0)(1×3+3×2+1×1)(1×1+3×1+1×0)]AB = \begin{bmatrix} (1 \times 3 + 0 \times 2 + 2 \times 1) & (1 \times 1 + 0 \times 1 + 2 \times 0) \\ (-1 \times 3 + 3 \times 2 + 1 \times 1) & (-1 \times 1 + 3 \times 1 + 1 \times 0) \end{bmatrix}
AB=[5142]AB = \begin{bmatrix} 5 & 1 \\ 4 & 2 \end{bmatrix}
  • Example 2:
C=[230145],D=[1234]C = \begin{bmatrix} 2 & 3 \\ 0 & 1 \\ 4 & 5 \end{bmatrix}, \quad D = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
CD=[(2×1+3×3)(2×2+3×4)(0×1+1×3)(0×2+1×4)(4×1+5×3)(4×2+5×4)]CD = \begin{bmatrix} (2 \times 1 + 3 \times 3) & (2 \times 2 + 3 \times 4) \\ (0 \times 1 + 1 \times 3) & (0 \times 2 + 1 \times 4) \\ (4 \times 1 + 5 \times 3) & (4 \times 2 + 5 \times 4) \end{bmatrix}
CD=[1116341928]CD = \begin{bmatrix} 11 & 16 \\ 3 & 4 \\ 19 & 28 \end{bmatrix}

Properties of Matrix Multiplication

  1. Non-commutativeABBAAB \neq BA in general.
  2. Associative(AB)C=A(BC)(AB)C = A(BC)
  3. DistributiveA(B+C)=AB+ACA(B + C) = AB + AC

Importance of Matrix Multiplication

Matrix multiplication is a powerful tool because it allows us to perform multiple linear transformations in one step. For instance, in computer graphics, matrices are used to rotate, scale, and translate objects in a 2D or 3D space.

Practice Problems

Here are some problems to help you practice and solidify your understanding of matrices and their operations:

  1. Add the matrices A=[3527]A = \begin{bmatrix} 3 & 5 \\ 2 & 7 \end{bmatrix} and B=[1436]B = \begin{bmatrix} 1 & 4 \\ 3 & 6 \end{bmatrix}.
  2. Subtract the matrix C=[4658]C = \begin{bmatrix} 4 & 6 \\ 5 & 8 \end{bmatrix} from D=[7963]D = \begin{bmatrix} 7 & 9 \\ 6 & 3 \end{bmatrix}.
  3. Multiply the scalar 4 by the matrix E=[2310]E = \begin{bmatrix} 2 & -3 \\ 1 & 0 \end{bmatrix}.
  4. Multiply the scalar -2 by the matrix F=[1205]F = \begin{bmatrix} -1 & 2 \\ 0 & 5 \end{bmatrix}.
  5. Perform matrix multiplication for G=[1324]G = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} and H=[2013]H = \begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix}.
  6. Find the result of I=[2103]I = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} multiplied by J=[1245]J = \begin{bmatrix} 1 & 2 \\ 4 & 5 \end{bmatrix}.
  7. Determine if the matrix multiplication K=[2435]K = \begin{bmatrix} 2 & 4 \\ 3 & 5 \end{bmatrix} and L=[1320]L = \begin{bmatrix} 1 & 3 \\ 2 & 0 \end{bmatrix} is commutative by comparing KLKL and LKLK.
  8. Given matrices M=[3124]M = \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix} and N=[0562]N = \begin{bmatrix} 0 & 5 \\ 6 & 2 \end{bmatrix}, find M+NM + N and MNM - N
  9. Find the product of O=[201354]O = \begin{bmatrix} 2 & 0 & 1 \\ 3 & 5 & 4 \end{bmatrix} and P=[120345]P = \begin{bmatrix} 1 & 2 \\ 0 & 3 \\ 4 & 5 \end{bmatrix}
  10. Determine the identity matrix for a 2×22 \times 2 matrix and multiply it with Q=[7856]Q = \begin{bmatrix} 7 & 8 \\ 5 & 6 \end{bmatrix} to verify if the result is QQ.

Conclusion

Matrices and matrix multiplication form the backbone of linear algebra, offering a systematic way to solve problems in various scientific and engineering fields. By mastering these concepts, students gain the ability to handle complex data and transformations, paving the way for advanced mathematical studies and application