18.06 problem set 0: Warm-ups¶

This problem set is due Friday, Feb 4 at 11am.

You should submit your pset electronically via Canvas as PDF files. Submit a decent-quality scan of any handwritten solutions (e.g. get a scanner app on your phone), and a PDF printout of your Jupyter notebook showing any code and (clearly labeled results).

Problem 1¶

Suppose $A$ is a $3 \times 3$ matrix, $B$ is a $3 \times 2$ matrix, $x$ is a 3-component column vector, and $y$ is a $2$-component column vector.

What is the shape of the output (e.g. scalar, $4\times 3$ matrix, 5-component column vector, etcetera) of the following operations, or say nonsense if the operation doesn't make sense.

  1. $A B$
  2. $B A$
  3. $A B y$
  4. $A x B$
  5. $x^T A y$
  6. $x^T B y$
  7. $x^T y$
  8. $y x^T$
  9. $x^2$
  10. $A^2 = AA$
  11. $B^2 = BB$
  12. $\frac{x}{A}$
  13. $\frac{x}{x}$

Problem 2¶

(From Strang, section 2.2, problem 11.)

A system of linear equations Ax=b cannot have exactly two solutions. An easy way to see why: if two vectors x and y≠x are two solutions (i.e. Ax=b and Ay=b), what is another solution? (Hint: x+y is almost right.)

Problem 3¶

Either (ideally) download and install Julia and IJulia/Jupyter by following these instructions, or (slower, less convenient) run Julia in the cloud using these instructions.

  1. Create a new Julia notebook. Title it "[your last name] pset 0".
  2. Define a matrix A that takes in any 3-component vector $x$ and outputs ($Ax$) the components in reverse order. For example, this is how you enter a matrix in Julia:
In [1]:
A = [ 1 2 3 4
      5 6 7 8 ] # this is a 2×4 matrix … not the right answer
Out[1]:
2×4 Matrix{Int64}:
 1  2  3  4
 5  6  7  8

3. Multiply A by the vector x = [1,2,3] to check that it is doing what you want.

4. Try computing A*A. The result should be a very simple linear operation: what?

Be sure to include a PDF printout of your notebook with your submitted solutions.

In [ ]: