% To compile, issue these commands at the command line:
% latex hw.tex; dvips -t landscape -t letter hw.dvi -o hw.ps

\documentclass[fleqn,10pt,twocolumn,landscape]{article}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage[top=0.5in,bottom=0.8in,left=0.5in,right=0.5in]{geometry}
\setlength{\parskip}{0in}
\setlength{\columnsep}{0.25in}

\newcommand{\matcol}{\ensuremath{\textnormal{:}}}
\newcommand{\matcom}{\ensuremath{\textnormal{,}}}
\newcommand{\E}{\ensuremath{\textnormal{E}\,}}
\newcommand{\intd}{\ensuremath{\textnormal{d}}}

\begin{document}

\noindent CME304 Homework 0 \\
S. N. Opt \\
\today \\
I collaborated with my imaginary friend Bob on problems 1 and 3. \\

\noindent \textbf{(1)} Here is Matlab-style matrix indexing without spaces
around the colon and comma: $A(1 \matcol 4 \matcom 3) = 4$.

Here I refer to Figure ~\ref{fig:e1}.

Here is an integral:
\begin{equation*}
  \int_{\Omega} \sqrt{ 1 + \| \nabla z \|_2^2 } \ \intd x
\end{equation*}

\begin{figure}[b]
\centering
\includegraphics[width=4in]{e1.eps}
\caption{This is a figure, though the eps file is missing.}
\label{fig:e1}
\end{figure}

\noindent{\bf (2a)} In $Ax = b$,
\[ A = \left( \begin{array}{cllll}
  2 h^{-1} - \sigma   & \sigma - h^{-1} & \textrm{{\Large 0}} \\
  -h^{-1}             & \ddots          & \ddots \\
  \textrm{{\Large 0}} & \ddots          & \end{array} \right)
\quad \textrm{and} \quad
b = \left( \begin{array}{c} h f_1 + \alpha h^{-1} \\ h f_2 \\ \vdots \\ h
  f_{n-1} \\ h f_n + \beta (h^{-1} - \sigma) \end{array} \right).\]

\noindent \textbf{(2b)} Here is an excerpt of code:
\begin{verbatim}
k = 0; stop = 0;
while(~stop)
  % Allocate (or zero)
  Q = zeros(n,restart); H = zeros(restart+1,restart);
  % Solve M r = b - A x0
  r = SolvePreconSys(opts.M,b-MatVecProd(A,x0));
  % ...
end
\end{verbatim}

\noindent \textbf{(3)} Use {\tt align} to typeset a long derivation; {\it e.g.}:
\begin{align*}
\lambda_j q_j &= (\alpha - 2\beta\cos(j\theta)) q_j \\
&= \alpha\sin(dj\theta) - 2\beta\cos(j\theta)\sin(dj\theta) \\
&= \alpha\sin(dj\theta) - \beta[(\sin((d-1)j\theta) +
   \sin(j\theta)\cos(dj\theta)) + \\
&\phantom{=} (\sin((d+1)j\theta) -
   \sin(j\theta)\cos(dj\theta))] \\
&= -\beta\sin((d-1)j\theta) + \alpha\sin(dj\theta) - \beta\sin((d+1)j\theta).
\end{align*}

\end{document}
