% $Header: /home/rdv/quantum/genetic-paper/RCS/eaqc-paper.tex,v 1.12 2005/05/29 21:34:00 rdv Exp rdv $
% now how do I set the paper size?
% \documentclass[twocolumn]{article}

\documentclass[onecolumn,doublespace]{article}
%\documentclass{acm_proc_article-sp-no-copyright}
% \usepackage{usenix,times}
\usepackage{times}
%\usepackage{times}
\usepackage{graphics}
\usepackage{lscape}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage{color}
\usepackage{amsmath,amsfonts,amssymb}
%\setlength{\textwidth}{6in}
%\setlength{\textheight}{9in}
%\setlength{\oddsidemargin}{0.25in}

%\setlength{\topmargin}{0pt}
%\setlength{\headheight}{0pt}
%\setlength{\headsep}{0pt}
%\setlength{\topskip}{0pt}
%\renewcommand{\baselinestretch}{1.2}
% the LaTeX companion recommends values from 1.62 to 1.67 for
% doublespacing, depending on font size.
% \renewcommand{\baselinestretch}{1.66}

% they look bad with all that white space in itemize
% \addtolength{\itemsep}{-5mm}

% XXX get rid of page numbers before pub
% \pagestyle{empty}
% something bogus is happening with page number placement...
\pagestyle{plain}

\bibliographystyle{unsrt}   %>>>> makes bibtex use spiebib.bst

% \input{psfig}
\input{epsf}
% \epsfverbosetrue

%\def\comment#1{$\Rightarrow${\small\em #1}}
\def\comment#1{}
\newenvironment{chapterquote}
  {\begin{quotation}
      \sf}
  {\end{quotation}}
\def\cq#1#2{\begin{chapterquote}#1\flushright\textbf{#2}\end{chapterquote}}


\newcommand{\icol}[1]{% inline column vector
  \left(\begin{smallmatrix}#1\end{smallmatrix}\right)%
}

\newcommand{\irow}[1]{% inline row vector
  \begin{smallmatrix}(#1)\end{smallmatrix}%
}

\begin{document}
\title{Optimization Theory (DS2) HW\#1\\
Basic Matrix and Vector Operations}
\maketitle
% \begin{abstract}
%   First homework set for {\em Quantum Information Processing},
%   focusing on background.
% \end{abstract}

\begin{chapterquote}
Alice laughed. ``There's no use trying,'' she said: ``one can't
 believe impossible things.''

``I daresay you haven't had much practice,'' said the Queen. ``When I
    was your age, I always did it for half-an-hour a day. Why,
    sometimes I've believed as many as six impossible things before
    breakfast.''\\
\flushright{\textbf{Lewis Carroll}, {\em Through the Looking Glass},
    1871}
\end{chapterquote}

\begin{enumerate}
\item Download and install the programming language R, if you don't
  have it. Show me that it works.
\item Write out the transpose of the row vector $\irow{0 & 1 &
    2}^{\intercal}$ as a column vector.

\item Add the two vectors
\begin{equation}
\left(\begin{array}{c}
1 \\ 2 \\ 3 \\ 4
\end{array} \right) + 
\left(\begin{array}{c}
3 \\ 5 \\ 7 \\ 11
\end{array} \right) = ?
\end{equation}

\item Calculate the dot product of the two vectors
\begin{equation}
\left(\begin{array}{cccc}
1 & 2 & 3 & 4
\end{array} \right)
\left(\begin{array}{cccc}
4 & 3 & 2 & 1
\end{array} \right)^\intercal = ?
\end{equation}

\item Multiply this vector and matrix
\begin{equation}
\left(\begin{array}{cccc}
1 & 1 & 0 & 0 \\
2 & 0 & 1 & 0 \\
4 & 0 & 0 & 1 \\
\end{array} \right)
\left(\begin{array}{c}
1  \\
-1  \\
3  \\
2  \\
\end{array} \right)
= ?
\end{equation}

\item Multiply these matrices
\begin{equation}
\left(\begin{array}{cccc}
1 & 1 & 0 & 0 \\
2 & 0 & 1 & 0 \\
4 & 0 & 0 & 1 \\
3 & 0 & 0 & 0
\end{array} \right)
\left(\begin{array}{cccc}
5 & 1 & 0 & 0 \\
6 & 0 & -1 & 0 \\
7 & 0 & 0 & 1 \\
8 & 0 & 0 & -1
\end{array} \right) = ?
\end{equation}

\end{enumerate}


\end{document}

\item Given the following matrices:
\begin{equation}
A = \left[\begin{array}{cccc}
0 & 1 \\
1 & 0 \\
\end{array} \right],
\end{equation}
\begin{equation}
B = \left[\begin{array}{cccc}
1 & 1 \\
1 & -1 \\
\end{array} \right],
\end{equation}
\begin{equation}
C = \left[\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{array} \right],
\end{equation}
\begin{equation}
D = \left[\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{array} \right],
\end{equation}
calculate the following:
\begin{enumerate}
\item $AB$
\item $BA$
\item $A^2$
\item $B^2$
\item $C^2$
\item $D^2$
\item $CD$
\item $DC$
\end{enumerate}
