\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage{framed}

\DeclareMathOperator*{\E}{\mathbb{E}}
\let\Pr\relax
\DeclareMathOperator*{\Pr}{\mathbb{P}}

\newcommand{\eps}{\epsilon}
\newcommand{\inprod}[1]{\left\langle #1 \right\rangle}
\newcommand{\R}{\mathbb{R}}

\newcommand{\handout}[5]{
  \noindent
  \begin{center}
  \framebox{
    \vbox{
      \hbox to 5.78in { {\bf CS 388R: Randomized Algorithms } \hfill #2 }
      \vspace{4mm}
      \hbox to 5.78in { {\Large \hfill #5  \hfill} }
      \vspace{2mm}
      \hbox to 5.78in { {\em #3 \hfill #4} }
    }
  }
  \end{center}
  \vspace*{4mm}
}

\newcommand{\lecture}[4]{\handout{#1}{#2}{#3}{Scribe: #4}{Lecture #1}}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{assumption}[theorem]{Assumption}

% 1-inch margins, from fullpage.sty by H.Partl, Version 2, Dec. 15, 1988.
\topmargin 0pt
\advance \topmargin by -\headheight
\advance \topmargin by -\headsep
\textheight 8.9in
\oddsidemargin 0pt
\evensidemargin \oddsidemargin
\marginparwidth 0.5in
\textwidth 6.5in

\parindent 0in
\parskip 1.5ex

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan,
}

\usepackage{filecontents}

\begin{filecontents}{references.bib}
@INPROCEEDINGS{Mitzenmacher00thepower,
    author = {Michael Mitzenmacher and Andréa W. Richa and Ramesh Sitaraman},
    title = {The Power of Two Random Choices: A Survey of Techniques and Results},
    booktitle = {in Handbook of Randomized Computing},
    year = {2000},
    pages = {255--312},
    publisher = {Kluwer}
}
}
\end{filecontents}

\begin{document}

\lecture{8 --- Sep 23, 2015}{Fall 2015}{Prof.\ Eric Price}{An T. Nguyen}

\section{Overview}
In the last class we studied the Balls in Bins problem and proved the max load bound of \(\theta (\frac{\log n}{\log \log n})\). Today, we look at the power of two choices, where for each ball, we look at two random bins and assign to the lesser loaded bin.

\section{Intuition}
Let \(v_i\) be the number of bins with at least \(i\) balls, it is easy to see that \(v_4 \leq \frac{n}{4}\). Therefore the probability that a ball will push a bin from (at least) 4 to 5 is a most: 
\[\left(\frac{v_4}{n}\right)^2 \leq \frac{1}{16}\] 
since the two choices need to be two of the \(v_4\) bins with at at least 4 balls. Then \(v_5 \approx \frac{n}{16}\). By the same argument, \[v_6 \leq n \left(\frac{v_5}{n}\right)^2 = \frac{n}{256}  \] and \[v_k \leq \frac{n}{2^{2^{k-1}}} \] which suggests that the max load is \(\theta(\log \log n)\)

\section{Analysis}
\textbf{Notations}
\begin{itemize}
  \item \(v_i(t) = \) number of bins of height \(\geq\)  i after \(t\) balls.
  \item \(h_t = \) height of the \(t\)-th ball.
\end{itemize}

\begin{claim}
\(\forall t \leq n, v_i(t) \leq \beta_i n\) with high probability (\(1 - \frac{1}{n^c} \)), where
\begin{itemize}
  \item \(\beta_4 = \frac{1}{4}\)
  \item \(\beta_{i+1} = 2\beta_i^2\)
\end{itemize}
\end{claim}

\begin{proof} 
By induction. 

Base case \(i = 4\) is trivial. 

Inductive Step. Let \(Y_t = 1\) if 
\begin{itemize}
  \item \(h_t \geq i + 1\)
  \item \(v_i(t-1) \leq \beta_i n\) 
\end{itemize}
(the first means that the \(t\)-th ball is on a `big' bin, the second means not failing on previous steps). We have:

\begin{align}
Pr(h_t \geq i+1) = \left(\frac{v_i(t-1)}{n}\right)^2\\
\implies Pr(Y_t) \leq \left(\frac{v_i(t-1}{n}\right)^2 \leq \beta_i^2\\
\implies E\left(\sum_{t=1}^n Y_t\right) \leq n \beta_i^2
\end{align}

\begin{figure}
\centering
\includegraphics[width = 0.8\textwidth]{Diagram1.jpeg}
\caption{A histogram of the height of the bins. The shaded area is the number of tall balls: \(\sum Y_t\)}
\label{fig}
\end{figure}


Let \(Q_i\) be the event that \(v_i(t) \leq \beta_i n, \forall t \) then:
\begin{align}
  \overline{Q_{i+1}} | Q_i \iff v_{i+1}(t) > \beta_{i+1} n | Q_i
\end{align}
and that the number of tall balls is at least the number of tall bins (see Figure \ref{fig}):
\begin{align}
\sum Y_t \geq v_{i+1}(t)
\end{align}
therefore:
\begin{align}
Pr(\overline{Q_{i+1}} | Q_i) \leq Pr( \sum_{t=1}^n Y_t \geq \beta_{i+1}n | Q_i)
\end{align}

We now need to bound \(Pr(\sum Y_t \geq 2n\beta_i^2)\). We will use Bernstein type inequality. Consider \(n\) coins, each with probability \(p\) and is \((\sqrt{p}, 1)\) sub-gamma. Their sum \(S\) is \((\sqrt{np}, 1)\) sub-gamma and:

\begin{align}
Pr(S \geq np + t) &\leq \mathrm{max}[  e^{t^2/(2np)} , e^{-\Omega(t)} ] \\
\implies Pr(S \geq 2np) &\leq e^{-\Omega(np)}
\end{align}


which is a good bound, except we can not (directly) use that on \(Y_i\)s since they are not independent. However, observe that 

\begin{align}
Pr(Y_t | Y_1 .. Y_{t-1}) \leq \beta_i^2
\end{align}
regardless of \(Y_1 .. Y_{t-1}\). So the \(Y_i\)s are \textit{stochastically dominated} by the \(Z_i\)s such that:
\begin{itemize}
  \item \(Pr(Z_i) = \beta_i^2\)
  \item \(Z_i \text{are independent}\)
\end{itemize}


\begin{framed}
\(Y\) being stochastically dominated by \(Z\).

We need to sample \((Y,Z)\) such that \(Y_i \leq Z_i\) always. Going through the ball in each stage, we want: \(Pr(Y_t) = p \leq \beta_i^2 = Pr(Z_t)\)

\((Y_t, Z_t)\) is sampled from
\begin{itemize}
  \item \((0,0)\) with prob \(1 - \beta_i^2\)
  \item \((1,1)\) with prob \(p\)
  \item \((0,1)\) with prob \(\beta_i^2 - p\)
\end{itemize}
\end{framed}

Use the Bernstein bound on \(Z\)s (instead of \(Y\)s), we have (for \(\beta_{i+1}n > \log(n)\)):

\begin{align}
Pr(\overline{Q_{i+1}}| Q_i) &\leq Pr(\sum_{t=1}^n Y_t \geq \beta_{i+1}n | Q_i) \\
&\leq e^{-\Omega(\beta_{i+1}n)}
\end{align}

Let \(E_i\) be the event that \(\sum Y_t \geq \beta_{i+1} n \). We have:
\begin{align}
Pr(E_i) < \frac{1}{n^c}\\
Pr(\overline{Q_{i+1}}| Q_i) \leq Pr(E_i|Q_i)
\end{align}
and need to bound \(Pr(\overline{Q_{i+1}})\). This problem will be added to Homework 2. Now, assume we have:
\begin{align}
Pr(\overline{Q_{i+1}}) \leq \frac{1}{n^c}
\end{align}
then
\begin{align}
Pr(\text{any }\overline{Q_{i+1}}) \leq \frac{1}{n^c}
\end{align}
\centering
\Large \textit{to be finished next class}

\end{proof}
\nocite{*}

\bibliographystyle{abbrv}
\bibliography{references}

\end{document}