---
title: "MATH 542 | Homework 1"
author: "Saket Choudhary"
date: "1/17/2016"
output: pdf_document
---

# Problem 1


\begin{align*}
\mathbf{1}_n = \begin{pmatrix} 1\\
1\\
\vdots\\
1\\
\end{pmatrix}
\end{align*}


### Problem a
Consider $\mathbf{a}' = \begin{pmatrix}a_1 & a_2 & \dots a_n \end{pmatrix}$

Thus, $$\mathbf{a}'\mathbf{1}_n = \begin{pmatrix}a_1 & a_2 & \dots a_n \end{pmatrix} \times \begin{pmatrix} 1\\
1\\
\vdots\\
1\end{pmatrix} = a_1 + a_2 + a_3 + \dots a_n = \mathbf{a'} \mathbf{1_n}
$$

### Problem b

\begin{align*}
A_n I &=  \begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22}  & \dots & a_{2n}\\
\vdots\\
a_{n1} & a_{n2} & \dots  & a_{nn}
\end{pmatrix}  \times \begin{pmatrix} 1 \\
1\\
\vdots
1
\end{pmatrix} = \begin{pmatrix} \sum_{j=1}^n a_{ij}\\
\sum_{j=1}^n a_{2j}\\
\vdots
\sum{j=1}^n a_{nj}
\end{pmatrix}\\
&= \text{Column vector with row sums of }A
\end{align*}

### Problem c
Row sum of $j^{th}$ column of $A = \sum_{i=1}^na_{ij}$

Column sum of $i^{th}$ row of $A= \sum_{j=1}^n a_{ij}$

\begin{align*}
1_n'A &= \begin{pmatrix} 1 & 1 & \dots 1 \end{pmatrix} \times \begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22}  & \dots & a_{2n}\\
\vdots\\
a_{n1} & a_{n2} & \dots  & a_{nn}
\end{pmatrix}\\
&= \begin{pmatrix} \sum_{i=1}^n a_{i1} & \sum_{i=1}^n a_{i2} & \sum_{i=1}^n a_{i3}  & \dots \sum_{i=1}^n a_{in} \end{pmatrix}\\
&= \text{Row vector with elements as column sums of A}
\end{align*}

# Problem 2


\begin{align*}
a_1 &= \begin{pmatrix}
2\\
3\\
1
\end{pmatrix}\\
A_2 &= \begin{pmatrix}
1 & 2\\
2 & 0\\
0 & 1\\
\end{pmatrix}\\
b_1' &= \begin{pmatrix}
1 & 1 & 1 & 0
\end{pmatrix}\\
B_2 &= \begin{pmatrix}
2 & 1 & 1 & 2\\
2 & 3 & 1 & 2
\end{pmatrix}
\end{align*}

\begin{align*}
AB &= a_1b_1' + A_2B_2
\end{align*}

\begin{align*}
a_1b_1' &= \begin{pmatrix}
2 &   2 & 2 &   0\\
3 &   3  &  3 &   0\\
1  &  1 &   1 &   0
\end{pmatrix}
\end{align*}

Similarly,
\begin{align*}
A_2B_2 &= \begin{pmatrix}
6 &   7 &   3 &   6\\
4 &   2  &  2  &  4\\
2  &  3   & 1 &   2
\end{pmatrix}
\end{align*}

And hence $AB = a_1b_1' + A_2B_2 = \begin{pmatrix}
6 &   7 &   3 &   6\\
4  &  2  &  2  &  4\\
2  &  3 &   1 &   2\\
\end{pmatrix}$
# Problem 3

$A$ is $n \times p$

$AA'$ is symmetric if $AA' = A'A$

Proof:
$(AA')' = (A')'A' = AA'$ and hence $AA'_{n \times n}$ is symmetric

Similarly, for $A'A$ consider the following:

$(A'A)' = A'A''  = A'A$ and hence $A'A_{p \times p}$ is symmetric too.

### Part (b)

$(A'A)_{ij} = \sum_{k=1}^n a_{ki}a_{kj}$ and hence any diagonal element of $A'A$ is a sum of perfect squares(the case when $i=j$ $\implies$ $(A'A)_{ii} = \sum_{k=1}^n a_{ki}^2$)

If $\sum_{k=1}^n a_{ki}^2 =0$ $\implies$ $a_{ki} =0 \forall 1 \leq k \leq n \forall i$ Hence $A$ is a zero matrix.


# Problem 4

### Part (a)

$A_2 = \begin{pmatrix} 1 & 1 \\
1 & 1\\
1 & 0\\
0 & 0
\end{pmatrix}$

$A_3 = \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}$


$A_4 = \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}$

### Part (b)

#### Rank of $V_2$:

\begin{align*}
V_2 &= \begin{pmatrix} 1 & 1 \\
1 & 1\\
1 & 0\\
0 & 0
\end{pmatrix}\\
&\stackrel{\text{C2-C1}}{\longrightarrow}\begin{pmatrix} 1 & 0 \\
1 & 0\\
1 & -1\\
0 & 0
\end{pmatrix}\\ 
\end{align*}
which cannot be reduced further, hence rank = $min(4,2) = 2$

#### Rank of $V_3$

\begin{align*} A_3 &= \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}\\
&\stackrel{\text{R1-R2}}{\longrightarrow} \begin{pmatrix} 0 & 0 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}\\
\end{align*}

Thus rank of $V_3=3$

## Part (c)

Basis for $V_2$(maximising zeroes by doing a $C1-C2$ operation): $\begin{pmatrix} 0 & 1 & 0 \end{pmatrix}'$ and $\begin{pmatrix} 1 & 0 & 0\end{pmatrix}'$ 

Basis for $V_3$(maximised zeroes): \begin{pmatrix}1 & 0 & 0 \end{pmatrix}';\begin{pmatrix}1 & 1 & 0 \end{pmatrix}' and \begin{pmatrix}0 & 0 & 1 \end{pmatrix}'


