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:

a32=6a_{32} = 6

MATH-C03-C-002

Column 2 is:

[4, 5, 6]

Its first entry is 4.

MATH-C03-C-003

The middle dimensions match:

(5×4)(4×2)(5 \times 4)(4 \times 2)

The output keeps the outside dimensions:

5×25 \times 2

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:

[1,2][4,5]=14+25=14[1, 2] \cdot [4, 5] = 1 \cdot 4 + 2 \cdot 5 = 14

MATH-C03-C-006

The top-left entry of ABAB uses row 1 of AA and column 1 of BB:

[1,2][5,7]=15+27=19[1,2]\cdot[5,7] = 1\cdot5 + 2\cdot7 = 19

MATH-C03-C-007

The transpose swaps rows and columns.

If AA has shape 2 x 7, then ATA^T has shape 7 x 2.

MATH-C03-C-008

A diagonal matrix with diagonal entries 2 and 5 scales each coordinate separately:

[3,4]T[23,54]T=[6,20]T[3,4]^T \mapsto [2\cdot3, 5\cdot4]^T = [6,20]^T

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 WxWx 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:

(2×3)(3×5)(2 \times 3)(3 \times 5)

The middle dimensions match, so ABAB is defined. The output keeps the outside dimensions:

2×52 \times 5

Enter 1.

MATH-C03-C-012

The product shape is:

(12×8)(8×4)12×4(12 \times 8)(8 \times 4) \rightarrow 12 \times 4

The 12 examples remain. The output has 4 features per example.