\documentclass[12pt,letterpaper]{article}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{upquote}

\newcommand{\eps}{\epsilon}
\newcommand{\wh}{\widehat}
\newcommand{\R}{\mathbb{R}}
\newcommand{\norm}[1]{\|#1\|}
\newcommand{\abs}[1]{|#1|}
\DeclareMathOperator{\E}{\mathbb{E}}
\DeclareMathOperator{\poly}{poly}
\DeclareMathOperator*{\mean}{mean}
\DeclareMathOperator*{\median}{median}

\title{Problem Set 3}
\author{Randomized Algorithms}
\date{Due Friday, September 20}

% NOTE: this was probably too hard.
\begin{document}
\maketitle

\begin{enumerate}
\item{}  [Karger.]  Consider a sequence of $n$ unbiased coin
  flips, and look at the length of the longest contiguous sequence of
  heads.
  \begin{enumerate}
  \item Show that you are unlikely to see a sequence of length $c +
    \log_2 n$ for $c > 1$ (give a decreasing bound as a function of
    $c$).
  \item Show that with high probability you will see a sequence of
    length $\log_2 n - O(\log_2 \log_2 n)$. Note: this observation can
    be used to detect cheating. When told to fake a random sequence of
    coin tosses, most humans will avoid creating runs of this length
    under the mistaken assumption that they don’t look random.
  \end{enumerate}
\item Suppose we have sample access to a random variable $X$ with
  unknown mean $\mu$ and variance $\sigma^2$, and we want to find
  estimate $\mu$ to within $\pm \eps \sigma$.  That is, we sample
  $x_1, \dotsc, x_n \sim X$ and want to use the samples to produce an
  estimate $\wh{\mu}$ of $\mu$ such that
  \[
    \abs{\wh{\mu} - \mu} \leq \eps \sigma
  \]
  with probability $1-\delta$.
  \begin{enumerate}
  \item Show that the sample mean
    $\overline{x} = \frac{1}{n}(\sum_i x_i)$ works as long as
    $n > O(\frac{1}{\eps^2 \delta})$.
    % People have trouble with exp(-delta) ~ 1-delta
  \item Show that this is optimal: for every setting of $\eps$ and
    $\delta$, there exists a distribution $X$ for which the sample
    mean requires $\Omega(\frac{1}{\eps^2 \delta})$ samples to be
    $\eps \sigma$-close with probability $1-\delta$. \textbf{Hint
      (rot13):} K pna or ovanel.
  \item Now consider the median-of-means estimator: we split $n$ into
    $m = O(\log\frac{1}{\delta})$ blocks, each of length
    $B=O(1/\eps^2)$, and output
    \[
      \wh{\mu} := \median_{i \in [m]} \mean_{j \in [B]} x_{B(i-1) + j}.
    \]
    Show that this satisfies the guarantee with
    $n = O(\frac{1}{\eps^2} \log \frac{1}{\delta})$.
  \item Now, suppose that our sample $x_1, \dotsc, x_n$ were not
    independent, but negatively associated.  Would the same result
    hold?
  \end{enumerate}
\item Let $X_1, X_2$ be independent but not necessarily identically
  distributed random variables.  Let $\sigma_1, \sigma_2$ be a random
  permutation on $\{1, 2\}$.  Are the variables $Y_i = X_{\sigma_i}$
  negatively associated?
\end{enumerate}

\end{document}
