\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{latexsym}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage{mathrsfs}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}

\def\zero{\multicolumn{1}{>{\columncolor{white}}c}{0}}
\def\colCell#1#2{\multicolumn{1}{>{\columncolor{#1}}c}{#2}}

\input{preamble.tex}

\begin{document}
\homework{4: Matrices}{Due Friday, Week 3}

This problem set is structured somewhat differently.  Do the \textbf{three} problems in the required section!  (I switched up the style here because there are a few things I really want you to do here in order for matrices to make sense.)  As always, prove all of your claims, and have fun!

\section{Required Problems}
Take any field $\mathbb{F}$.  In class, we proved that $\mathbb{F}^n$ was a vector space over $\mathbb{F}$; common examples of this vector space were things like $\mathbb{R}^n$ over $\mathbb{R}$, or $\left(\mathbb{Z}/2\mathbb{Z}\right)^n$ over $\mathbb{Z}/2\mathbb{Z}$.

Given this setup, we define a \textbf{matrix} as follows:
\begin{defn}
A $n \times n$ \textbf{matrix} $A$ over a field $\mathbb{F}$ is a particular kind of function from $\mathbb{F}^n \to \mathbb{F}^n$.  A matrix is specified by giving a $n \times n$ array of elements from $\mathbb{F}$, drawn as follows:
\begin{align*}
A := \begin{bmatrix}
a_{11} & a_{12} & a_{13} & \ldots & a_{1n}\\
a_{21} & a_{22} & a_{23} & \ldots & a_{2n}\\
a_{31} & a_{32} & a_{33} & \ldots & a_{3n}\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & a_{n3} & \ldots & a_{nn}\\
\end{bmatrix}
\end{align*}
With this array of elements specified, we can define the function $A: \mathbb{F}^n \to \mathbb{F}^n$ as follows: for any vector $\vec{v} = (v_1, v_2, \ldots v_n) \in \mathbb{F}^n$, write
\begin{align*}
A(\vec{v}) = \left( \sum_{i=1}^n a_{1i}v_i, ~\sum_{i=1}^n a_{2i}v_i,~ \sum_{i=1}^n a_{3}v_i, ~\ldots~, \sum_{i=1}^n a_{ni}v_i\right).
\end{align*}
\end{defn}

For example, the following object 
\begin{align*}
A = \begin{bmatrix} \pi & \pi & 0 \\ 0 &2 &1 \\ 1 & 3 & -21\end{bmatrix}
\end{align*}
can be thought of as a $3 \times 3$ matrix over $\mathbb{R}$, and thus is a function from $\mathbb{R}^3 \to \mathbb{R}^3$.  If we wanted to know where $A$ sends the vector $(1,2,1)$, we could just use the definition above to calculate
\begin{align*}
A((1,2,1)) &= \left( \sum_{i=1}^3 a_{1i}v_i, ~\sum_{i=1}^3 a_{2i}v_i,~ \sum_{i=1}^3 a_{3}v_i\right)\\
&=\left( \pi \cdot 1 + \pi \cdot 2 + 0 \cdot 1, 0 \cdot 1 + 2\cdot 2 + 1 \cdot 1, 1 \cdot 1 + 3 \cdot 2 + (-21) \cdot 1\right)\\
&= (3\pi, 5, -14).
\end{align*}
\begin{enumerate}
\item (Warm-ups.)  To get used to the above notation, calculate the following values:
\begin{enumerate}
\item For $A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5& 6\\ 7 & 8 & 9\end{bmatrix}$, thought of as a matrix over $\mathbb{R}$, find $A((0,0,0)), A((3,4,2))$, and $A((1,-2,1))$.
\item For $A = \begin{bmatrix} 1 & 0 & 1\\ 0 & 1 & 0 \\ 1 & 0 & 1\end{bmatrix}$, thought of as a matrix over $\mathbb{Z}/2\mathbb{Z}$, find $A((0,0,0))$ and $A((1,0,1))$.
\item Take any field $\mathbb{F}$; because $\mathbb{F}$ is a field, it contains an additive identity 0 and a multiplicative identity 1.  Look at  the $n \times n$ matrix $A$ defined by putting 1 on the diagonal and 0's elsewhere: in other words,
\begin{align*}
A = \begin{bmatrix}
1 & 0 & 0 & \ldots & 0\\
0 & 1 & 0 & \ldots & 0\\
0 & 0 & 1 & \ldots & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
0 & 0 & 0 & \ldots & 1\\
\end{bmatrix}.
\end{align*}
Show that for any $\vec{v} = (v_1, v_2, \ldots v_n) \in \mathbb{F}^n$, we have $A((\vec{v})) = \vec{v}$.
\item Again, take any field $\mathbb{F}$.  Consider the ``all-zeroes'' $n \times n$ matrix $A$, given by
\begin{align*}
A = \begin{bmatrix} 0 & 0& \ldots & 0\\
0 & 0 & \ldots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \ldots & 0\\
\end{bmatrix}
\end{align*} Show that for any $\vec{v} = (v_1, v_2, \ldots v_n) \in \mathbb{F}^n$, we have $A((\vec{v})) = \vec{0}$.
\end{enumerate}
\item Take any two vectors $\vec{v}, \vec{w} \in \mathbb{F}^n$.  Define the \textbf{dot product} of $\vec{v} \cdot \vec{w}$ as follows:
\begin{align*}
\vec{v} \cdot \vec{w} = \sum_{i=1}^n v_iw_i.
\end{align*}
For example, the dot product of $(1,2,3)$ and $(2,2,4)$, if both are thought of as vectors in $(\mathbb{Z}/5\mathbb{Z})^3$, is
\begin{align*}
1 \cdot 2 + 2 \cdot 2 + 3 \cdot 4 = 18.
\end{align*}
Take any $n \times n$ matrix $A$ over a field $\mathbb{F}$.  Let $\vec{a_{r_i}}$ denote the $i$-th row of $A$: that is, $\vec{a_{r_i}} = (a_{i,1}, a_{i,2}, \ldots a_{i,n})$.  

Prove that for any vector $\vec{v}$, we have
\begin{align*}
A(\vec{v}) = \left( \vec{a_{r_1}} \cdot \vec{v}, \vec{a_{r_2}} \cdot \vec{v}, \ldots \vec{a_{r_n}} \cdot \vec{v}\right).
\end{align*}
\item Take any two $n \times n$ matrices $A, B$ over a field $\mathbb{F}$.  We think of these two objects as maps $\mathbb{F}^n \to \mathbb{F}^n$; consequently, we can talk about \textbf{composing} these maps: that is, we can form the map $B\circ A: \mathbb{R}^n \to \mathbb{R}^n$ that sends a vector $\vec{v}$ to $B(A(\vec{v}))$.

For example, if $A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 1& 2\\ 1 & 1 & 0\end{bmatrix}$ and $B = \begin{bmatrix} -1 & -2 & -3 \\ 0 & 0& 0\\ 0 & 1 & 3\end{bmatrix}$ are two matrices over $\mathbb{R}$, then we can find $(B\circ A) ((-1,1,0))$ as follows:
\begin{align*}
(B\circ A) ((-1,1,0)) &= B(A((-1,1,0)))\\
 &= B ((1 \cdot -1 + 2 \cdot 1 + 1 \cdot 0, 2 \cdot -1 + 1 \cdot 1 + 2 \cdot 0, 1 \cdot -1 + 1 \cdot 1 + 0 \cdot 0))\\
 &= B((1, -1, 0))\\
 &= (-1 \cdot 1 + -2 \cdot -1 + -3 \cdot 0, 0 \cdot 1 + 0 \cdot -1 + 0 \cdot 0, 0 \cdot 1 + 1 \cdot -1 + 3 \cdot 0)\\
 &= (1, 0, -1).\\
\end{align*}
\begin{enumerate}
\item For $A = \begin{bmatrix} 2 & 3\\ 1 & 0 \end{bmatrix}$ and  $B = \begin{bmatrix} -1 & -2 \\ -1 & -2\end{bmatrix}$ a pair of $2 \times 2$ matrices over $\mathbb{R}$, find $(B\circ A) ((1,1))$ and $(B\circ A) ((-2,0))$.
\item Find two matrices $A, B$ and a vector $\vec{v}$ such that $(B\circ A)(\vec{v}) \neq (A \circ B) (\vec{v})$.  (In other words, the order of composition is important when working with matrices!)
\item Take any two $n \times n$ matrices $A, B$ over some field $F$:
\begin{align*}
A = 
\begin{bmatrix} 
a_{1,1} & a_{1,2} & \ldots & a_{1,n} \\
a_{2,1} & a_{2,2} & \ldots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n,1} & a_{n,2} & \ldots & a_{n,n} \\
\end{bmatrix}, 
B = 
\begin{bmatrix} 
b_{1,1} & b_{1,2} & \ldots & b_{1,n} \\
b_{2,1} & b_{2,2} & \ldots & b_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
b_{n,1} & b_{n,2} & \ldots & b_{n,n} \\
\end{bmatrix}.
\end{align*}
Denote the row vectors of $B$ as $\vec{b_{r_i}}$'s and the column vectors of $A$ as $\vec{a_{c_j}}$'s.  

Consider the following $n \times n$ matrix $C$, made by placing $\vec{b_{r_i}} \cdot \vec{a_{c_j}}$ in each entry $(i,j)$:
\begin{align*}
C = \begin{bmatrix} 
\vec{b_{r_1}} \cdot \vec{a_{c_1}} & \vec{b_{r_1}} \cdot \vec{a_{c_2}} & \ldots & \vec{b_{r_1}} \cdot \vec{a_{c_n}} \\
\vec{b_{r_2}} \cdot \vec{a_{c_1}} & \vec{b_{r_2}} \cdot \vec{a_{c_2}} & \ldots & \vec{b_{r_2}} \cdot \vec{a_{c_n}} \\
\ldots & \ldots & \ddots & \ldots \\
\vec{b_{r_n}} \cdot \vec{a_{c_1}} & \vec{b_{r_n}} \cdot \vec{a_{c_2}} & \ldots & \vec{b_{r_n}} \cdot \vec{a_{c_n}} \\
\end{bmatrix}.
\end{align*}

Take any vector $\vec{v} \in \mathbb{F}^n$.  Prove that $(B \circ A) (\vec{v}) = C(\vec{v})$.  (This process is what we refer to by ``matrix multiplication;'' we will usually denote the matrix $C$ above as $B \cdot A$.)
\end{enumerate}
\end{enumerate}



\end{document}