4. Multiplication of Matrices


Don't miss
"Flash matrix interactive"
on this page...

Important: We can only multiply matrices if the number of columns in the first matrix is the same as the number of rows in the second matrix.

Examples

Multiplying a 2 × 3 matrix by a 3 × 4 matrix is possible and it gives a 2 × 4 matrix as the answer.

Multiplying a 7 × 1 matrix by a 1 × 2 matrix is okay; it gives a 7 × 2 matrix

A 4 × 3 matrix times a 2 × 3 matrix is NOT possible.


How to Multiply 2 Matrices

We use letters first to see what is going on. We'll see a numbers example after.

As an example, let's take a general 2 × 3 matrix multiplied by a 3 × 2 matrix.

2x3 3x2 ques

The answer will be a 2 × 2 matrix.

We multiply and add the elements as follows. We work across the 1st row of the first matrix, multiplying down the 1st column of the second matrix, element by element. We add the resulting products. Our answer goes in position a11 (top left) of the answer matrix.

first

We do a similar process for the 1st row of the first matrix and the 2nd column of the second matrix. The result is placed in position a12.

third

Now for the 2nd row of the first matrix and the 1st column of the second matrix. The result is placed in position a21.

second

Finally, we do the 2nd row of the first matrix and the 2nd column of the second matrix. The result is placed in position a22.

fourth

So the result of multiplying our 2 matrices is as follows:

2x3 by 3x2

Now let's see a number example.

Example

Multiply:

math expression


Answer


Multiplying 2 × 2 Matrices

The process is the same for any size matrix. We multiply across rows of the first matrix and down columns of the second matrix, element by element. We then add the products:

math expression

In this case, we multiply a 2 × 2 matrix by a 2 × 2 matrix and we get a 2 × 2 matrix as the result.


Example

Multiply:

math expression


Answer



Here is a (2×2)×(2×2) example in LiveMath.

LIVEMath


Let's look at another example. This time we have (3×3)×(3×1).

LIVEMath

Flash Interactive

Here's a Flash movie to play with. It will generate many different sized (up to 5 by 5) matrices with different random numbers each time. You can see plenty of examples of matrix operations, including adding, subtracting and multiplying.

You can step through each calculation involved. You can do this by clicking the "step" button which appears.

Suggestion: Work out the answer yourself first, then check your answer against what it says. Never just copy!

Loading Flash movie.

Matrices and Systems of Simultaneous Linear Equations

We now see how to write a system of linear equations using matrix multiplication.

Example:

The system of equations

math expression

can be written as:

math expression

Matrices are ideal for computer-driven solutions of problems because computers easily form arrays. We can leave out the algebraic symbols. A computer only requires the first and last matrices to solve the system, as we will see in Matrices and Linear Equations.

Note 1 - Notation

Care with writing matrix multiplication.

The following expressions have different meanings:

AB is matrix multiplication

A×B cross product, which returns a vector

A*B used in computer notation, but not on paper

AB dot product, which returns a scalar.


Note 2 - Commutativity of Matrix Multiplication

Does AB = BA?

Let's see if it is true using an example.


Example

If

math expression

and

math expression

find AB and BA.


Answer


In general, when multiplying matrices, the commutative law doesn't hold, i.e. ABBA. There are two common exceptions to this:

In the next section we learn how to find the inverse of a matrix.

Example - Multiplying by the Identity Matrix

Given that

math expression

find AI.


Answer


Exercises

1. If possible, find BA and AB.

math expressionmath expression


Answer



2. Determine if B = A-1.

math expression

math expression


Answer



3. In studying the motion of electrons, one of the Pauli spin matrices is

math expression

where

math expression

Show that s2 = I.

[If you have never seen j before, go to the section on complex numbers].


Answer



4. Evaluate the following matrix multiplication which is used in directing the motion of a robotic mechanism.

math expression

math expression



Answer



Here is a Java applet (the only one on Interactive Mathematics) which also demonstrates matrix multiplication.

Matrix Multiplication Java Applet



online tutoring

Tutors from Harvard, Penn, Cornell and other top US schools are online and ready to help.
First 30 minutes are free! Visit ziizoo.com


Book mark this page in Del.icio.us, Furl, Digg, StumbleUpon, whatever...


Didn't find what you are looking for? Try search:


Need a break? Play a math game. Well, they all involve math... No, really!

dumbolf memoTST bola shadow factory mindfields trick-hoops-challenge crystal clear