% % sample.tex % % This is LaTeX template to get you started % 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 has grown to many hundreds of lines \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 (Fall 2003)} \date{\today} \author{Phillip Rogaway} \begin{document} \maketitle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section*{Problem 1} Here goes a solution to problem 1. A most \textit{excellent\/} solution. 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 ``dvi'' file type \texttt{latex sample.tex}. The resulting \texttt{sample.dvi} can be looked at using a tool like \texttt{xdvi} (on UNIX) or \texttt{yap} (on Windows). When working under Windows I use \texttt{MiKTeX} (a distribution of \LaTeX\ and associated programs). You can download it for free from any of numerous web sites. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section*{Problem 3} One of the most important things you need to learn is to use is to use math mode. Mathematical symbols should look like $a$ or $X_5$ or $\mathsf{Ctr}^n$; never write 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[\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 scientists use this program nowadays---and lots of other scientists and non-scientists do, too. You'll eventually want to learn how to use this program reasonably well---and you'll eventually want to learn some drawing tool, such as \texttt{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}