Multiply Matrices

How to multiply matrices (2x2): 2 examples and their solutions.

Example 1

Solution

A = [1 2 / 3 4]
B = [2 -1 / 0 1]

So AB = [1 2 / 3 4][2 -1 / 0 1].

To find row 1, column 1,
multiply [row 1 of the front matrix]
and [column 1 of the back matrix].

1⋅2 + 2⋅0

Two matrices can be multiplied when

[the number of the elements
in the row of the front matrix]
=
[the number of the elements
in the column of the back matrix].

Row 1, column 2:
multiply [row 1 of the front matrix]
and [column 2 of the back matrix].

1⋅(-1) + 2⋅1

Row 2, column 1:
multiply [row 2 of the front matrix]
and [column 1 of the back matrix].

3⋅2 + 4⋅0

Row 2, column 2:
multiply [row 2 of the front matrix]
and [column 2 of the back matrix].

3⋅(-1) + 4⋅1

This is the way to multiply two matrices.

1⋅2 + 2⋅0
= 2 + 0

1⋅(-1) + 2⋅1
= -1 + 2

3⋅2 + 4⋅0
= 6 + 0

3⋅(-1) + 4⋅1
= -3 + 4

2 + 0 = 2

-1 + 2 = 1

6 + 0 = 6

-3 + 4 = 1

So AB = [2 1 / 6 1].

Example 2

Solution

A = [1 2 / 3 4]
B = [2 -1 / 0 1]

So BA = [2 -1 / 0 1][1 2 / 3 4].

Row 1, column 1:
multiply [row 1 of the front matrix]
and [column 1 of the back matrix].

2⋅1 + (-1)⋅3

Row 1, column 2:
multiply [row 1 of the front matrix]
and [column 2 of the back matrix].

2⋅2 + (-1)⋅4

Row 2, column 1:
multiply [row 2 of the front matrix]
and [column 1 of the back matrix].

0⋅1 + 1⋅3

Row 2, column 2:
multiply [row 2 of the front matrix]
and [column 2 of the back matrix].

0⋅2 + 1⋅4

This is the way to multiply two matrices.

2⋅1 + (-1)⋅3
= 2 - 3

2⋅2 + (-1)⋅4
= 4 - 4

0⋅1 + 1⋅3
= 0 + 3

0⋅2 + 1⋅4
= 0 + 4

2 - 3 = -1

4 - 4 = 0

0 + 3 = 3

0 + 4 = 4

So BA = [-1 0 / 3 4].

Compare this to the previous answer
AB = [2 1 / 6 1].

As you can see,
AB ≠ BA.

Unlike multiplying numbers,
when multiplying matrices,
if the order changes,
those two are not always equal.
(= AB and BA are not always equal.)