\documentclass[11pt]{amsart}
\usepackage[centering]{geometry}  % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}             % ... or a4paper or a5paper or ...
\usepackage[parfill]{parskip}    % Begin paragraphs with an empty line rather than an indent
\usepackage{latexsym}
\usepackage{amssymb}

%%%%%  ADD ANY OTHER NEEDED PACKAGES HERE
% For pseudo-code
\usepackage[norelsize]{algorithm2e}
% For nifty theorem-type environments
\usepackage{amsthm}

%%%%%%%%% ADD ANY CUSTOM MACROS HERE
\newcommand{\p}{{\mathrm{Prob}}}
\newcommand{\E}{\mathbb{E}}
\newtheorem{lem}{Lemma}
\newtheorem{thm}[lem]{Theorem}
\newtheorem{cor}[lem]{Corollary}

\def\scribe{Marco Carmosino}
\def\lecturedate{April 2, 2014}
\def\lecturetopic{Floyd-Rivest Median Selection}

%%%%  HEADER INFORMATION AND DOCUMENT START
%%%% All scribe notes should include header information
%%%% in this format.
\def\lecturer{Sam Buss}
\def\coursetitle{Math 261C: Randomized Algorithms}

\begin{document}
\begin{center}
{\Large \coursetitle} \\[1em]

Lecture topic: \lecturetopic \\[1em]

Lecturer: \lecturer \\
Scribe notes by: \scribe \\
Date: \lecturedate
\end{center}



\section{Improved Median Selection: The Algorithm}

As sketched at the end of yesterday's lecture, ....

Example of pseudocode as written by Marco.  This particular pseudocode
package does not split algorithms across pages, so you might prefer to 
put it in a float.  

\begin{algorithm}[H]
 \KwData{$A$, $n$, $k$}
 \KwResult{the $k^{th}$ element of $A$}

 \uIf{n = 1}{
   return $a_0$\;
 }
 \Else{
   Choose $S \subset A$ of size $s$ uniformly at random without replacement \;

   $j_u = \max\{k \cdot \frac{s}{n} - g, 0\}$\;
   $j_v = \min\{k \cdot \frac{s}{n} + g, 0\}$\;
   \;
   $u$ = FR-Select($S,s,j_u$)\;
   $v$ = FR-Select($S,s,j_v$)\;
   \;
   \tcc{Scan $A$ sequentially to partition it as below}
   $\{u\}$\;
   $\{v\}$\;
   $L = \{a_i < u\}$\;
   $M = \{u < a_i < v\}$\;
   $U = \{a_i > v\}$\;
   \;
   \uIf{ $|L| = k$ }{
     return $u$\;
   }
   \uElseIf{$|L|+|M|+1 = k$}{
     return $v$\;
   }
   \uElseIf{$|L| > k$}{
     return FR-Select($L$, $|L|$, $k$)\;
   }
   \uElseIf{ $(|L|+|M|+1) > k$ }{
     return FR-Select($M$, $|M|$, $k - |L|-1$)\;
   }
   \Else{
   return FR-Select ($U$, $|U|$, $k - (|L| + |M| +2)$)\;
   }
 }
 \caption{The Floyd-Rivest $k^{th}$ element selection algorithm}
\end{algorithm}


\section{The Analysis}



\begin{lem}
$\p [\hbox{\rm (3) fails}]$ is $o(1)$.
\end{lem}

\begin{proof}
  Suppose $k > i_v$, ...

\end{proof}

This completes our argument.

\end{document} 