If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Precalculus>Unit 7

Lesson 11: Properties of matrix multiplication

# Defined matrix operations

Sal discusses the conditions of matrix dimensions for which addition or multiplication are defined. Created by Sal Khan.

## Want to join the conversation?

• We do not talk about matrix division. Rather, we multiply by inverse matrices. You can do the same thing with real numbers... In fact, my high school algebra II teacher always said that there was no such thing as division -- only multiplying by inverses.

For example, instead of writing 6 / 3 = 2, you can write 6*(1/3) = 2. So my old teacher was right. You can do everything in mathematics without division.

And this is what we do with matrices, because not all matrices have inverses, meaning you cannot "divide" by any matrix that you wish. You can only "divide" by a matrix with an inverse. So instead, we just multiply by those inverses, just like my silly example with whole numbers illustrates.
• Who thought of matrices first?
• The history of matrices go a long way back to ancient times but the word "matrix" wasn't formerly used until 1850. It generally means any place in which something is formed or produced. If you want to find anything else about the history go to this website: http://www.ualr.edu/lasmoller/matrices.html
• OK, so as far as I understand, one can multiply 2 matrices if:
a) they both have the same dimensions (e.g., [2x3] and [2x3], [1x2] and [1x2] and so on), OR
b) the number of columns of the first matrix is equal to the number of rows of the second,
RIGHT?
If so, then how does one multiply, e.g., following matrices: [1x3] and [1x3], or [1x2] and [1x2]?
• Not necessarily. You had part b right, but you can't always multiply two matrices with the same dimensions. Take your example [1x3] *[1x3]. They are both 1x2 matrices. Since the the number of columns of the first matrix isn't equal to the number of rows of the second (2 and 1) this operation is undefined. :D Hope this helps!
• Well, about the addition part, I read on wikipedia that matrix of m rows and n columns when added with matrix of p rows and q columns will form a matrix of m+p rows and n+q columns. It is also written that it is defined.
• Something is wrong here. In matrix addition, you can only add matrices that have the same dimensions, and the resulting matrix has the same dimensions. So a matrix with m rows and n columns can only be added to a matrix that also has m rows and n columns. The result of such an addition is a matrix with m rows and n columns.
• @
As the order matters in matrices multiplication, does it matter because one of the matrices is considered as the (processor) which processes the other one, while we might call the other one as (input)? if this makes sense, let me know at which matrix we might call the processor, A or E? if you consider "A" as the one which process the other "E" then i am ok, but if you consider "E" as the processor i actually in a trouble.
what is my trouble? let me ask you for help
i cant get satisfied with the rule (multiplication is defined as long as the middle two number are the same) i even didn't used at Khan Academy to use such tools. but what satisfying and give me confident is to understand, and the thing i understand regarding this matter is as the following:
the processing matrix expands or transform or distribute each raw element exists in the "input matrix" into a column, and it is not matter how many raws are in thus new columns, it is new distribution. the most important is the processor matrix should have a columns congruent to the number of the raws in the input matrix, this makes enough processing rooms for each input, no more rooms allowed and ne less rooms allowed, either case makes confusion and hence the operation will not be defined. but as long as the processing matrix has columns of the exact number of the raws in the input matrix then the operation is defined.
and that is why i care about which matrix A or B you consider as "processor" matrix, if A is the processor then AE is not defined and i am ok because A has more processing room than required and this is not acceptable, but if you consider E is the processing one, this blow a big question mark here because E actually could process A, it has 2 columns to process each raw elements of A.
• There are several ways to think of matrices, but I'm not convinced that thinking of one as 'processing' or 'acting on' the other is a very useful one.

You can think of matrices as transformations of space. Say we have a 2x3 matrix with 2 rows and 3 columns. The fact that there are 3 columns means the domain of the transformation is ℝ³. We interpret the matrix as a list of 3 column vectors, each of which is 2-dimensional. The matrix is sending <1, 0, 0> to the left vector, <0, 1, 0> to the middle vector, and <0, 0, 1> to the right vector. Because they're being mapped to 2D vectors, the range of the transformation is ℝ².

This is why we need the dimensions of the matrices to match up in order to multiply them; matrix multiplication is just function composition. If matrix A is a function from ℝ³ to ℝ², then whatever function (matrix) we apply after applying A had better have a domain of ℝ², or else nothing is well-defined.
• How can EA be defineable, but not AE. I know why- the rows of the first matrix has to be the same as the columns of the second matrix- but why does that matter?
• Actually, it's the other way around -- the number of columns of the first matrix has to be the same as the number of rows of the second matrix. The way we have defined matrix multiplication means that each value in the resulting matrix is determined by the dot product of a row from the first matrix and a column from the second matrix. For example, this product [A]*[B]

[0 1] * [1 1 / 2 0]

would have 1 row and 2 columns.

The first value of AB would be 0*1 + 1*2 -- the dot product of two vectors, A's first row and B's first column. Therefore, we can see that a dot product requires the same number of values in the multiplicand and the multiplier, or the same number of columns in the first matrix and rows in the second matrix.

If, for example, the second matrix was [1 1], with only one row, AB could not be defined, because there is no way to multiply each value of [0 1] with each value of [1]. 0 (in A) could multiply 1 (in B), but the remaining 1 in A would not have a corresponding multiplier (0*1 + 1*??). The number of columns in A has to be the same as the number of rows in B simply because of the rules of matrix multiplication -- there is no way to create a definable product if these two numbers are different. Hope this helps!
(1 vote)
• does this means that the commutative property for multiplication does not work for matrices?
(1 vote)
• Yes, that's right -- matrix multiplication is not commutative. You can see for yourself if you pick two random square matrices and try to multiply them in either order -- the products will usually be different.
• How do you find out if subtraction of matrices is defined?
(1 vote)
• Matrix substraction is defined like the matrix addition : the two matrices need to be the exact same dimensions.

Subtracting matrix B from matrix A can be viewed as adding matrix B times (-1) scalar to matrix A.
(1 vote)
• Is exponentiation of matrices a defined operation ? Also can matrices themselves be exponents of a number ?
(1 vote)
• Matrix exponentials are defined (for square matrices) using the series expansion of the exponential:
e^X = I + X + X^2/2! + X^3/3! + X^4/4! + ...

Some properties are different: for example, e^A e^B = e^(A + B) if and only if AB = BA.

I'd imagine X^Y would be defined as e^(Y log X). Don't quote me on that, though.