Skip to content
Back to exploration
Algebra · English

Defined and undefined matrix operations | Matrices | Precalculus | Khan Academy

Three worked dimension checks distinguish matrix addition from multiplication and show why reversing multiplication order can change whether a product exists.

Reviewed learning material · Video analysis · English

Three exercises distinguish the dimension tests for matrix operations. A 3-by-3 matrix cannot multiply a 2-by-2 matrix in that order, whereas two 2-by-1 column vectors can be added entry by entry. Finally, A is 2-by-2 and E is 1-by-2: AE is undefined, but EA is defined. The examples show why full shapes matter for addition and ordered inner dimensions matter for multiplication. The letter B is reused for different matrices in separate exercises.

Before you watch

  • Basic understanding of matrices
  • Knowing how to determine the dimensions (rows and columns) of a matrix
  • Basic understanding of matrix notation (rows and columns)
  • Concept of matrix dimensions (m x n)

Chapters

0:00Is DB defined?1:18Is C+B defined?1:46Matrix Addition Example1:57Matrix Multiplication Condition2:51Order Matters in Multiplication

Learning script

Generated from the video's visuals and explanation; not verbatim speech.

The video begins by presenting a problem asking whether the matrix product DB is defined, where D is a 3x3 matrix and B is a 2x2 matrix.

To solve this, the presenter copies the problem to a digital scratchpad to analyze the dimensions more clearly.

He writes down the dimensions of matrix D as 3x3 and matrix B as 2x2. He explains that for matrix multiplication to be defined, the inner dimensions must match. Here, the number of columns in D (3) must equal the number of rows in B (2).

The inner counts are unequal, so the first product cannot be formed. The presenter submits the negative answer, which is accepted by the exercise interface.

The video then moves to a second problem asking whether the matrix sum C+B is defined, where C and B are both 2x1 matrices (column vectors).

The presenter explains that for matrix addition to be defined, both matrices must have the exact same dimensions. Since both C and B are 2x1, their dimensions match perfectly.

Corresponding entries in the two column vectors can be added, such as 4+0 and -2+0. The full lesson continues by confirming this exercise and moving to another multiplication task.

The lesson finishes the addition example: C and B both have two rows and one column, so their sum is defined. Here B denotes the zero column vector, rather than the two-by-two matrix in the first exercise.

Next, we examine matrix multiplication. We are asked if the product AE is defined. Matrix A is a 2x2 square matrix, and Matrix E is a 1x2 row vector. For a matrix product to be defined, the number of columns in the first matrix must equal the number of rows in the second matrix. Here, A has 2 columns, but E has only 1 row. Since 2 does not equal 1, the product AE is undefined.

However, matrix multiplication is sensitive to order. Let's check the reverse product, EA. Now, E is the first matrix (1x2) and A is the second (2x2). The number of columns in E is 2, and the number of rows in A is 2. Since these inner dimensions match, the product EA is defined. This highlights that unlike addition, the order of operands in multiplication determines whether the operation is possible.

Knowledge cards

01

Matrices

For the ordinary row-by-column product of real matrices, the first matrix’s column count must equal the second matrix’s row count. An m-by-n matrix can multiply an n-by-p matrix, giving an m-by-p result. The result-size statement is an editorial clarification of the standard rule.

(m×n)⋅(n×p)(m \times n) \cdot (n \times p)
02

Condition for Matrix Addition

Matrix addition is defined if and only if both matrices have the exact same dimensions. This means they must have the same number of rows and the same number of columns.

(m×n)+(m×n)(m \times n) + (m \times n)
03

Example: Undefined Matrix Multiplication

Multiplying a 3x3 matrix by a 2x2 matrix is undefined. The inner dimensions are 3 and 2, which are not equal. Therefore, the operation cannot be performed.

04

Example: Defined Matrix Addition

Adding two 2x1 matrices is defined. Both matrices have the exact same dimensions (2 rows and 1 column), so their corresponding elements can be added together.

05

Matrix Addition Rule

Two matrices can be added if and only if they have the exact same dimensions (same number of rows and same number of columns).

Am×n+Bm×nA_{m \times n} + B_{m \times n}
06

Matrix Multiplication Rule

The product of two matrices AB is defined if and only if the number of columns in A equals the number of rows in B.

Am×n×Bn×p=Cm×pA_{m \times n} \times B_{n \times p} = C_{m \times p}
07

Order matters for definedness

Here AE is undefined because its inner dimensions are 2 and 1, whereas EA is defined because they are 2 and 2. The displayed formula compares dimension counts, not product values. Matrix multiplication is not commutative in general, but some pairs commute; this lesson illustrates existence, without computing unequal products.

AE:2≠1,EA:2=2AE:\quad 2\ne1,\qquad EA:\quad2=2

Detailed learning notes

Explore conditions, steps and evidence. Supplementary explanations are labeled separately from content shown in the video.

Symbols · 8

D

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    D = [[2, 4, 4], [3, -1, 0], [2, 4, 3]]

Symbol

D

Meaning

A 3x3 matrix given in the first problem.

Domain

3x3 matrix

B

Clear evidence
Supplementary explanation
Evidence
  1. Formula
    Observation

    B = [[4, 1], [4, 4]]

Symbol

B

Meaning

The two-by-two B in the first exercise; the next exercise independently reuses B for a different column vector.

Domain

2x2 matrix

C

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    C = [[4], [-2]]

Symbol

C

Meaning

A 2x1 matrix or column vector given in the second problem.

Domain

2x1 matrix

B

Clear evidence
Supplementary explanation
Evidence
  1. Formula
    Observation

    B = [[0], [0]]

Symbol

B

Meaning

The 2-by-1 zero column vector in the second exercise, distinct from the first exercise’s B.

Domain

2x1 matrix

C

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Matrix C is displayed as a 2x1 column vector with entries 4 and -2.

Symbol

C

Meaning

A 2x1 matrix.

Domain

Matrices over real numbers.

B

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Matrix B is displayed as a 2x1 column vector with entries 0 and 0.

Symbol

B

Meaning

A 2x1 zero matrix.

Domain

Matrices over real numbers.

A

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Matrix A is displayed as a 2x2 matrix with entries [[1, 3], [-1, 3]].

Symbol

A

Meaning

A 2x2 matrix.

Domain

Matrices over real numbers.

E

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Matrix E is displayed as a 1x2 row vector with entries [-1, 2].

Symbol

E

Meaning

A 1x2 matrix (row vector).

Domain

Matrices over real numbers.

Knowledge points · 5

Condition for Matrix Multiplication to be Defined

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The presenter compares columns of the first matrix with rows of the second.

Definition
Explanation

For the ordinary row-by-column product of real matrices, the first matrix’s column count must equal the second matrix’s row count. An m-by-n matrix can multiply an n-by-p matrix, giving an m-by-p result. The result-size statement is an editorial clarification of the standard rule.

Formula
(m×n)⋅(n×p)(m \times n) \cdot (n \times p)
Conditions
  1. The inner dimensions must match.

  2. The stated rule concerns the usual matrix product in the displayed order.

Condition for Matrix Addition to be Defined

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The presenter requires the same row and column counts for addition.

Definition
Explanation

Matrix addition is defined if and only if both matrices have the exact same dimensions.

Formula
(m×n)+(m×n)(m \times n) + (m \times n)
Conditions
  1. Both matrices must have the same number of rows and columns.

Condition for Matrix Addition to be Defined

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The continuation confirms that the two column vectors can be added because their shapes match.

  2. Diagram
    Observation

    Matrices C and B are both shown as 2x1 column vectors.

  3. Formula
    Observation

    The general letter-indexed formula is an editorial expression of the rule; the source checks concrete dimensions.

Definition
Explanation

Matrix addition is defined if and only if the two matrices have the exact same dimensions (same number of rows and same number of columns). In this example, C and B are both 2x1 matrices, so C + B is defined.

Formula
Xm×n+Ym×n=Zm×nX_{m\times n}+Y_{m\times n}=Z_{m\times n}
Conditions
  1. Both matrices must have the same number of rows.

  2. Both matrices must have the same number of columns.

Condition for Matrix Multiplication to be Defined

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The presenter compares the two columns of A with the single row of E and rejects AE.

  2. Animation
    Observation

    The dimensions '2x2' and '1x2' are written below A and E respectively, and the inner dimensions (2 and 1) are circled and compared.

  3. Formula
    Observation

    The general letter-indexed formula is an editorial expression of the rule; the source checks concrete dimensions.

Definition
Explanation

Matrix multiplication AB is defined if and only if the number of columns in the first matrix (A) equals the number of rows in the second matrix (B). If A is m x n and B is p x q, then n must equal p.

Formula
Xm×nYp×qdefined iff n=pX_{m\times n}Y_{p\times q}\quad\text{defined iff }n=p
Conditions
  1. The inner dimensions of the two matrices must match.

Order matters for definedness

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    Reversing the order changes the inner counts to two and two, making EA possible.

  2. Animation
    Observation

    The expression EA is written, with dimensions 1x2 and 2x2 below them. The inner dimensions (2 and 2) are circled and shown to match.

  3. Formula
    Observation

    The symbolic shorthand records the actual circled inner counts in AE and EA.

Method
Explanation

Here AE is undefined because its inner dimensions are 2 and 1, whereas EA is defined because they are 2 and 2. The displayed formula compares dimension counts, not product values. Matrix multiplication is not commutative in general, but some pairs commute; this lesson illustrates existence, without computing unequal products.

Formula
AE:2≠1,EA:2=2AE:\quad 2\ne1,\qquad EA:\quad2=2
Conditions
  1. Applies when checking if a product exists based on dimension compatibility.

Prerequisites
  1. Condition for Matrix Multiplication to be Defined
Derivations and proofs · 2

Derivation showing DB is not defined

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The first multiplication problem has unequal inner dimensions, so the presenter rejects it.

  2. Animation
    Observation

    Handwritten 'D' with '3x3' below it, and 'B' with '2x2' below it. The inner numbers '3' and '2' are circled.

Intuitive argument
Steps
  1. Explanation

    Identify the dimensions of matrix D as 3x3.

    Justification

    Visual inspection of the matrix.

    Shown in the video
  2. Explanation

    Identify the dimensions of matrix B as 2x2.

    Justification

    Visual inspection of the matrix.

    Shown in the video
  3. Explanation

    Compare the inner dimensions: 3 (columns of D) and 2 (rows of B).

    Justification

    Rule for matrix multiplication definition.

    Shown in the video
  4. Explanation

    Since 3 does not equal 2, the product DB is not defined.

    Justification

    Condition for matrix multiplication is not met.

    Shown in the video
Conclusion

The product DB is not defined.

Derivation showing C+B is defined

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Both column vectors have matching shape, so the presenter accepts their sum.

  2. Animation
    Observation

    Handwritten 'C' with '2x1' below it, and 'B' with '2x1' below it.

Uncertainties
  1. This first interval ends during the second exercise; its completed submission is in the continuation of the full video.

Intuitive argument
Steps
  1. Explanation

    Identify the dimensions of matrix C as 2x1.

    Justification

    Visual inspection of the matrix.

    Shown in the video
  2. Explanation

    Identify the dimensions of matrix B as 2x1.

    Justification

    Visual inspection of the matrix.

    Shown in the video
  3. Explanation

    Compare the dimensions of C and B.

    Justification

    Rule for matrix addition definition.

    Shown in the video
  4. Explanation

    Since both are 2x1, they have the exact same dimensions, so C+B is defined.

    Justification

    Condition for matrix addition is met.

    Shown in the video
Conclusion

The sum C+B is defined.

Worked examples · 5

Example: Is DB defined?

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    D = [[2, 4, 4], [3, -1, 0], [2, 4, 3]], B = [[4, 1], [4, 4]]. Is DB defined?

  2. Audio
    Observation

    The first task asks whether the displayed product is defined.

Problem

Given matrices D and B, determine if the product DB is defined.

Given
  1. D is a 3x3 matrix

  2. B is a 2x2 matrix

Goal

Determine if the matrix multiplication DB is defined.

Steps
  1. Explanation

    Check the inner dimensions of the matrices for multiplication.

    Justification

    Definition of matrix multiplication.

    Shown in the video
  2. Explanation

    The number of columns in D is 3, and the number of rows in B is 2.

    Justification

    Visual inspection of the matrices.

    Shown in the video
  3. Explanation

    Since 3 != 2, the multiplication is not defined.

    Justification

    Condition for matrix multiplication is not met.

    Shown in the video
Answer

No, DB is not defined.

Verification

The presenter chooses the negative answer and submits it; the exercise interface accepts it.

Example: Is C+B defined?

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    C = [[4], [-2]], B = [[0], [0]]. Is C + B defined?

  2. Audio
    Observation

    The second task asks whether the displayed sum is defined.

Uncertainties
  1. This first interval ends during the second exercise; its completed submission is in the continuation of the full video.

Problem

Given matrices C and B, determine if the sum C+B is defined.

Given
  1. C is a 2x1 matrix

  2. B is a 2x1 matrix

Goal

Determine if the matrix addition C+B is defined.

Steps
  1. Explanation

    Check if the matrices have the exact same dimensions.

    Justification

    Definition of matrix addition.

    Shown in the video
  2. Explanation

    Both C and B are 2x1 matrices.

    Justification

    Visual inspection of the matrices.

    Shown in the video
  3. Explanation

    Since they have the same dimensions, the addition is defined.

    Justification

    Condition for matrix addition is met.

    Shown in the video
Answer

Yes, C+B is defined.

Verification

The matching-shape argument is given and the affirmative answer is selected; the continuation completes this exercise.

Checking if C + B is defined

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Problem asks 'Is C + B defined?' where C=[[4],[-2]] and B=[[0],[0]].

  2. Audio
    Observation

    The two matching column vectors satisfy the addition rule.

Problem

Given C = [[4], [-2]] and B = [[0], [0]], determine if C + B is defined.

Given
  1. C is a 2x1 matrix.

  2. B is a 2x1 matrix.

Goal

Determine if the sum C + B exists.

Steps
  1. Explanation

    Identify the dimensions of matrix C.

    Justification

    Visual inspection shows 2 rows and 1 column.

    Shown in the video
  2. Explanation

    Identify the dimensions of matrix B.

    Justification

    Visual inspection shows 2 rows and 1 column.

    Shown in the video
  3. Explanation

    Compare dimensions.

    Justification

    Both are 2x1, so they match.

    Derived from the video
Answer

Yes, C + B is defined.

Verification

Dimensions match exactly.

Checking if AE is defined

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Problem asks 'Is AE defined?' where A=[[1,3],[-1,3]] and E=[[-1,2]].

  2. Audio
    Observation

    The displayed product fails the inner-dimension test.

Problem

Given A = [[1, 3], [-1, 3]] and E = [[-1, 2]], determine if the product AE is defined.

Given
  1. A is a 2x2 matrix.

  2. E is a 1x2 matrix.

Goal

Determine if the product AE exists.

Steps
  1. Explanation

    Identify dimensions of A: 2 rows, 2 columns.

    Justification

    Visual inspection.

    Shown in the video
  2. Explanation

    Identify dimensions of E: 1 row, 2 columns.

    Justification

    Visual inspection.

    Shown in the video
  3. Explanation

    Check condition for multiplication: Columns of A must equal Rows of E.

    Justification

    Definition of matrix multiplication.

    Derived from the video
  4. Explanation

    Compare 2 (cols of A) and 1 (rows of E). They are not equal.

    Justification

    Arithmetic comparison.

    Derived from the video
Answer

No, AE is not defined.

Verification

Inner dimensions do not match (2 != 1).

Checking the reversed product EA

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    Speaker writes EA and checks dimensions.

  2. Audio
    Observation

    The reversed product passes the inner-dimension test.

Problem

Using the same matrices A and E, determine if the reverse product EA is defined.

Given
  1. E is a 1x2 matrix.

  2. A is a 2x2 matrix.

Goal

Determine if the product EA exists.

Steps
  1. Explanation

    Identify dimensions of E: 1 row, 2 columns.

    Justification

    Visual inspection.

    Shown in the video
  2. Explanation

    Identify dimensions of A: 2 rows, 2 columns.

    Justification

    Visual inspection.

    Shown in the video
  3. Explanation

    Check condition: Columns of E (2) must equal Rows of A (2).

    Justification

    Definition of matrix multiplication.

    Derived from the video
  4. Explanation

    Compare 2 and 2. They are equal.

    Justification

    Arithmetic comparison.

    Derived from the video
Answer

Yes, EA would be defined.

Verification

Inner dimensions match (2 == 2).

Visual events · 5

Using Snipping Tool

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    The presenter uses the Snipping Tool to copy the problem from the webpage and paste it into a scratchpad application.

Objects
  1. Webpage

  2. Snipping Tool

  3. Scratchpad

Changes
  1. Problem is copied from webpage to scratchpad

Invariants
  1. The mathematical content of the problem remains unchanged

Interpretation

This visual event shows the presenter's workflow for solving the problem on a separate digital whiteboard.

Annotating Matrix Dimensions

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    The presenter writes 'D' and '3x3', then 'B' and '2x2'. He circles the inner numbers '3' and '2' to highlight them for comparison.

Objects
  1. Matrices D and B

  2. Handwritten annotations

Changes
  1. Dimensions are written below the matrices

  2. Inner dimensions are circled

Invariants
  1. The original matrices remain visible

Interpretation

This visual event emphasizes the key rule for matrix multiplication by isolating and comparing the relevant dimensions.

Annotating Matrix Dimensions for Addition

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    The presenter writes 'C' and '2x1', then 'B' and '2x1'.

Objects
  1. Matrices C and B

  2. Handwritten annotations

Changes
  1. Dimensions are written below the matrices

Invariants
  1. The original matrices remain visible

Interpretation

This visual event sets up the comparison of dimensions required to determine if matrix addition is defined.

Writing and circling matrix dimensions

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    Handwritten text appears below matrices A and E showing their dimensions '2x2' and '1x2', followed by circles around the inner numbers.

Objects
  1. Matrix A

  2. Matrix E

  3. Handwritten dimensions

Changes
  1. Dimensions are written below matrices.

  2. Inner dimensions are circled to highlight the comparison.

Invariants
  1. The matrices themselves remain unchanged.

Interpretation

This visual aid demonstrates the rule that the inner dimensions must match for multiplication to be defined.

Demonstrating reverse multiplication order

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    The expression 'EA' is written next to 'AE', with dimensions '1x2' and '2x2' below them, and matching inner dimensions circled.

Objects
  1. Expression EA

  2. Handwritten dimensions

Changes
  1. New expression EA is formed.

  2. Dimensions are swapped relative to the previous example.

Invariants
  1. Matrices A and E are the same objects as before.

Interpretation

Shows that changing the order changes which dimensions are 'inner', potentially making an undefined product defined.

Misconceptions · 2

Confusing conditions for matrix multiplication and addition

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    The presenter distinguishes matching inner dimensions for multiplication from matching full shapes for addition.

Misconception

Students might think the same dimensional rule applies to both matrix multiplication and addition.

Clarification

Matrix multiplication requires only the inner dimensions to match (columns of first = rows of second), while matrix addition requires all dimensions to be exactly the same.

Assuming matrix multiplication is commutative

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The presenter uses the same matrices in opposite orders to distinguish whether their products exist.

Misconception

Students often assume that if AB is undefined, BA is also undefined, or that AB = BA.

Clarification

Reversing order can change whether a product exists: AE is undefined while EA is defined here. This does not compare their values, since an undefined product has no value. More generally multiplication is not commutative, although particular pairs can commute.

Concept relations · 3

Condition for Matrix Multiplication to be Defined → Condition for Matrix Addition to be Defined

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    A multiplication task is followed by an addition task using their different dimension tests.

Contrast
Explanation

The conditions for a matrix operation to be defined differ fundamentally between multiplication and addition.

Condition for Matrix Addition to be Defined → Condition for Matrix Multiplication to be Defined

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The lesson contrasts full-shape matching for addition with inner-dimension matching for multiplication.

Contrast
Explanation

For matrices of sizes m by n and p by q, addition requires m=p and n=q; the ordinary product in that order requires n=p. These general letters clarify the different tests illustrated in the lesson.

Condition for Matrix Multiplication to be Defined → Order matters for definedness

Clear evidence
Derived from the video
Evidence
  1. Animation
    Observation

    Comparison of AE and EA side-by-side.

Application
Explanation

The definition of matrix multiplication directly leads to the conclusion that order matters for definedness.

Find an answer · 5

How to determine if the product of a 3x3 matrix and a 2x2 matrix is defined?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The first task concerns the compatibility of the matrix product.

Knowledge points
  1. Condition for Matrix Multiplication to be Defined
  2. Example: Is DB defined?

How to determine if the sum of two 2x1 matrices is defined?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The second task concerns the compatibility of the matrix sum.

Knowledge points
  1. Condition for Matrix Addition to be Defined
  2. Example: Is C+B defined?

What are the dimension requirements for adding two matrices?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    The continuation explains addition of two matching column vectors.

Knowledge points
  1. Condition for Matrix Addition to be Defined

How do I check if a matrix product is defined using dimensions?

Clear evidence
Derived from the video
Evidence
  1. Animation
    Observation

    Circling inner dimensions 2 and 1.

Knowledge points
  1. Condition for Matrix Multiplication to be Defined

Does the order of matrices matter for multiplication definedness?

Clear evidence
Derived from the video
Evidence
  1. Audio
    Observation

    The presenter compares the original and reversed multiplication orders.

Knowledge points
  1. Order matters for definedness
  2. Assuming matrix multiplication is commutative
Coverage and review notes

Covered · Introduction of the first problem: Is DB defined?

Covered · Presenter copies the problem to a scratchpad using the Snipping Tool.

Covered · Analysis of the dimensions of D and B, applying the rule for matrix multiplication, and concluding DB is not defined.

Covered · Introduction and analysis of the second problem: Is C+B defined? Applying the rule for matrix addition.

Covered · Matrix addition example.

Covered · Transition between problems.

Covered · Matrix multiplication definition and first example (AE).

Covered · Reverse order example (EA) and discussion on order importance.

Covered · Final answer selection and confirmation.

Explore the knowledge in this video

Open video knowledge graph →

  • Matrices ExplanationAt 0:53
    Why this connection?

    For the ordinary row-by-column product of real matrices, the first matrix’s column count must equal the second matrix’s row count. An m-by-n matrix can multiply an n-by-p matrix, giving an m-by-p result. The result-size statement is an editorial clarification of the standard rule.