Types: N/A
Examples: N/A
Constructions: N/A
Generalizations: N/A

Properties: N/A
Sufficiencies: N/A
Questions: N/A

Matrix-Matrix Multiplication via Linear Combination of Columns

Let AR3×2 and XR2×3. Find the matrix-matrix product B=AX using 11.2 Matrix-Matrix Multiplication via Linear Combination of Columns.

A=[123456]3×2,X=[123456]2×3

Solution. The inner dimensions are both equal to 2, so we can do matrix-matrix multiplication. The outer dimensions are both 3, so our output will be a 3×3 matrix. Through our linear combination of columns approach, we can find the resulting matrix through a column-by-column approach.

Let's begin with column 1. Let's start by creating a general plan for what we are going to compute.

B(:,1)=AX(:,1)=[a11a12a21a22a31a32]2×3[x11x21]2×1Matrix-vector product=x11[a11a21a31]+x21[a12a22a32]Linear combination=[x11a11x11a21x11a31]+[x21a12x21a22x21a32]Scalar-vector multiplicationB(:,1)=[x11a11+x21a12x11a21+x21a22x11a31+x21a32]Vector-vector addition

Now that we have this in mind, let's plug in our values.

B(:,1)=AX(:,1)=[123456]3×2[14]2×1=1[135]3×1+4[246]3×1=[135]3×1+[81624]3×1B(:,1)=[91929]3×1

We continue this process for our column 2

B(:,2)=AX(:,2)=[123456]3×2[25]2×1=2[135]3×1+5[246]3×1=[2610]3×1+[102030]3×1B(:,2)=[122640]3×1

and column 3

B(:,3)=AX(:,3)=[123456]3×2[36]2×1=3[135]3×1+6[246]3×1=[3915]3×1+[122436]3×1B(:,3)=[153351]3×1

Putting our columns 1, 2, and 3 together, we get our final matrix-matrix product

B=AX=[123456]3×2[123456]2×2B=[91215192633294051]3×3

Remark. We can check our answer using Octave with the following code:

A = [1, 2; 3, 4; 5, 6]
X = [1, 2, 3; 4, 5, 6]
B = A * X


Modify a single column of a matrix

Let a 4×3 modeling matrix A be

[A]m×n=[100110011001]4×3

Suppose we wish to double column 1 of A and leave the other columns untouched. In other words, we want to multiply A(:,1) by 2 and leave the other columns untouched.

Solution. Recall 11.1 Anatomy of Matrix-Matrix Multiplication. To do algebraic work on the columns of our modeling matrix, we can multiply on the right.

What type of matrix would allow us to leave all other columns untouched?

To double column 1 and leave all other columns untouched, we multiply on the right by a 9.9 Dilation Matrix.

Dilation Matrix

Let natural number nN and scalar cR. For j{1,2,,n}, we define an n×n dilation matrix
Dj(c)=In+(c1)ejejT

Since we are trying to double column 1 of our modeling matrix A, we set j=1 and c=2 for our dilation matrix.

This is how our current setup would be written:

[A]4×3modeling matrix[D1(2)]3×3algebraic worker=[100110011001]4×3[200010001]3×3=[B]4×3

Let's compute our matrix-matrix product column-by-column.

[B(:,1)]4×1=Column1(AD1(2))=[A]4×3[Column1(D1(2))]3×1=[100110011001]4×3[200]3×1=2[1100]+0[0110]+0[0011]=[2200]+[0000]+[0000][B(:,1)]4×1=[2200]

Let's continue with column 2.

[B(:,2)]4×1=Column2(AD1(2))=[A]4×3[Column2(D1(2))]3×1=[100110011001]4×3[010]3×1=0[1100]+1[0110]+0[0011][B(:,2)]4×1=[0110]

Again, we continue with column 3.

[B(:,3)]4×1=Column3(AD1(2))=[A]4×3[Column3(D1(2))]=[100110011001]4×3[001]3×1=0[1100]+0[0110]+1[0011][B(:,3)]4×1=[0011]

Finally, we can combine our results to form our output.

[A]4×5[D1(2)]=[B]4×3[100110010001]4×3[200010001]3×3=[200210010001]4×3

Based on this example, we can generalize a pattern for scaling the kth column of matrix ARm×n by the number c. To scale the kth column of A, we multiply A on the right by the n×n dilation matrix Dk(c).