% 
% file: sample.tex 
% author: Phil Rogaway
% History: 
%   Oct 14, 2003 - created
%   Apr 04, 2005 - 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}}}       
\newcommand{\prp}{{\mathrm{prp}}}                  % How to define new commands 
\newcommand{\calK}{{\cal K}}
\newcommand{\outputs}{{\Rightarrow}}                
\newcommand{\getsr}{{\:\stackrel{{\scriptscriptstyle\hspace{0.2em}\$}}{\leftarrow}\:}}
\newcommand{\andthen}{{\::\;\;}}    % \, \: \; for thinspace, medspace, thickspace
\newcommand{\Rand}[1]{{\mathrm{Rand}[{#1}]}}       % A command with one argument
\newcommand{\Perm}[1]{{\mathrm{Perm}[{#1}]}}       
\newcommand{\Randd}[2]{{\mathrm{Rand}[{#1},{#2}]}} % and with two arguments


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Problem Set 1 Solutions\\[2ex] 
       \rm\normalsize ECS 227 --- Phil Rogaway --- Spring 2005}
\date{\today}
\author{\bf Your Name Here!}

\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 $\mathit{Ctr}^i$;
never write something like x in ordinary text mode---it looks terrible. 

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

To produce an offset formula you can write things like
\begin{eqnarray*}
    \Adv_E^\prp(A) &=&   \Pr[K\getsr\calK\andthen A^{E_K}\outputs1] -
                         \Pr[\pi\getsr \Perm{n}\andthen A^\pi\outputs 1]\\
                   &\le&  1 
\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 in or bound for graduate school in computer science (or math or 
physics or~$\cdots$),
you'll eventually want to learn how to use this 
program well. (In addition, you'll eventually need to 
learn some drawing tool, such as \textit{xfig/jfig}, 
whose output can be combined with that from \LaTeX.)
There are numerous good books on \LaTeX.
The most ``standard'' one is 
\textit{LaTeX: A Document Preparation System} (2nd edition), by
Leslie Lamport. 



\end{document}
