Maths Formulae Matrices Addition And Substraction Of Matrices

Addition and Subtraction of Matrices – Element-wise Operation

Learn how to add and subtract matrices using element-wise operations. Includes rules, examples, and applications.
🔑

Definition

Matrix addition and subtraction are element-wise operations. This means that to add or subtract two matrices, you add or subtract their corresponding elements. A critical prerequisite for these operations is that both matrices must have the exact same dimensions (the same number of rows and columns).

SymbolDescription
\[ A \]First Matrix - An input matrix with dimensions m × n.
\[ B \]Second Matrix - An input matrix with the same dimensions m × n as A.
\[ C, D \]Result Matrix - The output matrix from addition (C = A + B) or subtraction (D = A - B).
\[ m, n \]Dimensions - The number of rows (m) and columns (n) in the matrices.
\[ i, j \]Indices - The row index (i) and column index (j) that specify an element's position.
\[ A_{ij} \]Matrix Element - The individual entry at row i and column j in matrix A.
\[ O \]Zero Matrix - A matrix where all elements are zero, acting as the additive identity.
\[ -A \]Negative Matrix - A matrix where each element is the negated value of the corresponding element in A.
🔢

Key Formulas

\[ A \pm B = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \pm \begin{pmatrix} x & y \\ z & u \end{pmatrix} = \begin{pmatrix} a \pm x & b \pm y \\ c \pm z & d \pm u \end{pmatrix} \]
General Formula for Addition & Subtraction
\[ C_{ij} = A_{ij} + B_{ij} \quad \text{for all } i,j \]
Element-wise Addition
\[ \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} + \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} = \begin{bmatrix} a_{11}+b_{11} & a_{12}+b_{12} \\ a_{21}+b_{21} & a_{22}+b_{22} \end{bmatrix} \]
Example of 2x2 Matrix Addition
\[ D_{ij} = A_{ij} - B_{ij} \quad \text{for all } i,j \]
Element-wise Subtraction
\[ \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} - \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} = \begin{bmatrix} a_{11}-b_{11} & a_{12}-b_{12} \\ a_{21}-b_{21} & a_{22}-b_{22} \end{bmatrix} \]
Example of 2x2 Matrix Subtraction
📐

Conceptual Diagram

A 1 2 3 4 + B 5 6 7 8 = A + B 6 8 10 12 (A + B)[i][j] = A[i][j] + B[i][j] — element by element
Matrix Addition: corresponding elements are added. Both matrices must have the same dimensions.

Matrix addition and subtraction involve two matrices, A and B, of the same dimensions (m rows and n columns). The resulting matrix, C (for addition) or D (for subtraction), also has dimensions m x n. The operation is performed on corresponding elements \(A_{ij}\) and \(B_{ij}\) to produce the result \(C_{ij}\) or \(D_{ij}\).

⚖️

Properties

Matrix addition shares many properties with the addition of real numbers, such as commutativity and associativity. Subtraction, however, is not commutative.

\[ A + B = B + A \]
Commutative Property of Addition
\[ (A + B) + C = A + (B + C) \]
Associative Property of Addition
\[ A + O = A \]
Additive Identity Property (Zero Matrix)
\[ A + (-A) = O \]
Additive Inverse Property
\[ A - B \neq B - A \quad \text{(unless A=B)} \]
Non-Commutative Property of Subtraction
\[ \text{Dimensions must match: } A_{m \times n} \pm B_{p \times q} \text{ only if } m=p \text{ and } n=q \]
Dimensional Compatibility Requirement
🔬

Proof of Commutative Property

The properties of matrix addition are derived directly from the properties of the numbers (e.g., real or complex numbers) that constitute the matrix elements. The proof relies on the element-wise definition of the operation. Let's prove the commutative property of addition, \(A + B = B + A\).

Step 1: Start with the definition of matrix addition for an arbitrary element at position (i, j) of the sum \((A + B)\).

\[ (A + B)_{ij} = A_{ij} + B_{ij} \]
Definition of Matrix Addition

Step 2: Since \(A_{ij}\) and \(B_{ij}\) are numbers, their addition is commutative.

\[ A_{ij} + B_{ij} = B_{ij} + A_{ij} \]
Commutative Property of Number Addition

Step 3: By the definition of matrix addition, \(B_{ij} + A_{ij}\) is the element at position (i, j) of the matrix sum \((B + A)\).

\[ B_{ij} + A_{ij} = (B + A)_{ij} \]
Definition of Matrix Addition

Conclusion: Since \((A + B)_{ij} = (B + A)_{ij}\) for all elements i and j, the matrices are equal. Therefore, \(A + B = B + A\).

✍️

Worked Example

Given matrices \( A = \begin{bmatrix} 8 & 3 \\ 5 & 1 \end{bmatrix} \) and \( B = \begin{bmatrix} 2 & 7 \\ 4 & 9 \end{bmatrix} \), find \( A + B \) and \( A - B \).
  1. To find \(A + B\), add the corresponding elements of A and B.
    \[ A + B = \begin{bmatrix} 8+2 & 3+7 \\ 5+4 & 1+9 \end{bmatrix} = \begin{bmatrix} 10 & 10 \\ 9 & 10 \end{bmatrix} \]
  2. To find \(A - B\), subtract the corresponding elements of B from A.
    \[ A - B = \begin{bmatrix} 8-2 & 3-7 \\ 5-4 & 1-9 \end{bmatrix} = \begin{bmatrix} 6 & -4 \\ 1 & -8 \end{bmatrix} \]
\[ A+B = \begin{bmatrix} 10 & 10 \\ 9 & 10 \end{bmatrix}, \quad A-B = \begin{bmatrix} 6 & -4 \\ 1 & -8 \end{bmatrix} \]
🚀

Applications

Digital Image Processing: Images can be represented as matrices of pixel values. Adding or subtracting matrices can adjust brightness, contrast, or blend images together. For example, adding a constant matrix brightens an image, while subtracting one matrix from another can detect changes between two frames in a video.

Financial Modeling: Financial data, such as sales figures for different products across various regions, can be organized into matrices. To get total sales, matrices from different time periods (e.g., Quarter 1 and Quarter 2) can be added together. Subtracting matrices can show the change in performance over time.

Computer Graphics and Game Development: In 3D graphics, the positions of vertices in a model are stored in matrices. Translating an object (moving it without rotation) is achieved by adding a translation matrix to the vertex position matrix.

Engineering and Physics: Matrices are used to solve systems of linear equations that model physical phenomena, such as forces in a structure or currents in an electrical circuit. Matrix addition and subtraction are intermediate steps in more complex matrix manipulations like Gaussian elimination.

🌍

Real-World Examples

A company tracks the inventory of three products (A, B, C) at two different warehouses. The inventory for Warehouse 1 is given by the matrix \(W_1 = \begin{bmatrix} 150 & 200 & 75 \end{bmatrix}\). Warehouse 2 has inventory \(W_2 = \begin{bmatrix} 100 & 180 & 120 \end{bmatrix}\). What is the total inventory of all products across both warehouses?
  1. To find the total inventory, add the inventory matrix of Warehouse 1 to that of Warehouse 2.
    \[ \text{Total} = W_1 + W_2 = \begin{bmatrix} 150 & 200 & 75 \end{bmatrix} + \begin{bmatrix} 100 & 180 & 120 \end{bmatrix} \]
  2. Perform the element-wise addition.
    \[ \text{Total} = \begin{bmatrix} 150+100 & 200+180 & 75+120 \end{bmatrix} = \begin{bmatrix} 250 & 380 & 195 \end{bmatrix} \]
The total inventory is 250 units of product A, 380 units of product B, and 195 units of product C.
A simple 2x2 grayscale image has pixel brightness values (0-255) represented by matrix \( P = \begin{bmatrix} 120 & 80 \\ 200 & 210 \end{bmatrix} \). To increase the overall brightness of the image, an editor adds 50 to each pixel value. Represent this operation using matrices and find the new pixel matrix.
  1. The brightness increase can be represented by a 2x2 matrix where every element is 50: \( B = \begin{bmatrix} 50 & 50 \\ 50 & 50 \end{bmatrix} \).
  2. Add the brightness matrix B to the original pixel matrix P to get the new image matrix \( P' \).
    \[ P' = P + B = \begin{bmatrix} 120 & 80 \\ 200 & 210 \end{bmatrix} + \begin{bmatrix} 50 & 50 \\ 50 & 50 \end{bmatrix} \]
  3. Calculate the sum.
    \[ P' = \begin{bmatrix} 120+50 & 80+50 \\ 200+50 & 210+50 \end{bmatrix} = \begin{bmatrix} 170 & 130 \\ 250 & 255 \end{bmatrix} \]
The new matrix of pixel values is \( P' = \begin{bmatrix} 170 & 130 \\ 250 & 255 \end{bmatrix} \).
🏙️

Real-World Scenarios

Dept Budget (£k) Dept A 12 15 18 20 + Dept B 8 10 14 12 Total = A + B 20 25 32 32
Budget Planning
Two department budget matrices (rows = quarters, cols = categories) are added element-by-element to get the combined company budget — a direct application of matrix addition.
Photo Compositing Layer A + Layer B pixel_out = A + B (clamp 255) Photoshop blending modes
Photo Compositing
Blending two image layers is matrix addition — corresponding RGB pixel values are summed element-by-element (and clamped to 0–255). CSS mix-blend-mode and Photoshop layers use this.
Force Addition F₁ F₂ Fᵣ [3, −2] + [2, 4] = [5, 2]
Physics — Force Vectors
Adding multiple forces in 2D or 3D physics is component-wise matrix addition. The resultant force vector equals the sum of all force row-matrices — used in structural and mechanical engineering.

Spreadsheet Operations: When you have two identical tables in a spreadsheet and you create a third table by adding or subtracting the values from the first two cell by cell, you are performing matrix addition or subtraction. This is common for comparing monthly budgets or sales data.

Image Layering: In graphic design software like Photoshop, images are composed of layers. When you blend two layers using an 'Add' or 'Subtract' mode, the software is performing matrix operations on the pixel values of the layers to create the final composite image.

Population Demographics: Sociologists can use matrices to represent population data (e.g., by age group and region). Subtracting the matrix from one decade from the matrix of the next decade reveals population shifts, showing growth or decline in specific demographics.

🗂️

Types and Classifications

Matrix addition and subtraction are not classified into different types. Instead, their applicability is strictly classified by dimensional compatibility. The operations are only defined for matrices of the exact same size.

Matrix A DimensionsMatrix B DimensionsAddition/Subtraction Possible?
m x nm x nYes
2 x 32 x 3Yes, dimensions match.
3 x 33 x 2No, number of columns differ.
2 x 43 x 4No, number of rows differ.
⚠️

Common Mistakes

⚠️ The most frequent error is attempting to add or subtract matrices with different dimensions. For example, a 2x3 matrix cannot be added to a 3x2 matrix. The operation is undefined. Always check that the number of rows and columns match before proceeding!
💡 Ensure you are adding or subtracting the correct corresponding elements. It's easy to misalign rows or columns, especially with larger matrices. A good practice is to trace the position with your finger, e.g., the element in row 1, column 1 of matrix A is combined only with the element in row 1, column 1 of matrix B.
💡 Do not confuse matrix addition with matrix multiplication. Addition is a simple, element-wise operation. Multiplication involves a more complex row-by-column dot product and has entirely different rules and properties.
🚀

Study Strategy

1 🔍 Grasp the Fundamentals
  • Review the definition of a matrix, focusing on its dimensions (m x n, rows by columns).
  • Confirm you understand the core condition: matrices must have identical dimensions to be added or subtracted.
  • Study the special roles of the zero matrix (additive identity) and the negative of a matrix (additive inverse).
  • Read through the Commutative and Associative properties to understand the rules governing matrix addition.
2 🧠 Internalize the Operations
  • Memorize the element-wise procedure: C = A + B means c_ij = a_ij + b_ij.
  • Internalize the subtraction rule: D = A - B means d_ij = a_ij - b_ij.
  • Verbally explain how to add two 2x3 matrices to solidify the process in your mind.
  • Practice recalling the properties, such as A + B = B + A, without looking at the formula page.
3 ✍️ Solidify with Practice
  • Follow the provided 'Worked Example' step-by-step, recalculating each entry yourself.
  • Create your own simple 2x2 matrices and perform addition and subtraction, checking your work.
  • Pay close attention to the 'Common Mistakes' section, especially regarding sign errors during subtraction.
  • Work through problems involving scalar multiplication combined with addition, like finding 2A - B.
4 🌍 Connect to the Real World
  • Analyze the 'Real-World Examples' like inventory tracking or sales data comparison.
  • Translate a simple scenario into matrices, such as tracking points for two sports teams over several games.
  • Find the net change between two data sets by setting them up as matrices and performing subtraction.
  • Explore how adding a 'translation matrix' is used in computer graphics to move an object on a screen.
By methodically understanding, memorizing, practicing, and applying, you will build a solid foundation for all matrix operations.

Frequently Asked Questions

×

×