% 
% file: sample.tex 
% author: Phil Rogaway
% History: 
%   Oct 14, 2003 - created
%   Sep 23, 2008 - last revised 
%
% This is LaTeX template to get you started using LaTeX
% for making problem-set solutions.
%
 
\documentclass[11pt]{article}
\usepackage{amsmath}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textheight}{9in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}

% Sample macros -- how you define new commands
% My own set of frequently-used macros have grown to many hundreds of lines.
% Here are some simple samples.

\newcommand{\Adv}{{\mathbf{Adv}}}          %example macro 
\newcommand{\getsr}{{\:\stackrel{{\scriptscriptstyle\hspace{0.2em}\$}}{\leftarrow}\:}}  % a more complex sample macro
\newcommand{\Func}[1]{{\mathrm{Fun}[{#1}]}}       % These macros take one
\newcommand{\Randd}[2]{{\mathrm{Rand}[{#1},{#2}]}} % and two arguments


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Problem Set 1 Solutions\\[2ex] 
       \rm\normalsize ECS 20 --- Fall 2008}
\date{\today}
\author{\bf Jane P.\ Student}

\begin{document}
\maketitle


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Problem 1} 

Here you'll put your solution to problem~1.  
A most \textit{excellent\/} solution to problem~1.
Make all of your solutions excellent and you will make
me happy.  Don't you want me to be happy?


\section*{Problem 2}
To turn this file into a \textit{dvi\/} file type \texttt{latex~sample.tex}.
The resulting \texttt{sample.dvi} can be looked at 
using a previewer such as \textit{xdvi} (on UNIX) or \textit{yap} (on Windows),
and it can be printed out from those programs.
To create a \textit{pdf\/} file you can say \texttt{pdflatex~sample.tex}.

When working under Windows I use \textit{MiKTeX},
a free distribution of \LaTeX\ and associated programs. 
You can download it from various web sites; just google \textit{miktex}. 
After downloading \textit{MiKTeX} you can put its directory of executables
in your path and use a command prompt (DOS window) to do things, editing
your tex-files with a Windows-based version of \textit{vi} or \textit{emacs}.
Alternatively, get your \LaTeX\ distribution under \textit{cygwin}.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Problem 3} 

One of the most important aspects of \LaTeX\ is its math mode.
Mathematical symbols should look like $a$ or $X_5$ or or $A_{ij}^*$ or $\mathit{Ctr}^i$;
never write something like x in ordinary text mode---it looks terrible, and means something different from $x$. 
Indeed you should regard
x, \texttt{x}, $x$, $X$, and $\cal X$ as all distinct things.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Problem 4} 

To produce an offset formula you can write things like
\begin{eqnarray*}
    \sum_{i=1}^n i  &=&   \frac{n(n+1)}{2} \\
                    &\in& O(n^2)
\end{eqnarray*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Problem 5} 
I won't suggest that becoming good with \LaTeX\ is easy; it isn't.
But essentially all computer science researchers use this program
nowadays---and lots
of other scientists and non-scientists do, too.
If you are or want to be a ``serious'' academic, 
you should learn to use \LaTeX.
I would say that it is the program of choice even for your 
essays in English or GE classes---it not \textit{just} for
typesetting technical stuff.
There are numerous good books on \LaTeX.
The ``classical'' one is 
\textsl{LaTeX: A Document Preparation System} (2nd edition), by
Leslie Lamport. 
A more recent one is \textsl{Guide to LaTeX} (4th edition), by
Kopka and Daly.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Problem 6} 
I'm afraid that producing drawings for inclusion into \LaTeX\ opens up 
a can of worms (yum).  I personally use 
\textit{xfig}, \textit{Illustrator}, or \textit{Visio}; others use
different tools. 
Regardless, doing beautiful drawings takes substantial time and care.
I suggest that, if you do want to typeset your homework solutions, just
do any accompanying drawings in pencil or ink. 


\end{document}

