\date{} \newcommand{\cstitle}[1]{\title{CS 509: #1}} \newcommand{\problemset}[1]{\cstitle{Problem Set #1}} \newcommand{\duedate}[1]{\author{Due #1}} \addtolength{\textwidth}{1in} \addtolength{\oddsidemargin}{-.5in} \addtolength{\evensidemargin}{-.5in} \newcounter{prb} \setcounter{prb}{0} \newcommand{\newprob}{% \addtocounter{prb}{1} \par\bigskip\noindent% \mbox{\bf Problem \arabic{prb}:\ }} \newcommand{\solhead}{\medskip\par\noindent% \mbox{\bf Solution to Problem \arabic{prb}:\ }} \newcommand{\probsol}[2]{% \newprob% #1% \solhead% #2 } \newcommand{\probonly}[2]{% \newprob% #1% } \newcommand{\hint}{\medskip\par\noindent\mbox{\bf Hint:\ }} \newcommand{\problem}[2]{\probsol{#1}{#2}} \newcommand{\nosolutions}{\renewcommand{\problem}{\probonly}} \newcommand{\solutions}{\renewcommand{\problem}{\probsol}} \newcommand{\sfmint}[2]{\newcommand{#1}{\mbox{\sf #2}}} \newcommand{\bfmint}[2]{\newcommand{#1}{\mbox{\bf #2}}} \newcommand{\bfmathmint}[2]{\newcommand{#1}{\mbox{\boldmath #2}}} \newcommand{\com}[1]{\par\medskip\noindent{\bf\boldmath{#1}}} \newcommand{\e}{\mbox{\boldmath$\epsilon$}} \newcommand{\inv}[1]{#1^{-1}} \newcommand{\finv}{f^{-1}} \newcommand{\manyone}{\leq_m} \newcommand{\ls}{\mbox{L}} \newcommand{\nl}{\mbox{NL}} \newcommand{\p}{\mbox{P}} \newcommand{\np}{\mbox{NP}} \newcommand{\conp}{\mbox{co-NP}} \newcommand{\pspace}{\mbox{PSPACE}} \newcommand{\schoning}{Sch\"{o}ning} #\newcommand{\implies}{\rightarrow} \newcommand{\funct}[3]{\mbox{$#1:#2\rightarrow#3$}} %standard macros I use % widening a page \newlength{\widenamount} \newcommand{\widen}[1]{% \setlength{\widenamount}{#1}% \addtolength{\textwidth}{\widenamount}% \addtolength{\oddsidemargin}{-.5\widenamount}% \addtolength{\evensidemargin}{-.5\widenamount}% } %Creating boxed figures \newlength{\boxfigwidth} \newcommand{\boxfig}[1]{ \begin{figure*} \begin{center} \setlength{\boxfigwidth}{\textwidth} \addtolength{\boxfigwidth}{-.4in} \noindent\framebox{\quad\begin{minipage}{\boxfigwidth} #1 \end{minipage}\quad} \end{center} \end{figure*} } %split a page into two sections \newlength{\splitpagewidth} \newcommand{\splitpage}[3]{% \setlength{\splitpagewidth}{\textwidth}% \addtolength{\splitpagewidth}{-#1}% \noindent% \begin{minipage}[t]{#1}% #2% \end{minipage}\begin{minipage}[t]{\splitpagewidth}% #3% \end{minipage}% } %commands for making steps for algorithms \newcommand{\spacein}[2]{\splitpage{#1}{\hfill}{#2}} \newlength{\stepindent} \setlength{\stepindent}{24pt} \newlength{\stepskip} \setlength{\stepskip}{\medskipamount} \newcommand{\step}[2]{\medskip\noindent\splitpage{\stepindent}{\hfill\mbox{{\bf{#1.}}\ \ }}{#2}} %nested and inline if/while/for/else commands \newcommand{\opstyle}[1]{{\bf{#1}}} \newlength{\opindentwidth} \setlength{\opindentwidth}{9pt} \newlength{\opspacer} \setlength{\opspacer}{6pt} \newcommand{\opindent}[4]{\noindent{\opstyle{#1}}\hspace*{\opspacer}{#2}\\% \spacein{#3}{#4}} \newcommand{\opline}[3]{\noindent{\opstyle{#1}}\hspace*{\opspacer}{#2}% \hspace*{\opspacer}{#3}} \newcommand{\ifindent}[2]{\opindent{If}{#1}{\opindentwidth}{#2}} \newcommand{\ifline}[2]{\opline{If}{#1}{#2}} \newcommand{\elseindent}[1]{\opindent{Else}{}{\opindentwidth}{#1}} \newcommand{\elseline}[1]{\opline{Else}{#1}{}} \newcommand{\elseifindent}[2]{\opindent{ElsiIf}{#1}{\opindentwidth}{#2}} \newcommand{\elseifline}[2]{\opline{ElseIf}{#1}{#2}} \newcommand{\whileindent}[2]{\opindent{While}{#1}{\opindentwidth}{#2}} \newcommand{\whileline}[1]{\opline{While}{#1}{}} \newcommand{\forindent}[2]{\opindent{For}{#1}{\opindentwidth}{#2}} \newcommand{\forline}[2]{\opline{For}{#1}{#2}} \newcommand{\foreachindent}[2]{\opindent{Foreach}{#1}{\opindentwidth}{#2}} \newcommand{\foreachline}[2]{\opline{Foreach}{#1}{#2}} \newcommand{\repeatindent}[2]{\opindent{Repeat}{#1}{\opindentwidth}{#2}} \newcommand{\repeatline}[2]{\opline{Repeat}{#1}{#2}} \newcommand{\until}[1]{\ \opstyle{Until}\,#1} \newcommand{\return}[1]{\ \opstyle{Return}\,(#1)} \newcommand{\goto}[1]{\opline{Goto}{#1}{}} % prn \newcommand{\prn}[1]{{\left(#1\right)}} %Specifying subroutines \newcommand{\substyle}[1]{\sc{#1}} \newcommand{\makesub}[2]{\newcommand{#1}{\mbox{\substyle{#2}}}} %Specifying variables \newcommand{\varstyle}[1]{\sf{#1}} \newcommand{\makevar}[2]{\newcommand{#1}{\mbox{\varstyle{#2}}}}