#import "@preview/unequivocal-ams:0.1.1": ams-article, theorem, proof

#show: ams-article.with(title: "Exam Solutions")

Q6.

The general clockwise rotation matrix in $RR^2$ is

$
  mat(cos theta, sin theta; -sin theta, cos theta)
$

We have $theta = (3pi)/2$, and

$ cos((3pi) / 2) = 0, sin((3pi) / 2) = -1 $

So our particular rotation matrix is

$
  T = mat(0, -1; 1, 0)
$

Clearly, the linear transformation that reflects a vector across the vertical
axis changes the first standard basis vector, $vec(1, 0)$, to $vec(-1, 0)$.

This corresponds to the linear transformation (matrix)

$
  S = mat(-1, 0; 0, 1)
$

Matrix composition, $compose$, is an equivalent notion to matrix multiplication. Therefore, we have the two compositions.

+ #[
    $T compose S$, the linear transformation corresponding to a reflection followed by rotation:

    $
      T compose S &= mat(0, -1; 1, 0) mat(-1, 0; 0, 1) \
      &#[using _column by coordinate_ rule] \
      &= mat((-1 vec(0,1) + 0 vec(-1,0)), (0 vec(0,1) + 1 vec(-1,0))) \
      &= mat(0, -1,;-1, 0)
    $
  ]

+ #[
    $S compose T$, the linear transformation corresponding to rotation, followed by reflection. Since matrix composition is generally not commutative, we obtain a different matrix.

    $
      S compose T &= mat(-1,0; 0,1) mat(0,-1; 1,0) \
      &#[using _column by coordinate_ rule] \
      &= mat((0 vec(-1, 0) + 1 vec(0, 1)), (-1 vec(-1, 0) + 0 vec(0, -1))) \
      &= mat(0, 1; 1, 0)
    $
  ]

#pagebreak()

Q7.

#enum(
  numbering: "7.1",
  [
    The matrix $A$ corresponds to a linear transformation
    $T: RR^4 |-> RR^3$. $A$ has 3 rows and 4 columns, so its matrix-vector
    multiplication is only defined when with vectors in $RR^4$. Accordingly, it
    will output a vector in $RR^3$.

    So, $p = 4$.
  ],
  [
    See above explanation. $q = 3$.

  ],
  [
    To find all vectors $arrow(x) in RR^4$ whose image under $T$ is $arrow(b)$, we seek all solutions $arrow(x) = (x_1, x_2, x_3, x_4, x_5)^T$ to the equation
    $ T arrow(x) = arrow(b) $

    We can do this using our usual row reduction methods.

    $
      mat(augment: #(-1), -2,3,7,-11,-3;1,0,-2,1,3; 1,-1,-3,4,2) \
      mat(augment: #(-1), 1,-1,-3,4,2; 0, 1, 1, -3, 1; 0, 0, 0, 0, 0)
    $

    We now have the augmented matrix in echelon form. So, $x_4$ and $x_3$ are free. Then, let $s,t in RR$ be free variables
    $
      x_1 &= 3 - t + 2s \
      x_2 &= 1 + 3t - s \
      x_3 &= s \
      x_4 &= t
    $
    So, all vectors $arrow(x)$ are of the form

    $
      arrow(x) = vec(3+2s - t, 1 - s + 3t, s, t)
    $
  ],
)