% lines that start with a % are comments
%
%
%
% this is some boiler plate that goes at the beginning of most tex documents
\documentclass{article}
\title{CS325 Assignment \#1, Summer 2009, OSU}
\author{YOUR NAME GOES HERE}
%\date{}
% mess with the margins and padding
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\oddsidemargin 0.25in
\evensidemargin 0.25in
\textwidth 6.00in
\headheight 0.00in
\headsep 0.00in
\topmargin 0.00in
\textheight= 9.00in
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% this line includes clrscode.sty, which adds functionality for formatting psuedocode
\usepackage{clrscode}
% this marks the beginning of a document
\begin{document}
% this command tells tex to format a title for the page using the info you specified above in the \title
\maketitle
\section{Introduction}
Here is an a statement about big O, $3n^2 \in O(n^2)$. People also write $3n^2 = O(n^2)$ to mean the same thing.
Here is the triple-equals equivelence sign: $P(n) \equiv n^2 \in O(n^3)$.
Here are some inequalities: $4 < 5, 4 \leq 5, x \geq y$.
Here is a more complicated exponent: $n^{x+5}$.
Here is a subscript: $x_1, x_2, x_3, ..., x_n$.
Here is a fraction $\frac{1}{2}$.
Here is a set: $X \subset \{ a, b, c \}$.
Here is a sum: $\sum_{i=1}^n i = \frac{n(n+1)}{2}$.
TeX will put the sub and superscripts for a sum on top and bottom if you add the displaystyle command:
$\displaystyle \sum_{i=1}^n i = \frac{n(n+1)}{2}$.
If you put a double money sign, TeX centers things in a math environment on its own line:
$$
\int e^x dx = e^x
$$
Equation arrays can be nice for adding line numbers. Lines are ended with a double backslash. Ampersands can be used to format the equations so all of the = signs line up.
\begin{eqnarray}
x &=& y \\
a &=& b + c% don't end the last line in an eqn array with \\ or it will add extra space
\end{eqnarray}
You will get a line number even if there is only one thing in the eqn array:
\begin{eqnarray}
P = Q
\end{eqnarray}
Here's how to not get a line number:
\begin{eqnarray}
\nonumber 3n^2 &=& 10y \\
53 &=& 7x
\end{eqnarray}
TeX will probably hyphenate this if it would help make the text line up more nicely:
Pneumonoultramicroscopicpsilivolcaniconiousis
Here is an itemized list
\begin{enumerate}
\item Foo
\item Bar
\end{enumerate}
Here is a bulleted list
\begin{itemize}
\item Foo
\item Bar
\end{itemize}
Here is an example of how to format psuedocode (this is how it is done in the CLR algorithms text book):
\begin{codebox}
\Procname{$\proc{Pair-Set-To-Truncations}(n,m,\{(s_1,p_1),(s_2,p_2),...,(s_n,p_n)\})$}
\li \For $i \gets 1$ to $n$:
\Indentmore
\li \For $t \gets 1$ to $m$:
\Indentmore
\li \If $S(s_i,t) = p_i$:
\Indentmore
\li $T[s_i] \gets t$
\End
\End
\End
\end{codebox}
\section{Conclusion}
\subsection{TeX is suave}
\subsubsection{to the max}
%%%%%%%%% don't delete this line or it won't compile
\end{document}