6 The rules of matrix multiplication

It is worth noting that the process of multiplication can be continued to form products of more than two matrices.

Although two matrices may not commute (i.e. in general A B B A ) the associative law always holds i.e. for matrices which can be multiplied,

A ( B C ) = ( A B ) C .

The general principle is keep the left to right order , but within that limitation any two adjacent matrices can be multiplied.

It is important to note that it is not always possible to multiply together any two given matrices.

For example if A = 1 2 3 4 and B = a b c d e f then A B = a + 2 d b + 2 e c + 2 f 3 a + 4 d 3 b + 4 e 3 c + 4 f .

However B A = a b c d e f 1 2 3 4 is not defined since each row of B has three elements whereas each column of A has two elements and we cannot multiply these elements in the manner described.

Task!

Given A = 1 3 5 2 4 6 , B = 1 2 3 4 , C = 1 4 2 5 3 6

State which of the products A B , B A , A C , C A , B C , C B , ( A B ) C , A ( C B ) is defined and state the size ( n × m ) of the product when defined.

A B 2 × 3 2 × 2 not possible

B A 2 × 2 2 × 3 possible; result 2 × 3

A C 2 × 3 3 × 2 possible; result 2 × 2

C A 3 × 2 2 × 3 possible; result 3 × 3

B C 2 × 2 3 × 2 not possible

C B 3 × 2 2 × 2 possible; result 3 × 2

( A B ) C not possible, A B not defined.

A ( C B ) 2 × 3 3 × 2 possible; result 2 × 2

We now list together some properties of matrix multiplication and compare them with corresponding properties for multiplication of numbers.

Key Point 6
Matrix algebra Number algebra
A ( B + C ) = A B + A C a ( b + c ) = a b + a c
A B B A in general a b = b a
A ( B C ) = ( A B ) C a ( b c ) = ( a b ) c
A I = I A = A 1 . a = a .1 = a
A 0 ̲ = 0 ̲ A = 0 ̲ 0 . a = a .0 = 0
A B may not be possible a b is always possible
A B = 0 ̲ does not imply A = 0 ̲ or B = 0 ̲ a b = 0 a = 0 or b = 0

6.1 Application of matrices to networks

A network is a collection of points (nodes) some of which are connected together by lines (paths). The information contained in a network can be conveniently stored in the form of a matrix.

Example 5

Petrol is delivered to terminals T 1 and T 2 . They distribute the fuel to 3 storage depots ( S 1 , S 2 , S 3 ). The network diagram below shows what fraction of the fuel goes from each terminal to the three storage depots. In turn the 3 depots supply fuel to 4 petrol stations ( P 1 , P 2 , P 3 , P 4 ) as shown in Figure 2:

Figure 2

No alt text was set. Please request alt text from the person who provided you with this resource.

Show how this situation may be described using matrices.

Solution

Denote the amount of fuel, in litres, flowing from T 1 by t 1 and from T 2 by t 2 and the quantity being received at S i by s i  for i = 1 , 2 , 3 . This situation is described in the following diagram:

No alt text was set. Please request alt text from the person who provided you with this resource.

From this diagram we see that

s 1 = 0.4 t 1 + 0.5 t 2 s 2 = 0.4 t 1 + 0.2 t 2 s 3 = 0.2 t 1 + 0.3 t 2 or, in matrix form: s 1 s 2 s 3 = 0.4 0.5 0.4 0.2 0.2 0.3 t 1 t 2

In turn the 3 depots supply fuel to 4 petrol stations as shown in the next diagram:

No alt text was set. Please request alt text from the person who provided you with this resource.

If the petrol stations receive p 1 , p 2 , p 3 , p 4 litres respectively then from the diagram we have:

p 1 = 0.6 s 1 + 0.2 s 2 p 2 = 0.2 s 1 + 0.5 s 2 p 3 = 0.2 s 1 + 0.2 s 2 + 0.4 s 3 p 4 = 0.1 s 2 + 0.6 s 3  or, in matrix form:  p 1 p 2 p 3 p 4 = 0.6 0.2 0 0.2 0.5 0 0.2 0.2 0.4 0 0.1 0.6 s 1 s 2 s 3

Combining the equations, substituting expressions for s 1 , s 2 , s 3 in the equations for p 1 , p 2 , p 3 , p 4

we get:

p 1 = 0.6 s 1 + 0.2 s 2 = 0.6 ( 0.4 t 1 + 0.5 t 2 ) + 0.2 ( 0.4 t 1 + 0.2 t 1 ) = 0.32 t 1 + 0.34 t 2

with similar results for p 2 , p 3 and p 4 .

This is equivalent to combining the two networks. The results can be obtained more easily by multiplying the matrices:

p 1 p 2 p 3 p 4 = 0.6 0.2 0 0.2 0.5 0 0.2 0.2 0.4 0 0.1 0.6 s 1 s 2 s 3 = 0.6 0.2 0 0.2 0.5 0 0.2 0.2 0.4 0 0.1 0.6 0.4 0.5 0.4 0.2 0.2 0.3 t 1 t 2 = 0.32 0.34 0.28 0.20 0.24 0.26 0.16 0.20 t 1 t 2 = 0.32 t 1 + 0.34 t 2 0.28 t 1 + 0.20 t 2 0.24 t 1 + 0.26 t 2 0.16 t 1 + 0.20 t 2