Solutions
These solutions collect the exercise reasoning in one place.
MATH-C03-C-001
Row 3 is [3, 6]. Column 2 is the second entry, so:
MATH-C03-C-002
Column 2 is:
[4, 5, 6]
Its first entry is 4.
MATH-C03-C-003
The middle dimensions match:
The output keeps the outside dimensions:
MATH-C03-C-004
The product is not valid:
(5 x 4)(3 x 2)
^ ^
The middle dimensions are 4 and 3, so the product is not defined.
MATH-C03-C-005
The first output entry uses the first row:
MATH-C03-C-006
The top-left entry of uses row 1 of and column 1 of :
MATH-C03-C-007
The transpose swaps rows and columns.
If has shape 2 x 7, then has shape 7 x 2.
MATH-C03-C-008
A diagonal matrix with diagonal entries 2 and 5 scales each coordinate
separately:
The second entry is 20.
MATH-C03-C-009
A 4 x 10 matrix maps a length-10 vector to a length-4 vector.
So has length 4.
MATH-C03-C-010
Each output entry is the dot product of one row of the matrix with the input vector.
That one sentence is the key to reading matrix-vector products.
MATH-C03-C-011
The product is:
The middle dimensions match, so is defined. The output keeps the outside dimensions:
Enter 1.
MATH-C03-C-012
The product shape is:
The 12 examples remain. The output has 4 features per example.