# Question regarding matrix multiplication

1. May 17, 2005

### Mathman23

Hi

When one is trying to multiply two matrices of different sizes e.g. a 2x3 and a 3x3. I know that one has to use the column-row-rule which states:

$$AB_{ij} = a_{i1} b_{1j} + a_{i2} b_{2j} + \cdots + a_{i n} b_{m j}$$

Looking at the following example:

$$A= \left[ \begin{array}{ccc} 7 & 2 & 0 \\ -4 & 6 & 2 \\ -1 & \frac{2}{5} & \frac{7}{5} \end{array} \right] \ \ \ B = \left[ \begin{array}{ccc} 7 & 2 & 0 \\ -4 & 6 & 2 \\ \end{array} \right]$$

Using the column-row-rule I calculate the matrix-product AB:

$$AB= \left[ \begin{array}{ccc} 7 & 2 & 0 \\ \\ \\ \end{array} \right] \cdot \left[ \begin{array}{cc} -4 &7 \\ 6 &2 \\ 2 & 0 \end{array} \right] = \left[ \begin{array}{cc} -16 & 53 \\ \\ \\ \end{array} \right]$$

But if I then write the B-matrix upside-down I get:

$$AB= \left[ \begin{array}{ccc} 7 & 2 & 0 \\ \\ \\ \end{array} \right] \cdot \left[ \begin{array}{cc} 0 &2 \\ 2 & 6 \\ 7 & -4 \end{array} \right] = \left[ \begin{array}{cc} 4 & 30 \\ \\ \\ \end{array} \right]$$

Which of the two results is the correct approach to compute the matrix-product AB ???

Does there exist a rule in linear algebra which allows me to predetermain if the product of two matrices A and B both not of the same size ( A is n x n and B is m x n ) gives the resulting matrix C which has a different size than A and B ???

Sincerley
Fred

Last edited: May 17, 2005
2. May 17, 2005

### allistair

you can't do A*B, you can do B*A but A*B is impossible.

its pretty easy to remember 2x3*3x3 is a 2x3 (just look at the outer numbers, also the inner ones must be the same to be able to multiplicate em)

3. May 17, 2005

### Mathman23

Okay then the operation I did by tilting the matrix B is illegal. SORRY.

Then the rows of the matrices A and B has to be equal in-order for the matrix-product AB to be legal??

In general terms I guess that implies if a matrix A is n x n and a matrix B is m x n then the matrix-product AB is m x n ???

But there isn't a rule/theorem which details this??

Sincerely

Fred

4. May 17, 2005

### Yegor

If a matrix A is n x n and a matrix B is m x n then the matrix-product AB does't exist at all. You can compute only BA.
In general. If A is m x k, and B is k x n, than AB is m x n. But BA isn't defined. Number of columns of first matrix must be equal to number of rows of second

5. May 17, 2005

### jdavel

Mathman,

I think you're still confused.

For A*B to be defined, the # of columns in A has to equal the # of rows in B. So A(j,k)*B(k,m) = C(j,m). But A(j,k)*B(m,n) is not defined unless k=m.

No theory is really required for this; it's just the definition of matrix multiplication.