Properties of Dot Product - Lab
Introduction
In this lab we shall look at some interesting properties of a Dot product type matrix multiplication. Understanding these properties will become useful as we move forward with machine learning advanced linear algebra. The lab will require you to calculate results to provide a proof for these properties.
Objectives
You will be able to:
- Understand and analytically explain Distributive, Commutative and Associative properties of dot product
Instructions
- For each property, create suitably sized matrices with random data and prove the equations
- Ensure that size/dimension assumptions are met while performing calculations (you'll see errors otherwise)
- Calculate the LHS and RHS for all equations and show if they are equal or not
Distributive Property - Matrices multiplication is distributive
Prove that A.(B+C)=A.B+A.C
# Your code here
Associative Property - Matrices multiplication is associative
Prove that A.(B.C)=(A.B).C
# Your code here
Commutative Property - Matrix multiplication is NOT commutative
Prove that for matrices, A.B ≠ B.A
# Your code here
Commutative Property - vector multiplication IS commutative
Prove that for vectors, xT . y = yT . x
Note: supersciptT denotes the transpose we saw earlier
# Your code here
and finally
Simplification of the matrix product
Prove that (A.B)T = BT . AT
# Your code here
Summary
So now we have seen enough matrix algebra to help us solve a problem of linear equations as we saw earlier in this section. We shall see how to do this next.