Products of vector and matrix
In this section we will analyze the way in which two matrices can be multiplied. It is
obvious that one can define the product of two m X n matrices, A=(a ij) and B = (bij) as
the m X n matrix whose ij component is aij bij. However, for almost all important
applications using arrays, another type of product is required.
Example #1: Product of a demand vector and a price vector
Suppose a manufacturer produces four items. Your demand is given by the demand
vector (see matrix below) (a 1x4 matrix),
( )
The price per unit that the manufacturer receives for the items is given by the price
vector (see matrix below)(a 4x1 matrix). If the demand is met, how much money will the
manufacturer receive?
( )
Solution: The demand for the first item is 30, and the manufacturer receives $20 for
each item sold. Therefore, you receive (30) (20) = $600 from the sales of the first item.
Following this reasoning, we see that the total amount of money he receives is
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
This result is written as
( )( )
That is, a 4-component row vector and a 4-component column vector are multiplied to
obtain a scalar (a real number)
In the last example, a row vector was multiplied by a column vector and a scalar was
obtained.
,Scalar product
Let ( )y ( ) two vectors. Then the scalar product of a and b, denoted by
a*b, is given by:
The product is often called the dot product inner product of vectors. Note that the scalar
product of two n=vectors is a scalar (that is, it is a number)
We will often take the dot product of a row vector and a column vector. In this case you
have:
( )( )
Row Vector This is a real number
1Xn (a scalar)
Column
Vector n X 1
Product of two matrices
Let A = (aij) be an m X n matrix, and let B = (bij) be an n X p matrix. Then the product of
A and B is an m X p matrix, C = (cij), where:
( ) ( )
That is, the ij element of AB is the dot product of row i of A and column j of B. Extending
this gives
If the number of columns of A is equal to the number of rows of B, then A and B are said
to be shareable under multiplication.
, Example #1: product of two 2x2 matrices
If ( ) and ( ), calculate AB y BA
Solution: A is a 2x2 matrix and B is a 2x2 matrix, so C= AB=(2x2)*(2x2) is also a 2x2
matrix. If C=(cij), what is the value of c11? It's known that
( ) ( )
Rewriting the matrices, we have
1er row of A ( ) ( ) 1er column of B
With the previous step it would be as follows:
( ) ( ) ( ) ( )
Similarly, to calculate c12 we have the following way:
1er row of A ( ) ( ) 2a column of B
( ) ( ) ( ) ( )
Following the procedure, it is found that:
2a row de A ( ) ( ) 1er column de B
2a row de A ( ) ( ) 2a column de B
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
The resulting matrix would be as follows:
( )
In this section we will analyze the way in which two matrices can be multiplied. It is
obvious that one can define the product of two m X n matrices, A=(a ij) and B = (bij) as
the m X n matrix whose ij component is aij bij. However, for almost all important
applications using arrays, another type of product is required.
Example #1: Product of a demand vector and a price vector
Suppose a manufacturer produces four items. Your demand is given by the demand
vector (see matrix below) (a 1x4 matrix),
( )
The price per unit that the manufacturer receives for the items is given by the price
vector (see matrix below)(a 4x1 matrix). If the demand is met, how much money will the
manufacturer receive?
( )
Solution: The demand for the first item is 30, and the manufacturer receives $20 for
each item sold. Therefore, you receive (30) (20) = $600 from the sales of the first item.
Following this reasoning, we see that the total amount of money he receives is
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
This result is written as
( )( )
That is, a 4-component row vector and a 4-component column vector are multiplied to
obtain a scalar (a real number)
In the last example, a row vector was multiplied by a column vector and a scalar was
obtained.
,Scalar product
Let ( )y ( ) two vectors. Then the scalar product of a and b, denoted by
a*b, is given by:
The product is often called the dot product inner product of vectors. Note that the scalar
product of two n=vectors is a scalar (that is, it is a number)
We will often take the dot product of a row vector and a column vector. In this case you
have:
( )( )
Row Vector This is a real number
1Xn (a scalar)
Column
Vector n X 1
Product of two matrices
Let A = (aij) be an m X n matrix, and let B = (bij) be an n X p matrix. Then the product of
A and B is an m X p matrix, C = (cij), where:
( ) ( )
That is, the ij element of AB is the dot product of row i of A and column j of B. Extending
this gives
If the number of columns of A is equal to the number of rows of B, then A and B are said
to be shareable under multiplication.
, Example #1: product of two 2x2 matrices
If ( ) and ( ), calculate AB y BA
Solution: A is a 2x2 matrix and B is a 2x2 matrix, so C= AB=(2x2)*(2x2) is also a 2x2
matrix. If C=(cij), what is the value of c11? It's known that
( ) ( )
Rewriting the matrices, we have
1er row of A ( ) ( ) 1er column of B
With the previous step it would be as follows:
( ) ( ) ( ) ( )
Similarly, to calculate c12 we have the following way:
1er row of A ( ) ( ) 2a column of B
( ) ( ) ( ) ( )
Following the procedure, it is found that:
2a row de A ( ) ( ) 1er column de B
2a row de A ( ) ( ) 2a column de B
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
The resulting matrix would be as follows:
( )