<!-- MATH 4242 Python Lab 8: sections 7.1 to 7.2 -->
<setup>
  <selectFromSequence name="s" from="1" to="3" step="1" />
  <selectFromSequence name="k" from="3" to="5" step="1" />
  <selectFromSequence name="p" from="1" to="3" step="1" />
  <selectFromSequence name="q" from="-2" to="-1" step="1" />

  <math name="xStandardOne">$p+$s*$q</math>
  <math name="mTwelve">$s*($k-2)</math>
  <math name="txOne">2*$p+$s*$k*$q</math>
  <math name="txTwo">$k*$q</math>
</setup>

<p>Python Lab 8: Linear maps and change of basis</p>

<p>
  Open <em>08_Change_of_Basis.ipynb</em> and enter
  <m>s=$s</m>, <m>k=$k</m>, <m>p=$p</m>, and <m>q=$q</m>.
  Let
  <m>
    B=\left\{
      \begin{bmatrix}1\\0\end{bmatrix},
      \begin{bmatrix}$s\\1\end{bmatrix}
    \right\},\qquad
    [T]_B=\begin{bmatrix}2 &amp; 0\\0 &amp; $k\end{bmatrix},\qquad
    [x]_B=\begin{bmatrix}$p\\$q\end{bmatrix}.
  </m>
</p>

<ol marker="a.">
  <li>
    <p>
      Convert <m>[x]_B</m> to standard coordinates. The first component is
      <mathInput name="xStd1" forAnswer="$xStandardAnswer" minWidth="70">
        <shortDescription>first standard coordinate of x</shortDescription>
      </mathInput>
      and the second component is
      <mathInput name="xStd2" forAnswer="$xStandardAnswer" minWidth="70">
        <shortDescription>second standard coordinate of x</shortDescription>
      </mathInput>.
    </p>
    <answer name="xStandardAnswer">
      <award><when>$xStd1=$xStandardOne and $xStd2=$q</when></award>
    </answer>
  </li>

  <li>
    <p>
      The change-of-basis matrix is
      <m>P=\begin{bmatrix}1 &amp; $s\\0 &amp; 1\end{bmatrix}</m>.
      Which formula gives the standard matrix <m>M</m> of <m>T</m>?
    </p>
    <choiceInput name="similarityChoice" forAnswer="$similarityAnswer">
      <shortDescription>formula for the standard matrix after change of basis</shortDescription>
      <choice><m>M=P^{-1}[T]_BP</m></choice>
      <choice><m>M=P[T]_BP^{-1}</m></choice>
      <choice><m>M=P+[T]_B</m></choice>
      <choice><m>M=P^T[T]_BP</m></choice>
    </choiceInput>
    <answer name="similarityAnswer"><award><when>$similarityChoice.selectedIndex=2</when></award></answer>
  </li>

  <li>
    <p>
      Your calculation should give
      <m>M=\begin{bmatrix}2 &amp; m_{12}\\0 &amp; $k\end{bmatrix}</m>.
      Enter
      <m>m_{12}=</m>
      <mathInput name="m12Input" forAnswer="$matrixEntryAnswer">
        <shortDescription>upper right entry of the standard matrix</shortDescription>
      </mathInput>.
    </p>
    <answer name="matrixEntryAnswer"><award><when>$m12Input=$mTwelve</when></award></answer>
  </li>

  <li>
    <p>
      Compute <m>T(x)</m> in standard coordinates. The first component is
      <mathInput name="tx1Input" forAnswer="$txAnswer" minWidth="80">
        <shortDescription>first standard coordinate of T of x</shortDescription>
      </mathInput>
      and the second component is
      <mathInput name="tx2Input" forAnswer="$txAnswer" minWidth="80">
        <shortDescription>second standard coordinate of T of x</shortDescription>
      </mathInput>.
    </p>
    <answer name="txAnswer">
      <award><when>$tx1Input=$txOne and $tx2Input=$txTwo</when></award>
    </answer>
  </li>

  <li>
    <p>Why do <m>M</m> and <m>[T]_B</m> have the same eigenvalues?</p>
    <choiceInput name="eigenChoice" forAnswer="$eigenAnswer">
      <shortDescription>reason two representations have the same eigenvalues</shortDescription>
      <choice>They are equal entry by entry.</choice>
      <choice>Every two-by-two matrix has eigenvalues <m>2</m> and <m>$k</m>.</choice>
      <choice>They are similar matrices representing the same linear map.</choice>
      <choice>Both matrices are orthogonal.</choice>
    </choiceInput>
    <answer name="eigenAnswer"><award><when>$eigenChoice.selectedIndex=3</when></award></answer>
  </li>
</ol>
