# Linear Algebra – A Guide To Matrix Multiplication

Hello. Here is a guide on matrix multiplication in the field of linear algebra.

Matrix multiplication is an operation similar to addition, subtraction, multiplication and division but it is for matrices.

Before we get into matrix multiplication, let’s review the dimensions of a matrix.

Update: The LaTeX parts are fixed in the later part of this page. The QuickLatex plugin did not work. It was fixed by using the QuickLaTeX website itself. From the website I copied and pasted the images.

Topics

Dimensions of Matrices

Suppose we have a matrix such as:

Source: http://quicklatex.com/cache3/ff/ql_8e266a1616f4752d1bdfd50c42f928ff_l3.png

This matrix has 2 rows and 3 columns. Rows go from left to right and follow a horizontal fashion while columns are from top to bottom in a vertical manner. Since has 2 rows and 3 columns, we say that is a 2 by 3 matrix.

The first row of A contain the entries 8, 2 and 1 and the second row contains the entries of -1, -2 and 0.

With the columns, the first column of A has 8 and -1, the second column has 2 and -2 and the last column has 1 and 0.

Suppose we have a matrix B which is:

Source: http://quicklatex.com/cache3/32/ql_26ae83ac1f1d4cf96d31622d0963d732_l3.png

The matrix has 3 rows and 3 columns. Whenever a matrix has the same number of rows as it does the number of columns,we say that the matrix is a square matrix. In this case, B is a square matrix. In Linear Algebra, square matrices have a lot neat and special properties.

Matrix Multiplication

In regular multiplication, two numbers are needed to create an answer called the product. Two times three gives six for example.

Matrix multiplication does not operate exactly like regular multiplication but it does require two matrices under a certain condition to create an output.

Instead of showing the general formula, a simple example will be shown first.

Suppose we have which is a 1 by 2 matrix and a 2 by 2 matrix

Source: http://quicklatex.com/cache3/0a/ql_2bea377eca38241cae8d1c6ed0d18f0a_l3.png.

We can matrix multiply the matrix with to create since the number of columns of matches the number of rows from the matrix which is 2.

Matrix multiplying to get is not possible as the number of columns in is 2 which does not match the one row in matrix .

The resulting matrix from matrix multiplication is a 1 by 2 matrix. The matrix has one row from the one row from and has 2 columns from the 2 columns of . The matrix is:

The first entry of the first row in is multiplied by the first entry in the first column of added by the second entry in the first row of multiplied by the second entry in the first column of . This gives the 6 as the first row, first column entry in .

To get the 3, we use the row from but use the second column from .

A Guideline

If the matrix has many rows and many columns and if the matrix has many rows and many columns then the matrix exists if . That is, the number of columns in is equal to the number of rows in .

The resulting matrix would have many rows and many columns.

The image from http://www.coolmath.com/sites/cmat/files/images/04-matrices-03.gif is provides a nice summary and guideline for matrix multiplication.

Examples

Example One

Given the matrices

http://quicklatex.com/cache3/c0/ql_c4ca4be2a32a2546ff724d6433ed5cc0_l3.png

and

Source: http://quicklatex.com/cache3/9a/ql_df0d88b7355f9e90222ee75a0dcbc59a_l3.png

does exist?

If so, what is ? Does exist? If so, what is ?

Solution:

The matrix is a 2 by 2 matrix and is a 2 by 1 matrix. The matrix does exist since the number of columns in matches the number of rows in which is 2.

Through matrix multiplication, is:

Source: http://quicklatex.com/cache3/b0/ql_e4c83e14cc0c106a9546df898a47ceb0_l3.png

Example Two

In this example we are given:

Source: http://quicklatex.com/cache3/ec/ql_4cb253d6dacc35d2f3cbf42329336dec_l3.png

and

Source: http://quicklatex.com/cache3/9e/ql_b6afb7413d37ed50a93224b15fda799e_l3.png

What is BA?

Solution:

The matrix is a 3 by 3 matrix and is a 3 by 2 matrix. Matrix multiplication can be applied and would be a 3 by 2 matrix.

Source: http://quicklatex.com/cache3/07/ql_264cd4bda3398f193d876278d88cbc07_l3.png

Source: http://quicklatex.com/cache3/b7/ql_47c71d955ef278e9d5b264f71724d6b7_l3.png

Source: http://quicklatex.com/cache3/6f/ql_afb11cfcf24d855e8aabe0b14e83b06f_l3.png

Notes

Matrix multiplication is used often when dealing with matrices. You first learn this topic by hand as an introduction.

When matrices get larger the use of computer software such as R, MATLAB, Python, C, C++ would be preferred.

Given matrices and the command for matrix multiplication in the statistical program R is

The featured image is from http://d1gjlxt8vb0knt.cloudfront.net//wp-content/uploads/strassen_new.png.