In matrix algebra, there are two kinds of matrix multiplication: multiplication of a matrix by a number and multiplication of a matrix by
another matrix.
How to Multiply a Matrix by a Number
When you multiply a matrix by a number, you multiply every element in the matrix by the same number. This operation produces a ne
matrix, which is called a scalar multiple.
For example, if x is 5, and the matrix A is:
100 200
A=
300 400
Then, xA = 5A and
100 200
5A = 5
300 400
5 * 100 5 * 200
5A =
5 * 300 5 * 400
500 1000
5A = = B
1500 2000
In the example above, every element of A is multiplied by 5 to produce the scalar multiple, B.
Note: Some texts refer to this operation as multiplying a matrix by a scalar. (A scalar is a real number or a symbol representing a real
number.)
How to Multiply a Matrix by a Matrix
The matrix product AB is defined only when the number of columns in A is equal to the number of rows in B. Similarly, the matrix
product BA is defined only when the number of columns in B is equal to the number of rows in A.
Suppose that A is an i x j matrix, and B is a j x k matrix. Then, the matrix product AB results in a matrix C, which has i rows
and k columns; and each element in C can be computed according to the following formula.
Cik = Σj AijBjk
where
Cik = the element in row i and column k from matrix C
Aij = the element in row i and column j from matrix A
Bjk = the element in row j and column k from matrix B
Σj = summation sign, which indicates that the aijbjk terms should be summed over j
Let's work through an example to show how the above formula works. Suppose we want to compute AB, given the matrices below.
A= 0 1 2 B= 6 7
3 4 5 8 9