\documentclass[10pt]{book}
%%%%\usepackage{fullpage}
\usepackage{amsmath,amsfonts,latexsym,amssymb,epsf,psfrag,afterpage,makeidx,fancyhdr,soul,paralist,graphicx,setspace,tabularx}%,multicol,multirow}
\usepackage{tikz,tikz-qtree}
\usepackage{wasysym}
\usepackage[perpage,symbol]{footmisc}
%%%%latex cls ; dvips -k -T 7in,10in -o cls.ps cls.dvi ; ps2pdf cls.ps ; gv cls.pdf
\usepackage{hyperref}

\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{bm}
\usepackage{mathrsfs}
\usepackage{marvosym}
\usepackage{epstopdf}
\usepackage{tikz}

\usetikzlibrary{arrows}
\tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]

%\nofiles

\pagestyle{fancyplain}
\setlength{\paperheight}{10in}
\setlength{\paperwidth}{7in}
\setlength{\textwidth}{28pc}
\setlength{\headwidth}{31pc}
\setlength{\textheight}{49\baselineskip}
\setlength{\oddsidemargin}{3pc}
\setlength{\evensidemargin}{3pc}
\setlength{\voffset}{-1in}
\setlength{\topmargin}{3.5pc}
\setlength{\headheight}{12pt}

\setlength{\pltopsep}{6pt}
\setlength{\plitemsep}{2pt}

\setdefaultleftmargin{2pc}{1.5pc}{}{}{}{}

\newcommand{\kommentar}[1]{}
\newcommand{\comment}[1]{}

\newcommand\longpage[1][1]{\enlargethispage{#1\baselineskip}}
\newcommand\shortpage[1][1]{\enlargethispage{-#1\baselineskip}}

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{Section \thesection: #1}}
\renewcommand{\subsectionmark}[1]{\markright{Section \thesubsection: #1}}

\renewcommand\footnoterule{\vspace*{-6.5pt}\hrule width 14pc height 0.5pt \vspace*{6pt}}
\addtolength{\skip\footins}{10pt}

\lhead[\fancyplain{}{\thepage\hspace{0.5pc}$\bullet$\hspace{0.5pc}\rmfamily\leftmark}]{\fancyplain{}{}}
\rhead[\fancyplain{}{}]{\fancyplain{}{\rmfamily\rightmark\hspace{0.5pc}$\bullet$\hspace{0.5pc}\thepage}}
\cfoot{}

\newcommand{\parder}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pparder}[2]{\frac{\partial^2 #1}{\partial #2^2}}
\newcommand{\mparder}[3]{\frac{\partial^2 #1}{\partial #2 \partial #3}}

\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{exa}[thm]{Example}
\newtheorem{defi}[thm]{Definition}

\newtheorem{exe}[thm]{Problem}

\newtheorem{conj}[thm]{Conjecture}
\newtheorem{prop}[thm]{Proposition}
%\newtheorem{exe}[thm]{Exercise}
%\newtheorem{exeh}[thm]{Exercise\textsuperscript{(h)}}
%\newtheorem{exehr}[thm]{Exercise\textsuperscript{(hr)}}
\newtheorem{que}[thm]{Question}
\newtheorem{prob}[thm]{Problem}
\newtheorem{soln}[thm]{Solution}
\newtheorem{cla}{Claim}
\newtheorem{rek}[thm]{Remark}

\newcommand{\todo}[1]{\large\textbf{#1}\normalsize}
\newcommand{\mindex}[1]{\textbf{#1}\index{#1}}
\newcommand{\sindex}[2]{#2\index{#1!#2}}
\newcommand{\cfindex}[1]{\index{continued fraction!#1}}
\newcommand{\prindex}[1]{\index{probability!#1}}
\newcommand{\faindex}[1]{\index{Fourier analysis!#1}}
\newcommand{\rmtindex}[1]{\index{Random Matrix Theory!#1}}
\newcommand{\rzfindex}[1]{\index{Riemann zeta function!#1}}
\newcommand{\matindex}[1]{\index{matrices!#1}}
\newcommand{\vindex}[1]{\index{vector!#1}}
\newcommand{\cmindex}[1]{\index{circle method!#1}}
\newcommand{\roindex}[1]{\index{Roth's Theorem!#1}}
\newcommand{\nindex}{\index{NEEDS ATTENTION}}

\newcommand{\lett}[2]{{\rm #1}_{#2}}

\newcommand\bi{\begin{itemize}}
\newcommand\ei{\end{itemize}}

\newcommand\ben{\begin{enumerate}}
\newcommand\een{\end{enumerate}}
\newcommand{\ncr}[2]{{#1 \choose #2}}


\newcommand{\cs}{\spadesuit}
\newcommand{\cc}{\clubsuit}
\newcommand{\cd}{\diamondsuit}
\newcommand{\ch}{\heartsuit}

\newcommand{\ctan}{{\rm ctan}}
\newcommand{\ga}{\alpha}    %lowercase alpha
\newcommand{\gb}{\beta}      %lowercase beta
\newcommand{\gd}{\delta}    %lowercase delta
\newcommand{\gep}{\epsilon}  %lowercase epsilon
\newcommand{\G}{\Gamma}      %Capital Gamma
\newcommand{\g}{\gamma}      %lowercase gamma
\newcommand{\gL}{\Lambda}    %capital lamda
\newcommand{\gl}{\lambda}    %lowercase lambda
\newcommand{\gt}{\theta}    %lowercase theta

\newcommand{\twocase}[5]{#1 \begin{cases} #2 & \text{{\rm #3}}\\ #4
&\text{{\rm #5}} \end{cases}  }

\newcommand{\threecase}[7]{#1 \begin{cases} #2 & \text{\rm #3}\\ #4
&\text{\rm #5}\\ #6 & \text{\rm #7} \end{cases}  }


%\newcommand{\prob}[1]{{\rm Prob}(#1)}

\newcommand{\intii}{\int_{-\infty}^\infty}
\newcommand{\intzi}{\int_{0}^\infty}


\newcommand\be{\begin{equation*}}
\newcommand\ee{\end{equation*}}
\newcommand\bea{\begin{eqnarray*}}
\newcommand\eea{\end{eqnarray*}}

\newcommand\bel{\begin{equation}}
\newcommand\eel{\end{equation}}
\newcommand\beal{\begin{eqnarray}}
\newcommand\eeal{\end{eqnarray}}
\newcommand\bdm{\begin{displaymath}}
\newcommand\edm{\end{displaymath}}

\newcommand{\fof}{\frac{1}{4}}  %oneforth
\newcommand{\foh}{\frac{1}{2}}  %onehalf
\newcommand{\fot}{\frac{1}{3}}  %onethird

\newcommand{\<}{\left\langle}
\renewcommand{\>}{\right\rangle}


\newcommand{\mattwo}[4]
{\left(\begin{array}{cc}
                        #1  & #2   \\
                        #3 &  #4
                          \end{array}\right) }

\newcommand{\matthree}[9]
{\left(\begin{array}{ccc}
                        #1  & #2 & #3  \\
                        #4 &  #5 & #6 \\
                        #7 &  #8 & #9
                          \end{array}\right) }

\newcommand{\vectwo}[2]
{\left(\begin{array}{c}
                        #1    \\
                        #2
                          \end{array}\right) }


\newcommand{\vecfive}[5]
{\left(\begin{array}{c}
                        #1    \\
                        #2\\
                        #3 \\
                        #4 \\
                        #5
                          \end{array}\right) }


\newcommand{\dettwo}[4]
{\left|\begin{array}{cc}
                        #1  & #2   \\
                        #3 &  #4
                          \end{array}\right| }

\newcommand{\detthree}[9]
{\left|\begin{array}{ccc}
                        #1  & #2 & #3  \\
                        #4 &  #5 & #6 \\
                        #7 &  #8 & #9
                          \end{array}\right| }

\newcommand{\unif}[1]{{\rm Unif}(0,#1)}
\newcommand{\expd}[1]{{\rm Exp}(#1)}
\newcommand{\err}[1]{{\rm Err}\left(#1\right)}



\newcommand{\mmpar}[1]{%
\vadjust{\smash{\llap{\parbox[t]{\marginparwidth}{\vspace{-0.3in}\hspace{1.268in} #1}\kern .1in}}}}
\newcommand{\mmpard}[1]{%
\vadjust{\smash{\llap{\parbox[t]{\marginparwidth}{\vspace{-0.2in}\hspace{1.268in} #1}\kern .1in}}}}
\newcommand{\mmpardd}[1]{%
\vadjust{\smash{\llap{\parbox[t]{\marginparwidth}{\vspace{-0.1in}\hspace{1.268in} #1}\kern .1in}}}}

\providecommand{\abs}[1]{\lvert#1\rvert}

%\sodef\chap{}{.153em}{0pt}{.85em}
\sodef\chap{}{0pt}{0pt}{0pt}
\sodef\chapa{}{.1em}{0.5em}{.85em}
\sodef\chapb{}{.123em}{0.5em}{.85em}

\makeatletter
\renewcommand\@dotsep{1000}
\renewcommand*\l@section{\setlength{\baselineskip}{15pt}\@dottedtocline{1}{1.5em}{2.3em}}
\renewcommand*\l@subsection{\setlength{\baselineskip}{12pt}\@dottedtocline{2}{3.8em}{3.2em}}
\renewcommand\@chapapp{\hspace{-3pc}\chap{Chapter }}

\def\@makechapterhead#1{%
  \vspace*{7.5pc}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \hbox to \hsize{\raisebox{0pt}{\huge\bfseries\@chapapp\space\thechapter}\hspace{1pc}\leaders\hrule height 0.5pt depth 0pt\hfill}%\rule{50cm}{0.5pt}
        \par\nobreak
        \vskip 3pc
      \fi
    \fi
    \interlinepenalty\@M
    \hspace{-3pc}\huge\itshape #1\par\nobreak
    \vskip 2pc
  }}

\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \vspace*{7.5pc}{\hbox to \hsize{\raisebox{0pt}{\hspace{-3pc}\huge\bfseries\chap{Contents}}\hspace{1pc}\leaders\hrule height 0.5pt depth 0pt\hfill}\par\nobreak\vskip 2.2pc}\vspace{1pc} % added the last space to make first contents page nice
    \thispagestyle{empty}
    \@mkboth{Contents}{Contents}
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }

%\renewcommand{\section}{\font\myfont=anttb at 14pt\@startsection{section}{1}{-3pc}{-18pt}{12pt}{\myfont}}
%\renewcommand{\subsection}{\font\myfont=anttb at 12pt\@startsection{subsection}{2}{-3pc}{-12pt}{6pt}{\myfont}}
\def\@fancyhead#1#2#3#4#5{\@rodd\hbox to\headwidth{\fancy@reset
  \@fancyvbox\headheight{\hbox
    {\rlap{\parbox[b]{\headwidth}{\raggedright#2}}\hfill
      \parbox[b]{\headwidth}{\centering#3}\hfill
      \llap{\parbox[b]{\headwidth}{\raggedleft#4}}}}}\@lodd}
%\renewcommand{\headrule}{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
%    \hrule\@height\headrulewidth\@width 30pc\vskip-\headrulewidth}}
\renewenvironment{theindex}
               {\if@twocolumn
                  \@restonecolfalse
                \else
                  \@restonecoltrue
                \fi
                \columnseprule \z@
                \columnsep 35\p@
                \twocolumn[\vspace*{8.4pc}\hspace{0.0pc}\parbox{31pc}{\hbox to \hsize{\raisebox{0pt}{\hspace{0pc}\huge\bfseries\chap{Index}}\hspace{1pc}\leaders\hrule height 0.5pt depth 0pt\hfill}\par\nobreak\vskip 4pc}]
		\addcontentsline{toc}{chapter}{\numberline{}Index}
		\@mkboth{\indexname}%
                        {\indexname}%
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \let\item\@idxitem}
               {\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother

%\newcommand{\nb}{\marginpar[\hspace{1.299in}\includegraphics{Flag}]{}}
\newcommand{\ex}{\mmpar{\includegraphics{LifeSaver}}}
\newcommand{\exd}{\mmpard{\includegraphics{LifeSaver}}}
\newcommand{\exdd}{\mmpardd{\includegraphics{LifeSaver}}}
\newcommand{\nb}{\mmpar{\includegraphics{Flag}}}
\newcommand{\nbd}{\mmpard{\includegraphics{Flag}}}
\newcommand{\info}{\mmpar{\includegraphics{Wave}}}
\newcommand{\infod}{\mmpard{\includegraphics{Wave}}}
%\newcommand{\task}{\marginpar[]{\hspace{1.4in}\large{\boxed{\textrm{T}}}}}
%\newcommand{\task}{\marginpar{\vspace{-0.2in}\hspace{1.38in}\includegraphics[scale=1.5]{hiker}}}
\newcommand{\task}{\mmpar{\vspace{-0.2in}\hspace{0.07in}\includegraphics[scale=1.5]{hiker}}}


\newcommand{\lheq}{\stackrel{\textrm{l'H}}{=}}

\newcommand{\contd}{\emph{(continued)}}

\def\putunder#1#2{\mathrel{
\setbox0=\hbox{#1}\setbox1=\hbox{\scriptsize #2}
\dimen0=-0.5\wd0 \advance\dimen0 by -0.5\wd1
\dimen1=0.5\wd0 \advance\dimen1 by -0.5\wd1
\hbox{\box0\kern\dimen0%
\vbox to 0pt {\hbox{\lower 0.7em \box1}\vss}%
\kern\dimen1}
}}

\def\putunderl#1#2{\mathrel{
\setbox0=\hbox{#1}\setbox1=\hbox{\scriptsize #2}
\dimen0=-0.5\wd0 \advance\dimen0 by -0.5\wd1
\dimen1=0.5\wd0 \advance\dimen1 by -0.5\wd1
\hbox{\box0\kern\dimen0%
\vbox to 0pt {\hbox{\lower 0.4em \box1}\vss}%
\kern\dimen1}
}}

\def\putunderlc#1#2{\mathrel{
\setbox0=\hbox{#1}\setbox1=\hbox{\scriptsize #2}
\dimen0=-0.5\wd0 \advance\dimen0 by -0.5\wd1
\dimen1=0.5\wd0 \advance\dimen1 by -0.5\wd1
\hbox{\box0\kern\dimen0%
\vbox to 0pt {\hbox{\lower 0.6
em \box1}\vss}%
\kern\dimen1}
}}

\def\putunderla#1#2{\mathrel{
\setbox0=\hbox{#1}\setbox1=\hbox{\scriptsize #2}
\dimen0=-0.5\wd0 \advance\dimen0 by -0.5\wd1
\dimen1=0.5\wd0 \advance\dimen1 by -0.5\wd1
\hbox{\box0\kern\dimen0%
\vbox to 0pt {\hbox{\raise 0.2em \box1}\vss}%
\kern\dimen1}
}}

\def\putover#1#2{\mathrel{
\setbox0=\hbox{#1}\setbox1=\hbox{\scriptsize #2}
\dimen0=-0.5\wd0 \advance\dimen0 by -0.5\wd1
\dimen1=0.5\wd0 \advance\dimen1 by -0.5\wd1
\hbox{\box0\kern\dimen0%
\vbox to 0pt {\vss\hbox{\raise 0.7em \box1}}%
\kern\dimen1}
}}

\def\mylim#1{\putunderl{$\lim$}{$#1$}}
\def\mylima#1{\putunderla{$\lim$}{$#1$}}
\def\mylimc#1{\putunderlc{$\lim$}{$#1$}}
\def\blfootnote{\xdef\@thefnmark{}\@footnotetext}
\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
\def\leaderfill\leaders\hbox to 1em{\hss.\hss\hfill}


\DeclareMathAlphabet{\mathbi}{\encodingdefault}{\rmdefault}{\bfdefault}{\itdefault}
\DeclareMathOperator{\sech}{sech}
\DeclareMathOperator{\csch}{csch}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\arccsc}{arccsc}
\DeclareMathOperator{\lnbold}{\mathbf{ln}}

\newcommand{\pr}[1]{{\rm Prob}\left({#1}\right)}
\newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\C}{\ensuremath{\mathbb{C}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\eps}{\varepsilon}
\newcommand{\rea}{\ensuremath{\textrm{Re}}}
\newcommand{\ima}{\ensuremath{\textrm{Im}}}
\newcommand{\Rea}{\ensuremath{\textrm{Re }}}
\newcommand{\Ima}{\ensuremath{\textrm{Im }}}
\newcommand{\E}{{\mathbb E}} % expectation
\newcommand{\I}{1\!\!1} % indicator function

\def\indistrHIGH{\,{\buildrel d \over \rightarrow}\,}
\def\indistr{\,{\indistrHIGH}\,}

\def\inDISTRHIGH{\,{\buildrel D \over \rightarrow}\,}
\def\inDISTR{\,{\inDISTRHIGH}\,}

\def\inPROBHIGH{\,{\buildrel P \over \rightarrow}\,}
\def\inPROB{\,{\inprobHIGH}\,}


\def\inprobHIGH{\,{\buildrel p \over \rightarrow}\,}
\def\inprob{\,{\inprobHIGH}\,}

\def\inalmostsureHIGH{\,{\buildrel a.s. \over \rightarrow}\,}
\def\inalmostsure{\,{\inalmostsureHIGH}\,}


\newcommand{\N}{\mathbb{N}}
%\newcommand{\R}{\mathbb{R}}
%\newcommand{\C}{\mathbb{C}}
%\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
%\newcommand{\Re}{{\mathfrak{Re}}}
%\newcommand{\Im}{{\mathfrak{Im}}}

\newcommand{\qed}{\hfill $\Box$\\ }
\newcommand{\sol}{\noindent \emph{Solution:\ }}
\newcommand{\trm}[1]{\textrm{#1}}
\newcommand{\tbf}[1]{\textbf{#1}}

%%%%%NEW COMMANDS

\newcommand{\keybox}[1]{\begin{center}{\boxed{\large #1}}\end{center}}
\newcommand{\seq}[1]{\{#1_n\}_{n=1}^\infty}

\newcommand{\proof}{\noindent \emph{Proof:\ }}

\newenvironment{fminipage}%
{\begin{Sbox}\begin{minipage}}%
{\end{minipage}\end{Sbox}\fbox{\TheSbox}}

\newcommand{\bigbox}[1]{
%\begin{table}[h]
\begin{center}
\fbox{%
\begin{minipage}{\textwidth}
#1
\end{minipage}
}
\end{center}
%\end{table}
}

\widowpenalty=10000
\clubpenalty=250

\makeindex

\title{The Probability Lifesaver:\\ Order Statistics and the Median Theorem}
\author{Steven J. Miller}


\begin{document}

\maketitle
\tikzstyle{level 1}=[level distance=5cm, sibling distance=3cm]
\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]

% Define styles for bags and leafs
\tikzstyle{bag} = [text width=4em, text centered]
\tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt]

\pagenumbering{roman}
\markboth{}{}

%\include{problifesavertitle}
%\include{problifesavertitlelong}

\tableofcontents
\setlength{\baselineskip}{12pt}

%\include{problifesaverNoteToReviewers}
%\include{problifesaverchTofC}

%\include{problifesaverch0}

% MUST FIX THIS LATER!!!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%\setlength{\baselineskip}{12pt}
%%%%\include{ch0a}

\setlength{\oddsidemargin}{3pc}
\setlength{\evensidemargin}{3pc}
\setlength{\textwidth}{28pc}
%\include{problifesaveracknowl}
%\include{blpage}
%\include{problifesavertitleshort}
%\include{blpage}
\pagenumbering{arabic}
\setcounter{page}{1}
\setcounter{chapter}{0}
\markboth{}{}
\setlength{\baselineskip}{12pt}
\setlength{\oddsidemargin}{3pc}
\setlength{\evensidemargin}{3pc}
\setlength{\textwidth}{28pc}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\huge
\newpage
\noindent Greetings again!

\ \\

\normalsize

In this supplemental chapter we develop the theory of order statistics in order to prove The Median Theorem. This is a beautiful result in its own, but also extremely important as a substitute for the Central Limit Theorem, and allows us to say non-trivial things when the CLT is unavailable.

\newpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

\chapter{Order Statistics and the Median Theorem}\label{chap:orderstatsmedianthm}

The Central Limit Theorem is one of the gems of probability. It's easy to use and its hypotheses are satisfied in a wealth of problems. Many courses build towards a proof of this beautiful and powerful result, as it truly is `central' to the entire subject.

Not to detract from the majesty of this wonderful result, however, what happens in those instances where it's unavailable? For example, one of the key assumptions that must be met is that our random variables need to have finite higher moments, or at the very least a finite variance. What if we were to consider sums of Cauchy random variables? Is there anything we can say?

This is not just a question of theoretical interest, of mathematicians generalizing for the sake of generalization. The following example from economics highlights why this chapter is more than just of theoretical interest. For years many financial models assumed that price changes were drawn from normal random variables; however, Mandelbrot (of fractal geometry fame) and others have argued that these models are inconsistent with real world data. They were led to this belief by looking at large fluctuation days; the number of such days with very large changes was magnitudes higher than normal theory predicts. In other words, the probability of observing as many days with such high percentage drops in the major stock markets under the assumption that price changes come from normal distributions is so small that this hypothesis must be discarded. In its place they suggest a complicated model, which at its core has Cauchy distributions and infinite variance.

Thus, if we (or our friends or colleagues) care about economics, it might be more than just an academic question as to what replaces the Central Limit Theorem when the variances are infinite. The replacement involves, not the mean, but the median. \\

\bigbox{\noindent The \textbf{median}\index{median} $\widetilde{\mu}$ of a random variable $X$ are all points $x$ such that $${\rm Prob}(X \le x) \ \ge \ \frac12 \ \ \ {\rm and}\ \ \ {\rm Prob}(X \ge x) \ \ge \ \frac12.$$ If our density is continuous, any point $x$ such that half the probability occurs before $x$ and half occurs after $x$ is a median. We'll discuss this definition in much greater detail below.} \ \\ \

There is much that can be said and proved, at least in the special case when our random variables are symmetric about some point (typically the probabilities will be symmetric about the origin, so that the probability density $p$ satisfies $p(x) = p(-x)$). For such distributions the median is the same as the mean. Thus instead of looking at the sample mean we can study the sample median; the advantage is that there are situations where the sample median converges to a nice distribution while the sample mean does not.

The exposition gets a bit involved; to simplify the descriptions, it's convenient to use big-Oh notation\index{big-Oh notation}. We describe this in great detail in \textbf{ADD REF}. If you haven't seen this notation before, you should spend some time reading \textbf{ADD REF} now; if you have seen this before, the quick summary below should suffice.

\bigbox{
\begin{defi}[Big-Oh\index{big-Oh notation} Notation] $A(x) = O(B(x))$, read ``$A(x)$
is of order (or big-Oh) $B(x)$'', means there is a $C>0$ and an
$x_0$ such that for all $x \ge x_0$, $|A(x)| \le C\, B(x)$. This is
also written $A(x) \ll B(x)$ or $B(x) \gg A(x)$. \end{defi}
} \ \\

Big-Oh notation is a convenient way to handle lower order terms. For \ex
example, if we write $F(x) = x^5 + O(x^2)$, this means that as $x$
tends to infinity, the main term of $F(x)$ grows like $x^5$, and the
correction (or error) terms are at most some constant times $x^2$. Useful examples include for $r, \gep > 0$, as $x\to\infty$ we have
$x^r = O(e^x)$ and $\log x = O(x^\gep)$.\\ \

The main result is:

\bigbox{\noindent \textbf{Median Theorem:} Let a sample of size  $n=2m+1$ with $n$ large be taken from an
infinite population with a density function $f(\tilde x)$ that is
nonzero at the population median $\tilde\mu$ and continuously
differentiable in a neighborhood of $\tilde\mu$. The sampling
distribution of the median is approximately normal with mean
$\tilde\mu$ and variance $\frac{1}{8f(\tilde\mu)^2m}$.
}\ \\ \

In many cases, this theorem is a good substitute for the Central Limit Theorem. Note the commonalities between the two. Both involve an average of sample values, and both have a sample statistic converging to a normal distribution. There are, however, major differences between the two. The most glaring, of course, is that we're looking at different quantities (the mean versus the median). The next is that the Median Theorem allows the density to have infinite variance. Finally, it's worth noting that the Central Limit Theorem requires us to standardize our sample statistic; no such standardization is required here.

Before developing the analogue of the Central Limit Theorem for the median, we study a subject of interest in its own right, order statistics. These will be essential in our analysis of the median. In this chapter we'll use results on the multinomial distribution, Taylor series expansions, and Stirling's formula; you should consult those sections of the book if you have any questions on these.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Definition of the Median}

\noindent \emph{Key points for this section:}

\ben

\item The definition of the median.

\item Examples of finding the median.

\item Applications to estimating means.

\een

\ \\

The definition of the median is one of the most cumbersome statements you'll find about a concept that seems obvious. It's quite unfortunate, as the informal definition, which works in many cases, sadly fails in some cases; this failure requires us to have the wordy monstrosity below.

The quick and painless definition of the median is the point where half the probability comes before it and half comes after it. As mentioned above, this definition isn't quite right, but it does express the general idea quickly. As always, we'll consider our densities as either being discrete or continuous. We'll first look at some examples and use those to get a better sense as to what the right definition of median should be.

Let's \ex study a discrete distribution first. Imagine we have a fair die. Then the possible outcomes are 1, 2, 3, 4, 5 and 6, and each occurs with probability 1/6. We want to find a value $\widetilde{\mu}$ such that half the probability occurs before $\widetilde{\mu}$ and half occurs afterwards. Looking at a plot of the cumulative distribution function (which we give in Figure \ref{fig:MedianFairDie}), we see that \emph{any} number in $[3,4)$ works; note we include the left endpoint but not the right endpoint.

\begin{figure}
\begin{center}
\scalebox{1}{\includegraphics{MedianFairDie.eps}}
\caption{\label{fig:MedianFairDie} Plot of the cumulative distribution function (CDF) for a fair die. Note the CDF is zero for $x < 1$, is a nice step function for $1 \le x < 7$, and is identically 1 for $x \ge 7$.  }
\end{center}\end{figure}

Why? Let's take $x$ to be a positive real number. Then $${\rm Prob}({\rm die\ is\ at\ most\ } x) \ = \ \sum_{n = 1 \atop n \le x}^6 \frac16.$$ This means that for any $x \in [3,4)$, the probability of being at most $x$ is just the probability of being either a 1, 2 or 3; this is just $1/6 + 1/6 + 1/6$ or 1/2.\\ \

There are \nb a lot of important things to learn from the above example. The first is that the median isn't always unique; there could be a range of values. Second, the medians don't have to generate an open interval or a closed interval; our example above is an open interval.\\ \

Let's \ex look at a more complicated example. We'll assume the only possible outcomes are 1, 2, 3, 4, 5 and 6, and that ${\rm Prob}(X = n) = n/21$. This is clearly a probability density, as the values are all non-negative and sum to 1. We may interpret this by viewing this as a study of a weighted die. We plot the cumulative distribution function in Figure \ref{fig:MedianWeightedDie}.

\begin{figure}
\begin{center}
\scalebox{1}{\includegraphics{MedianWeightedDie.eps}}
\caption{\label{fig:MedianWeightedDie} Plot of the cumulative distribution function (CDF) for a weighted die, where the probability of rolling an $n$ is $n/21$. Note the CDF is zero for $x < 1$, is a nice step function for $1 \le x < 7$, and is identically 1 for $x \ge 7$.  }
\end{center}\end{figure}

We see $${\rm Prob}(X < 5) \ = \ \frac1{21} + \frac{2}{21} + \frac{3}{21} + \frac{4}{21}\ = \ \frac{10}{21} \ \approx \ 0.47619.$$ Thus no value less than 5 can be the median, as the probability of being \emph{strictly} less than 5 is less than 50\%. Similarly, we see $${\rm Prob}(X > 5) \ = \ \frac6{21} \ \approx \ 0.285714.$$ Thus no value 5 or larger can be the median! Only one possibility is left, namely that 5 is the median, and the median is unique in this problem. In this case, we have $${\rm Prob}(X \le 5) \ = \ \frac{15}{21} \ \approx \ 0.714286 \ \ \ {\rm and} \ \ \ {\rm Prob}(X \ge 5) \ = \ \frac{11}{21} \ \approx \ 0.52381.$$ \ \\

Notice how different the answer is in the second example to the first. With the weighted die, there is a unique median. The lesson to be gleaned from all of this is that, unfortunately, what the median is can depend wildly on the distribution. Sometimes there is a unique median; sometimes there is an interval of medians.

For the continuous distributions that we meet in a typical probability course, the situation is fortunately much nicer. In fact, as long as the density never vanishes except on an interval of the form $(-\infty, a)$, $(-\infty, a]$, $[b, \infty)$ or $(b, \infty)$, there is a unique median! Unlike the discrete case, for continuous densities the cumulative distribution function is continuous. This means there are no jumps, and it's the jumps that caused all the headaches above!

Let's \ex take one of the standard favorites, the exponential distribution with density $$\twocase{f(x) \ = \ }{e^{-x}}{if $x \ge 0$}{0}{otherwise.}$$ The cumulative distribution is easily calculated; it's \be \twocase{F(x) \ = \ \int_{-\infty}^x f(t) dt \ = \ }{0}{if $x \le 0$}{1-e^{-x}}{if $x \ge 0$.} \ee The median is the value $\widetilde{\mu}$ such that $F(\widetilde{\mu}) = 1/2$. For this density, that means $$1 - e^{-\widetilde{\mu}} \ = \ \frac12.$$ which after some algebra is seen to be $\widetilde{\mu} = \log 2$.\\ \

We \ex end with one last example to show that things be annoying for continuous random variables as well. Consider the density depicted in Figure \ref{fig:MedianContTriangles},
\begin{figure}
\begin{center}
\scalebox{1}{\includegraphics{MedianContTriangles.eps}}
\caption{\label{fig:MedianContTriangles} Plot of the density function $f(x) = \frac14 - \frac14 \left| |x| - 2\right|$ for $1 \le |x| \le 3$ and 0 otherwise.}
\end{center}\end{figure}
with cumulative distribution function given in Figure \ref{fig:MedianContTrianglesCDF}.
\begin{figure}
\begin{center}
\scalebox{1}{\includegraphics{MedianContTrianglesCDF.eps}}
\caption{\label{fig:MedianContTrianglesCDF} Plot of the cumulative distribution function for the density $f(x) = \frac14 - \frac14 \left| |x| - 2\right|$ for $1 \le |x| \le 3$ and 0 otherwise.}
\end{center}\end{figure}
Note that there is no unique median; any number in $[-1,1]$ is a median. This degeneracy is due to the fact that there is \emph{no} probability of taking on a value in $[-1,1]$, and thus the cumulative distribution function is flat from $-1$ to $1$. \\ \

To sum up, even though we would like to think of the median as that point where half the probability falls before and half falls after, this definition isn't quite right. For most distributions, either there is no unique median, or there is a median but the probabilities are not 50\%.

We end with a very important observation:

\bigbox{Let $X$ be a random variable with density $p$ that is symmetric about its mean $\mu$; this means $p(\mu-t) = p(\mu+t)$. Then the median $\widetilde{\mu}$ equals the mean $\mu$.
} \ \\

The utility of this point of view will become more and more apparent as we proceed through the chapter. For distributions that are symmetric about the mean, if we can estimate the median then we get for free an estimate of the mean! \\ \

As always, \ex whenever we're looking for an example of a probability density that has a mean but no variance, we should immediately think of a Cauchy distribution (or a cousin). For example, consider the density $$f(x) \ = \ \frac1{\pi} \frac1{1 + (x-\mu)^2}.$$ It is debateable as to whether or not this distribution has a mean. If it were to have one, it would clearly be $\mu$. Why might it not have a mean? The problem is what does $$\intii x f(x) dx$$ mean? Everything is fine if we interpret the integral as $$\lim_{A\to\infty} \int_{-A}^A x f(x) dx,$$ as in this case it's a finite integral of an odd function, and thus zero; if however we interpret it as $$\lim_{A,B\to\infty} \int_{-A}^B x f(x) dx$$ then the answer depends on how $A$ and $B$ tend to infinity. For example, if $B = 2A$ then the integral is $$\lim_{A\to\infty}\int_A^{2A} \frac{x}{\pi(1+(x-\mu)^2)} dx.$$ For $x$ large, the integrand is essentially $1/\pi x$, and thus the integral diverges. Thus, annoying as it is to say it, the Cauchy distribution might not even have a mean; however, it does have a median, and the median is readily seen to be $\mu$. Thus the median can serve as a surrogate to the mean.\\ \

If \ex the previous example felt a bit unsatisfying as the mean didn't even exist, consider instead $$g(x) \ = \ \frac{3\sqrt{3}}{4\pi} \frac1{1+|x-\mu|^3}.$$ It turns out $g$ is a probability density. While it's clearly non-zero, it's not at all apparent that it integrates to 1. The easiest way to see this is to use Cauchy's residue theorem from Complex Analysis, but this is heavy machinery. Fortunately, it's clear that if we consider $$h(x) \ = \ \frac{C}{1+|x-\mu|^3}$$ then there is some choice of $C$ such that this integrates to 1, namely $$C \ = \ \left( \intii \frac1{1+|x-\mu|^3} dx \right)^{-1}.$$ There is some constant that works; the actual value is immaterial. Now the mean clearly exists, as its defining integral is $$\intii \frac{3\sqrt{3}}{4\pi} \frac{x}{1+|x-\mu|^3} dx;$$ the integrand decays like $1/x^2$ and thus there are no convergence issues. Unfortunately this distribution has infinite variance, which means the Central Limit Theorem won't be available to estimate its mean. We'll see below, however, that we \emph{can} estimate the median, and as the median and the mean are equal, we can use the median estimate for the mean.





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Order Statistics}

\noindent \emph{Key points for this section:}

\ben

\item The definition of order statistics.

\item Finding the densities of order statistics.

\een

\ \\


Suppose that the random variables $X_1,X_2,\dots, X_n$ constitute a
sample of size $n$ from an infinite population with continuous
density. Often it's useful to reorder these random variables
from smallest to largest. In reordering the variables, we \nb
rename them so that $Y_1$ is a random variable whose value is the
smallest of the $X_i$, $Y_2$ is the next smallest, and so on, with
$Y_n$ the largest of the $X_i$. $Y_r$ is called the
$r$\textsuperscript{th} \textbf{order statistic}\index{order statistic} of the sample.

We write this more explicitly as $$Y_1 \ = \ \min_i(X_1,\dots,X_n), \ \dots, \ Y_n \ = \ \max_i (X_1,\dots, X_n).$$ If we had $$X_1\ =\ 5,\ X_2\ =\ 23,\ X_3\ =\ 1,\ X_4\ =\ 44,\ X_5\ =\ 6,$$ then \be Y_1\ =\ 1,\ Y_2\ =\ 5,\ Y_3 \ = \ 6,\ Y_4 \ = \ 23,\ Y_5 \ = \ 44.\ee

There are many reasons we might want to know all we can about these order statistics. For three of these the applications are fairly obvious, namely for $Y_1$ (the smallest value), $Y_n$ (the largest value), and the median. If $n$ is odd the median is just $Y_{n/2+1}$, while if $n$ is even the median is any value in $[Y_{n/2}, Y_{n/2+1}]$. We'll give just one real world reason. Imagine we're building an elevator or a bridge, and our random variables are the weight on the bridge at various times during the day. We should be very concerned with how much weight it can bear. This would thus be a situation where we care about the distribution of the maximum.

OK. You're hopefully now somewhat convinced that we care about these order statistics. How do we find them? It turns out that we can derive an expression for the probability density of the $r$\textsuperscript{th} order statistic.

\bigbox{
\begin{thm}\label{thm:orderstat}
For a random sample of size $n$ from an infinite population having
values $x$ and continuous density $f(x)$, the probability density of the
$r$\textsuperscript{{\rm th}} order statistic $Y_r$ is given by
\begin{equation}
g_r(y_r)\ =\ \frac{n!}{(r-1)!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1}f(y_r)\left[\int_{y_r}^{\infty}f(x)\,
dx\right]^{n-r}. \nonumber\
\end{equation}
\end{thm}
}

The theorem holds under weaker conditions than stated above; we can replace continuity with many things, such as the density being bounded. We'll phrase it as we have above as this is general enough to cover many cases of interest, and leads to slightly easier proofs.

As always, our first thought after encountering such a long and involved formula is to explore some special cases. The simplest is to imaging that $n=1$. If this happens, then there is only one possible order statistic, namely $r=1$, and the density collapses to $f(y_1)$. This follows from some algebra, using $0! = 1$ and anything raised to the zeroth power is 1.

We should look for some other simple tests, as the one above feels like cheating; we're not really looking at order statistics if $n$ is just 1! Thus, let's consider $n \ge 2$ and compare the densities of $Y_1$ and $Y_n$. There are a lot of commonalities between the two. In each case the ratio of factorials equals $n$, both have a lone evaluation of $f$, and both have just one of the integrals raised to a non-zero power. To highlight the commonalities and differences, we use the same dummy variable for each, and find \bea f_1(y) & \ = \ & n f(y) \left(\int_y^\infty f(x) dx\right)^{n-1} \nonumber\\ f_n(y) & \ = \ & n f(y) \left(\int_{-\infty}^y f(x) dx\right)^{n-1}. \eea Let's look at this and try and get a feel for what it's saying. In situations like this, it's a good idea to go for the extremes; imagine $y$ is near infinity near negative infinity. If $y$ is very large, then $\int_y^\infty f(x)dx$ is very small, while $\int_{-\infty}^y f(x)dx$ is very close to 1. Thus, for $y$ large, $f_1(y)$ is much smaller than $f_n(y)$. If instead we looked at $y$ near negative infinity, we would find $f_1(y)$ is much larger than $f_n(y)$. This makes perfect sense! Clearly $Y_1 \le Y_n$, as the smallest value cannot exceed the largest! Thus we expect more of the mass of $Y_1$ to occur for `small' $y$ than $Y_n$, and similarly for large $y$ we expect $Y_n$ to have more mass.

It's good advice to always try quick arguments like this whenever you see a theorem. Test it. Look at special cases. This is a great way to get a feel for what it's saying. Only after playing with the formula should you turn to the proof. Speaking of the proof, it's sadly a little long and technical in places. It's fine to just skim it (or even skip it). We chose to include the proof as it highlights a lot of the powerful methods used to prove probability results in the field.\\ \

\noindent \emph{Proof of Theorem \ref{thm:orderstat}:}
Let $h$ be a positive real number. We divide the real line into
three intervals: $(-\infty,y_r)$, $[y_r,y_r+h]$, and
$(y_r+h,\infty)$. You should think of $h$ as a \emph{very} small quantity which tends to zero.

The main idea of our proof is the following: let's compute the probability that $r-1$ values lie in the first interval, one lies in the middle and $n-r$ lie in the last. We would like to say that is just $${\rm Prob}(Y_r \in [y_r, y_r+h]) \ = \ \int_{y_r}^{y_r+h} g_r(y_r) dy_r;$$ unfortunately, we can't. The problem is that we could have two or three or even more of the random variables in $[y_r, y_r+h]$; if for example exactly two were in the middle interval then our calculation above would be slightly off. This isn't too big of an issue, though. We'll see that it's very unlikely to have two or more values in this interval, as it's of size $h$ with $h\to 0$. A careful analysis will show that we don't have to worry about this case in the limit. We'll then use the Mean Value Theorem to conclude that the integral is essentially $g_r(y_r) h$ plus something very very small, and from this we'll get the claimed density.

Now, to the details! We first find the probability that $Y_r$
falls in the middle of these three intervals, and \emph{no other value
from the sample falls in this interval}. In order for this to be the
case, we must have $r-1$ values falling in the first interval, one
value falling in the second, and $n-r$ falling in the last interval. We need a basic fact about multinomial distributions (see \textbf{ADD REF\ref{app:multinomial}}). You should review that section if the argument here seems incomplete. We have $n$ values, $X_1, \dots, X_n$. We need to choose exactly $r-1$ to lie in the first interval, $1$ in the middle, and $n-r$ in the last. There are $\ncr{n}{r-1}$ ways to choose the $r-1$ values to lie in the first interval. Of the remaining $n-(r-1)$ values, we have to choose 1 to lie in the middle; there are $\ncr{n-(r-1)}{1}$ ways to do this. Finally, we have $n-r$ remaining values, all of which lie in the last interval; there is just $\ncr{n-r}{n-r}$ ways to do that. Combining all these pieces, we have the combinatorial piece of the density: the number of ways to have exactly $r-1$ in the first interval, 1 in the middle and $n-r$ in the last is just \bea \ncr{n}{r-1} \ncr{n-(r-1)}{1} \ncr{n-r}{n-r} & \ = \ & \frac{n!}{(r-1)!(n-(r-1))!} \cdot \frac{(n-(r-1))!}{1!(n-r)!}\nonumber\\ & \ = \ & \frac{n!}{(r-1)!(n-r)!};\eea this is also the multinomial coefficient $\ncr{n}{r-1,1,n-r}$ (though we don't really need this for our proof).

We've made good progress. We've shown that
\beal\label{eq:probjustyr}
& & {\rm Prob}(Y_r \in [y_r, y_r+h]\ {\rm and}\ Y_i \neq
[y_r,y_r+h]\ {\rm if}\ i\neq r) \ = \ \nonumber\\ & &
\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1} \left[\int_{y_r}^{y_r+h}f(x)\,
dx\right]^{1}\left[\int_{y_r+h}^{\infty}f(x)\, dx\right]^{n-r}. \nonumber\\ & & \  \nonumber\\
\eeal

We need also consider the case of two or more of the $Y_i$ lying in
$[y_r,y_r+h]$. This is the most technical part of the argument. We'll briefly describe the answer now, and save the full details for later. The idea is that this probability must be small. What do we mean by small? We mean it must be of order $h^2$ or smaller, which we write as $O(h^2)$. This means there is some universal constant $C$ such that, for all $h$ sufficiently small, the probability is at most $Ch^2$. The probability any one value lies in this interval is just $\int_{y_r}^{y_r+h} f(x)dx$, and this integral is of size $h$; thus `roughly' the probability of at least two being in this interval should be the square of this. Again, this is merely a sketch; we'll give the full details for those who wish them at the end. Let's just accept this for now and move on with the rest of the proof.

The consequence of the arguments above is that we may remove the constraint that
exactly one $Y_i \in [y_r,y_r+h]$ in \eqref{eq:probjustyr} at a cost
of at most $O(h^2)$. For our purposes, it doesn't matter if there's exactly one or instead several values in this interval; as long as there is at least one then $Y_r$ is in this interval. We thus find that \bea\label{eqn:multinomial} & &  {\rm
Prob}(Y_r \in [y_r, y_r+h]) \ = \  \nonumber\\ & &
\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1} \left[\int_{y_r}^{y_r+h}f(x)\,
dx\right]^{1}\left[\int_{y_r+h}^{\infty}f(x)\, dx\right]^{n-r}\nonumber\\ & & \ \ + \
O(h^2).\nonumber \eea

We now apply the Mean Value Theorem. If $F$ is an
anti-derivative of $f$, then the Mean Value Theorem applied to $F$ can be written either as
\be \frac{F(b) - F(a)}{b-a} \ = \ F'(c) \nonumber\ \ee or \be
\int_a^b f(x)dx \ = \ (b-a) \cdot f(c).\nonumber\ \ee. We find that for some
$c_{h,y_r}$ with $y_r\le c_{h,y_r}\le y_r+h$, we have
\begin{equation}
\int_{y_r}^{y_r+h}f(x)\, dx\ =\ h\cdot f(c_{h,y_r}). \label{eqn:mvt}
\end{equation} We denote the point provided by the Mean Value
Theorem by $c_{h,y_r}$ in order to emphasize its dependence on $h$
and $y_r$.

We can substitute this result into the expression in
\eqref{eqn:multinomial}. We divide the result by $h$ (the length of
the middle interval $[y_r,y_r+h]$), and consider the limit as $h\to
0$:
\beal\label{eq:probyrlim}
& & \lim_{h\to 0} \frac{{\rm Prob}(Y_r \in [y_r,y_r+h])}{h}\nonumber\\ &\ =\
&\lim_{h\to
0}\frac{\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1}\left[\int_{y_r+h}^{\infty}f(x)\,
dx\right]^{1}\left[\int_{y_r+h}^{\infty}f(x)\, dx\right]^{n-r}}{h} \nonumber\\ & & \ \  + \ \lim_{h\to 0} \frac{O(h^2)}{h}\nonumber \\
&=&\lim_{h\to
0}\frac{\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1}h\cdot f(c_{h,y_r})\left[\int_{y_r+h}^{\infty}f(x)\,
dx\right]^{n-r}}{h}\nonumber
\\
&=&\lim_{h\to
0}\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1}f(c_{h,y_r})\left[\int_{y_r+h}^{\infty}f(x)\,
dx\right]^{n-r}\nonumber
\\
&=&\frac{n!}{(r-1)!1!(n-r)!}\left[\int^{y_r}_{-\infty}f(x)\,
dx\right]^{r-1} f(y_r)\left[\int_{y_r}^{\infty}f(x)\,
dx\right]^{n-r}.
\eeal

Thus the proof is reduced to showing that the left hand side above
is $g_r(y_r)$. Let $g_r(y_r)$ be the probability density of $Y_r$.
Let $G_r(y_r)$ be the cumulative distribution function of $Y_r$.
Then \be {\rm Prob}(Y_r \le y) \ = \ \int_{-\infty}^y g_r(y_r)dy_r \
= \ G_r(y),\nonumber\ \ee and $G_r'(y) = g_r(y)$. Thus the left hand side of
\eqref{eq:probyrlim} equals \bea \lim_{h\to 0} \frac{{\rm Prob}(Y_r
\in [y_r,y_r+h])}{h}&\ =\ &\lim_{h\to 0} \frac{G_r(y_r+h) -
G_r(y_r)}{h} \ = \ g_r(y_r),\nonumber\ \eea where the last equality follows
from the definition of the derivative. This completes the proof.
\qed


The \nb technique employed in this proof is a common method
for calculating probability densities. We first calculate the
probability that a random variable $Y$ lies in an infinitesimal
interval $[y,y+h]$. This probability is $G(y+h) - G(y)$, where $g$
is the density of $Y$ and $G$ is the cumulative distribution
function (so $G' = g$). The definition of the derivative yields \be
\lim_{h\to 0}\frac{{\rm Prob}(Y \in [y,y+h])}{h} \ = \ \lim_{h\to
0}\frac{G(y+h)-G(y)}{h} \ = \ g(y).\nonumber\ \ee \ \\

As \info promised, we now turn to showing that there is negligibly small probability of two or more values of the $X_i$'s lying in the interval $[y_r, y_r+h]$. This part may be safely skipped, as it's the technical justification for one of the steps in the proof. Using the law of total probability, this is just 1 minus the probability that either none of the $X_i$'s lie in this interval or exactly one does. Thus this probability is \beal\label{eq:probcareaboutorderstat} & & 1 - \left(\int_{x \not\in [y_r,y_r+h]} f(x)dx\right)^n\nonumber\\ & & \ \ \ \ \ \ -\ \ncr{n}{1} \left(\int_{x \in [y_r,y_r+h]} f(x)dx\right) \cdot \left(\int_{x \not\in [y_r,y_r+h]} f(x)dx\right)^{n-1}.  \eeal To evaluate the above, we use $$\int_{x \not\in [y_r,y_r+h]} f(x)dx \ = \ 1 - \int_{x=y_r}^{y_r+h} f(x)dx. $$ It is here that we finally start using our assumptions. As we're assuming $f$ is continuous, a result from analysis gives that it's bounded on the interval $[y_r, y_r+1]$ by some number, say $B$. The integral is therefore at most $Bh$; let's let $\mathcal{I}(h)$ denote the value of this integral: $$ \mathcal{I}(h) \ = \ \int_{x=y_r}^{y_r+h} f(x)dx.$$ Substituting into \eqref{eq:probcareaboutorderstat} gives that the probability of two or more of the $X_i$'s being in the interval is \bea & & 1  - \left(1 - \mathcal{I}(h)\right)^n - n \mathcal{I}(h)\left(1 - \mathcal{I}(h)\right)^{n-1} \nonumber\\ & = \ & 1 - \left(1 - n\mathcal{I}(h) + \ncr{n}{2} \mathcal{I}(h)^2 + \cdots \right) - n \mathcal{I}(h) \left(1 - \ncr{n-1}{1} \mathcal{I}(h) + \cdots\right) \nonumber\\ &=& 1 - 1 + n\mathcal{I}(h) - \ncr{n}{2} \mathcal{I}(h)^2 + \cdots -n\mathcal{I}(h) + n\ncr{n-1}1 \mathcal{I}(h)^2 + \cdots \nonumber\\ &=& B_2 \mathcal{I}(h)^2 + B_3 \mathcal{I}(h)^3 + \cdots + B_n \mathcal{I}(h)^n.  \eea Notice that
the constant term canceled, the $\mathcal{I}(h)$ term canceled, and all that remains is terms with $\mathcal{I}(h)$ to the second or higher power. We'll spare you the rest of the details, but clearly as $h\to 0$ the sum is dominated by the $\mathcal{I}(h)^2$ piece, and thus there is some constant $B$ (which of course can depend on $n$, $r$, and $y_r$) such that the probability of two or more of the $X_i$'s lying in $[y_r, y_r+h]$ is $O(h^2)$ as $h$ tends to zero.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Examples of Order Statistics}

After \ex developing the general theory, it's fun to apply it to some special cases. Let's calculate the distribution of the largest and smallest values of $n$ independent measurements from the uniform distribution on $[0,1]$. So $X_1, \dots, X_n$ are independent, identically distributed uniform random variables on $[0,1]$. Their density $f$ satisfies $$\twocase{f(x) \ = \ }{1}{if $0 \le x \le 1$}{0}{otherwise.}$$ From Theorem \ref{thm:orderstat}, we find $$g_1(y_1) \ = \ n f(y_1) \left(\int_{y_1}^\infty f(x)dx\right)^{n-1}.$$ Clearly $g_1(y_1) = 0$ unless $0 \le y_1 \le 1$; if that happens, then $$g_1(y_1) \ = \ n f(y_1) (1-y_1)^{n-1} \ = \ n (1-y_1)^{n-1};$$ note the smaller $y_1$ is the larger the density (as one would expect). For $Y_n$, we argue similarly and find \bea g_n(y_n) \ = \ n f(y_n) \left(\int_{-\infty}^{y_n} f(x)dx\right)^{n-1} \ = \ n f(y_n) (y_n-0)^n \ = \ n y_n^n.\eea Not surprisingly, $Y_r$ exhibits the opposite behavior to $Y_1$.\\ \

As \nb always, there is a simple trick we can do to see if our answers above are consistent. Note our random variables are symmetric functions about $1/2$; in other words, the density satisfies $f(1/2+u) = f(1/2-u)$. One consequence of this is that $X_i$ and $1-X_i$ have the same distribution, and $\min \left(X_1,\dots, X_n\right)$ $=$ $\max$ $\left(1-X_1,\dots, 1-X_n\right)$. To put it another way, the probability $Y_1$ equals $a$ should be the same as the probability that $Y_n$ equals $1-a$. In other words, we should have $g_1(1-y_n) = g_n(y_n)$; after doing a little algebra (including a change of variables) we see that we \emph{do} have this, and happily all is consistent: \bea g_1(1-y_n) & \ = \ & n f(1-y_n)  \left(\int_{1-y_n}^\infty f(x)dx\right)^{n-1} \nonumber\\ &=& n f(y_n) \left(\int_{y_n}^{-\infty} f(1-v) (-dv)\right)^{n-1} \nonumber\\ &=& n f(y_n) \left(\int_{-\infty}^{y_n} f(v)dv\right)^{n-1} \nonumber\\ &=& g_n(y_n).\eea \\ \

It's interesting to compute some properties of $Y_1$ (or, equivalently, $Y_n$). The most important, of course, is the mean or expected value. It is \bea \E[Y_1] & \ = \ & \int_0^1 y_1 g_1(y_1) dy_1 \nonumber\\ &=& \int_0^1 y_1 \cdot n (1-y_1)^{n-1} dy_1.   \eea There are many ways to evaluate this integral. Probably the easiest is to integrate by parts. Let $u = y_1$, $du = dy_1$, $dv = n(1-y_1)^{n-1}dy_1$ and $v = -(1-y_1)^n$. Then \bea \E[Y_1] & \ = \ & uv\Big|_0^1 - \int_0^1 vdu \nonumber\\ &=& y_1 (1-y_1)^n\Big|_0^1 + \int_0^1 (1-y_1)^n dy_1 \nonumber\\ &=& (0-0) + \frac{-(1-y_1)}{n+1}\Big|_0^1 \nonumber\\ &=& \frac1{n+1}. \eea Is this answer reasonable? The simplest case is if $n=1$, in which case $Y_1 = X_1$. As $X_1$ is uniform on $[0,1]$, its average value is 1/2, which is precisely what we get here. As $n$ increases the mean decreases, which again is reasonable as $Y_1$ is the minimum of a larger and larger set, and thus it has a greater and greater chance of being small. As an aside, it's worth remarking that the expected value of $Y_n$ is $\frac{n}{n+1}$. \\ \

For \task a nice exercise, see if you can find a nice formula for the minimum and the maximum of 2, 3 or 4 independent standard exponentials (i.e., $f(x) = e^{-x}$ for $x\ge 0$ and $0$ otherwise). Can you generalize your answer?



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{The Sample Distribution of the Median}

Okay. We've spent a lot of time and written down a multitude of explicit equations for all the order statistics, and we've done some calculations. It's time to get some dividends! Specifically, it's time to really see why this is such an important topic.

In addition to the smallest ($Y_1$) and largest ($Y_n$) order
statistics, we're often interested in the \textbf{sample median}\index{sample median}\index{median!sample},
$\tilde X$. For a sample of odd size, $n=2m+1$, the sample median is
defined as $Y_{m+1}$. If $n=2m$ is even, the sample median is
defined as $\frac12(Y_m+Y_{m+1})$.

As always, let's assume our random variable has a continuous density. We'll prove a relation between
the sample median and the \textbf{population median}\index{population median}\index{median!population} $\tilde\mu$. By
definition, $\tilde\mu$ satisfies
\bel\label{eq:medianfirstappearfirst}
\int_{-\infty}^{\tilde\mu}f(x)\,dx\ =\ \frac{1}{2}.
\eel

It is convenient to re-write the above in terms of the cumulative
distribution function. If $F$ is the cumulative distribution
function of $f$, then $F' = f$ and \eqref{eq:medianfirstappearfirst}
becomes \be F(\tilde\mu) \ = \ \foh.\nonumber\ \ee

We are now ready to consider the distribution of the sample median. This is the big theorem of the chapter; as discussed, it serves as a good substitute to the Central Limit Theorem in many cases.

\bigbox{
\begin{thm}[Sample\index{Median Theorem} Median]
Let a sample of size  $n=2m+1$ with $n$ large be taken from an
infinite population with a density function $f(x)$  (in other words, we have $n$ independent, identically distributed random variables with density $f$) that is
nonzero at the population median $\tilde\mu$ and continuously
differentiable in a neighborhood of $\tilde\mu$. The sampling
distribution of the median is approximately normal with mean
$\tilde\mu$ and variance $\frac{1}{8f(\tilde\mu)^2m}$.
\end{thm}
}

While this is an extremely important theorem, and one of the key applications of order statistics, the proof is long. It's frequently omitted in a first course in probability; there is no harm in skipping it. Because most books don't offer a proof, it can be frustrating for those who want to understand what's really going on, as you have to track down a proof somewhere. So, partly for completeness and, as always, partly to emphasize the techniques and methods of the proofs, we provide a proof below. As the argument is long, you should skim it first to take in the main points, and then if you desire go back and try to follow it step by step.

For those going forward with the proof, here's a quick outline of what you'll see; the list of topics should show you why we think the proof merits inclusion! We'll use Stirling's formula to estimate the factorials, Taylor series to expand our functions about the median, and the definition of $e^x$ to understand the limiting behavior. This last step involves some delicate analysis, specifically handling how powers converge to exponentials. It's very easy to make a mistake here, and we'll show a nice technique to attack problems like this. We'll end by doing some algebra to help us recognize that the limit converges to being normally distributed. \\ \

\noindent \emph{Proof:}
Let the median random variable $\tilde X$ have values $\tilde x$ and
density $g(\tilde x)$. The median is simply the
$(m+1)$\textsuperscript{th} order statistic, so its distribution is
given by Theorem
\ref{thm:orderstat}:
\begin{equation}
g(\tilde x)\ =\ \frac{(2m+1)!}{m!m!}\left[\int^{\tilde x}_{-\infty}f(\tilde x)\, dx\right]^{m}f(\tilde x
)\left[\int_{\tilde x}^{\infty}f(x)\, dx\right]^{m}.\nonumber\
\end{equation}
We first find an approximation for the constant factor in this
equation. For this, we use Stirling's formula (see \textbf{ADD REF}), which
tells us that $n!=n^ne^{-n}\sqrt{2\pi n}(1+O(n^{-1}))$. We'll consider values
sufficiently large so that the terms of order $1/n$ need not be
considered. Rather then clutter the already long argument with more careful book-keeping, we'll argue at this level of informality; the interested reader can go through and add the details. Hence
\bea
\frac{(2m+1)!}{m!m!} & \ =\ & \frac{(2m+1)(2m)!}{(m!)^2} \nonumber\\
& \ \approx\ & \frac{(2m+1)(2m)^{2m}e^{-2m}\sqrt{2\pi (2m)}}{(m^me^{-m}\sqrt{2\pi m})^2}\nonumber\\
& \ =\ & \frac{(2m+1)4^m}{\sqrt{\pi m}}.\eea As $F$ is the cumulative distribution function, $F(\tilde x) =
\int^{\tilde x}_{-\infty} f(x)\, dx$, which implies
\bel\label{eq:expgtildex}
g(\tilde x)\ \approx\ \frac{(2m+1)4^m}{\sqrt{\pi m}}\left[F(\tilde x)\right]^{m}f(\tilde x)\left[1-F(\tilde
x)\right]^{m}.\nonumber\
\eel

It's generally a good idea to replace complicated functions with simpler ones. Thus, we'll use the Taylor series expansion of $F(\tilde x)$ about
$\tilde \mu$, which is just \be F(\tilde x) \ = \ F(\tilde\mu) +
F'(\tilde\mu) (\tilde x - \tilde \mu) + O((\tilde x - \tilde\mu)^2).\nonumber\
\ee Because $\tilde\mu$ is the population median, $F(\tilde\mu) =
1/2$. Further, since $F$ is the cumulative distribution function,
$F' = f$ and we find \bel\label{eqn:taylorF} F(\tilde x) \ = \ \foh
+ f(\tilde\mu)(\tilde x - \tilde \mu) + O((\tilde x - \tilde\mu)^2).
\eel This approximation is only useful if $\tilde x - \tilde\mu$ is
small; in other words, we need $\lim_{m\to\infty}$ $|\tilde x$ $-$
$\tilde\mu|$ $=$ $0$. Fortunately this is easy to show, and a proof is
included at the end of this section. So as not to lose the flow of the argument, let's assume this holds for now and continue.

Let $t=\tilde x-\tilde \mu$ (which is small and tends to 0 as
$m\to\infty$). We want to substitute our Taylor series expansion into
\eqref{eq:expgtildex}. Actually, we need to expand even further -- this is sadly an instance where the standard, first order Taylor series does not provide enough control! The problem is each term has an error of size $O(t^2)$. When we multiply them together there is also an error of size $O(t^2)$, and this is the same order of magnitude as the secondary term, $(f(\widetilde{\mu})t)^2$. The remedy is to be more careful in expanding $F(\tilde x)$ and $1-F(\tilde x)$. A careful analysis shows that their $t^2$ terms are equal in magnitude but opposite in sign. Thus they will cancel in the calculations below. In summary, we really need to use $F(\tilde x) = \foh + f(\tilde \mu)(\tilde x - \tilde \mu) + \frac{f'(\tilde \mu)}{2}(\tilde x - \tilde \mu)^2$ plus an error of size $O((x-\widetilde{\mu})^3)$ (and similarly for $1 - F(\tilde x)$). We find
\begin{eqnarray}
& & g(\tilde x)\ \approx\ \frac{(2m+1)4^m}{\sqrt{\pi m}}\left[\frac12+f(\tilde \mu)t
+\frac{f'(\tilde \mu)}{2}(\tilde x - \tilde \mu)^2 + O(t^3)\right]^{m}\nonumber\\ & & \ \ \ \ f(\tilde x)\left[1-\left(\frac12+f(\tilde \mu)t+\frac{f'(\tilde \mu)}{2}(\tilde x - \tilde \mu)^2+O(t^3)\right)\right]^{m}.\nonumber\
\end{eqnarray}
By rearranging and combining factors, we find that
\beal\label{eq:preignoringfirst}
g(\tilde x) & \ \approx\ & \frac{(2m+1)4^m}{\sqrt{\pi m}}f(\tilde x)\left[\frac14-(f(\tilde \mu)t)^2 +O(t^3)\right]^{m} \nonumber\\ & \ = \ &
\frac{(2m+1)f(\tilde x)}{\sqrt{\pi m}}\left[1-\frac{4m(f(\tilde
\mu)t)^2}{m} +O(t^3)\right]^{m}.
\eeal

Remember that one definition of $e^x$ is \be e^x \ = \ \exp(x) \ = \
\lim_{n\to\infty} \left(1 + \frac{x}{n}\right)^n; \ee see \textbf{ADD REF}
\ref{sec:expfn} for a review of properties of the exponential
function. It's not immediately clear that we can use this, as we have $m$ in both the numerator and the denominator; however, $t$ is supposed to be quite small, and we'll show later it's so small that $mt^2$ cannot be that large with respect to $m$. So, for now let's not worry about justifying this step and just use the exponential relation. While we're at it, let's also ignore higher powers of $t$ for the
moment. We find for large $m$ that
\beal\label{eq:ignoringsecond}
g(\tilde x) & \ \approx\ \ & \frac{(2m+1)f(\tilde x)}{\sqrt{\pi m}}\
\exp\left(-4mf(\tilde\mu)^2t^2\right)\nonumber\\ & \ \approx\ & \frac{(2m+1)f(\tilde
x)}{\sqrt{\pi m}}\ \exp\left(-\frac{(\tilde x-\tilde
\mu)^2}{1/(4mf(\tilde\mu)^2)}\right). \eeal
Since, as shown below, $\tilde x$ can be
assumed arbitrarily close to $\tilde \mu$ with high probability, we
can assume $f(\tilde x)\approx f(\tilde\mu)$. To
prove that there is negligible error in replacing $f(\tilde x)$ with
$f(\tilde\mu)$, we use the mean value theorem and find \be f(\tilde
x) - f(\tilde\mu) \ = \ f'(c_{\tilde x, \tilde \mu}) \cdot (\tilde x
- \tilde \mu); \ee here we have written the constant as $c_{\tilde
x,\tilde \mu}$ to emphasize the fact that we evaluate the first
derivative in the interval $[\tilde x, \tilde \mu]$. As we have
assumed $f$ is continuously differentiable and $|\tilde x - \tilde
\mu|$ is small, we may bound $f'(c_{\tilde x, \tilde \mu})$ Thus we
may replace $f(\tilde x)$ with $f(\tilde \mu)$ at a cost of $O(t)$,
where $t = \tilde x - \tilde \mu$ tends to zero with $m$. We therefore have
\begin{equation}
g(\tilde x)\ \approx\ \frac{(2m+1)f(\tilde \mu)}{\sqrt{\pi m}}\
\exp\left(-\frac{(\tilde x-\tilde
\mu)^2}{1/(4mf(\tilde\mu)^2)}\right).\nonumber\
\end{equation}
Looking at the exponential part of the expression for $g(\tilde x)$, we see that it appears to be a normal density
with mean $\tilde \mu$ and $\sigma^2=1/(8mf(\tilde\mu)^2)$. If we were instead to compute the variance from the
normalization constant, we would find the variance to be
\[
\frac{m}{2(2m+1)^2 f(\tilde\mu)^2}
\]
We see that the two values are asymptotically equivalent, thus we
can take the variance to be $\sigma^2=1/(8mf(\tilde\mu)^2)$. Thus to
complete the proof of the theorem, all that we need to is prove that
we may ignore the higher powers of $t$ and replace the product with
an exponential in passing from \eqref{eq:preignoringfirst} to
\eqref{eq:ignoringsecond}. Using the identity $$w^m \ = \ \exp\left(\log(w^m)\right) \ = \ \exp\left(m \log w\right).$$ We have \beal\label{eq:postignore}
\left(1-\frac{4m(f(\tilde \mu)t)^2}{m} +O(t^3)\right)^{m} & \ = \ &
\exp\left(m\log\left(1-4(f(\tilde \mu)t)^2 +O(t^3)\right) \right).\nonumber\\
\eeal We use the Taylor series expansion of $\log(1-x)$: \be
\log(1-x) \ = \ -x + O(x^2);\nonumber\ \ee we only need one term in the
expansion as $t$ is small. Thus \eqref{eq:postignore} becomes \bea
\left(1-\frac{4m(f(\tilde \mu)t)^2}{m} +O(t^3)\right)^{m} & \ = \ &
\exp\left(-m \cdot 4(f(\tilde \mu)t)^2 + O(mt^3)\right) \nonumber\\
& = & \exp\left(-\frac{(\tilde x-\tilde
\mu)^2}{1/(4mf(\tilde\mu)^2)}\right)\ \cdot\ \exp(O(mt^3)).\nonumber\ \eea
In \S\ref{app:tsmall} we'll show that as
$m\to\infty$, $mt^3 \to 0$. Thus the $\exp(O(mt^3))$ term above
tends to $1$, which completes the proof. \qed


Our \nb justification of ignoring the higher powers of $t$
and replacing the product with an exponential in passing from
\eqref{eq:preignoringfirst} to \eqref{eq:ignoringsecond} is a standard
technique. As it's so important, we repeat again why we can do this. We are just replacing some quantity $(1-P)^m$ with $(1-P)^m
= \exp(m\log (1-P))$. We then Taylor expand the logarithm, and look at
the limit as $m\to\infty$. \\

\textbf{ADD REF TO CLT CHAPTER WHERE CAN GO WRONG -- PRODUCT ONE TO INFINITY ONE TO ZERO}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Technical bounds for proof of Median Theorem}\label{app:tsmall}

In proving the Median Theorem, we assumed that we could ignore higher powers of $t=\tilde X-\tilde \mu$. We are able to do
this because, with high probability, $t$ is small. Here we provide a more formal statement of this fact, as well as a
proof.

\bigbox{
\begin{lem}
Suppose $f(x)$ is a continuously differentiable function in some
neighborhood of $\tilde\mu$. Then for any $c>0$, we have
\begin{equation}
\lim_{m\to 0}{\rm Prob}(|\tilde X-\tilde\mu| \ge\  c)\ =\ 0. \nonumber\
\end{equation}
\end{lem}
}

\noindent \emph{Proof:}
This is equivalent to proving that
\begin{equation}
\lim_{m\to 0}{\rm Prob}(\tilde X\ \le \tilde\mu-  c)\ =\ 0\quad \text{and}\quad \lim_{m\to 0}{\rm Prob}(\tilde X\ \ge \tilde\mu+
c)\ =\ 0. \nonumber\
\end{equation}
We will prove only the first of these two statements as the proof of the second is very similar.

By \eqref{eq:expgtildex}, we can approximate the density of the median as
\begin{equation}
g(\tilde x)\ \approx\ \frac{(2m+1)4^m f(\tilde x)}{\sqrt{\pi m}}\left(\left[F(\tilde x)\right]\left[1-F(\tilde
x)\right]\right)^{m}.\nonumber\
\end{equation}
We consider the factor $\left(\left[F(\tilde x)\right]\left[1-F(\tilde
x)\right]\right)^{m}$. It is convenient to write $\theta=F(\tilde x)$ and consider the function
$h(\theta)=\theta(1-\theta)$. This function will attain its maximum for the same value of $\theta=F(\tilde x)$ as
$\left(\left[F(\tilde
x)\right]\left[1-F(\tilde x)\right]\right)^m$, and it's a simple exercise in calculus to show that this value is
$\theta=1/2$. This condition holds only for $\tilde x=\tilde \mu$. We furthermore note that for $\theta<1/2$,
$h'(\theta)=1-2\theta>0$, so $h$ is increasing. Since $F(\tilde x)=\frac12$ precisely when $\tilde x=\tilde \mu$, this
means that for $\tilde x\le\tilde\mu-c$, the maximum value of $g(\theta)$ occurs for $\tilde x=\tilde \mu-c$. We
therefore have for $\tilde x\le \tilde \mu-c$,
\beal\label{eqn:beforealpha}
\left(F(\tilde x)\left[1-F(\tilde
x)\right]\right)^{m} & \ \le\ & \left(F(\tilde \mu-c)\left[1-F(\tilde
\mu-c)\right]\right)^{m}\nonumber\\ & \ < \ & \left(F(\tilde \mu)\left[1-F(\tilde
\mu)\right]\right)^{m}=\frac{1}{4^m}.
\eeal
We choose $\alpha$ so that $\frac{\alpha}{4}=F(\tilde \mu-c)\left(1-F(\tilde
\mu-c)\right)$. Equation \eqref{eqn:beforealpha} then tells us that for $\tilde x\le \tilde \mu-c$,
\begin{equation}
\left(F(\tilde x)\left[1-F(\tilde
x)\right]\right)^{m}\ \le\ \left(\frac{\alpha}{4}\right)^m\ \le\ \frac{1}{4^m}.\nonumber\\
\end{equation}
In particular, we note that $\alpha<1$.

We now begin to look at the probability that $\tilde X$ is at most $\tilde \mu-c$. We  have
\begin{eqnarray}
{\rm Prob}(\tilde X\le\tilde\mu-c)&=&\int^{\tilde\mu-c}_{-\infty}g(\tilde x)\, d\tilde x \nonumber\\
&\approx&\int^{\tilde\mu-c}_{-\infty}\frac{(2m+1)4^m}{\sqrt{\pi m}}f(\tilde x)F(\tilde x)^m(1-F(\tilde x))^m\, d\tilde x
\nonumber\\
&<&\frac{(2m)4^m}{\sqrt{m}}\int^{\tilde\mu-c}_{-\infty}f(\tilde x)F(\tilde x)^m(1-F(\tilde x))^m\, d\tilde x.\nonumber\
\end{eqnarray}
In the last step, we use the fact that for $m$ sufficiently large ($m>1$, in fact), $2m<\frac{2m+1}{\sqrt{\pi}}$.
This simplifies the expression as a factor of $2m$ is easier to work with than the factor of $2m+1$. We now apply our bound on $F(\tilde x)(1-F(\tilde x))$ to find that
\begin{eqnarray}
{\rm Prob}(\tilde X\le\tilde\mu-c) & \
<\ & \frac{(2m)4^m}{\sqrt{m}}\int^{\tilde\mu-c}_{-\infty}f(\tilde x)\left(\frac{\alpha}{4}\right)^m\, d\tilde x \nonumber\\
& \ =\ & \frac{(2m)4^m}{\sqrt{m}}\left(\frac{\alpha}{4}\right)^m\int^{\tilde\mu-c}_{-\infty}f(\tilde x)\, d\tilde x
\nonumber\\ & \ <\ & 2\alpha^m\sqrt{m}\int^{\tilde\mu}_{-\infty}f(\tilde x)\, d\tilde x.\nonumber\
\end{eqnarray}

In obtaining the rightmost expression, we have used the fact that $f(\tilde x)$ is nonnegative everywhere and positive in a neighborhood of
$\tilde\mu$, so that $\int_{-\infty}^{\tilde\mu-c} f(\tilde x)\, d\tilde x\ <\ \int_{-\infty}^{\tilde\mu} f(\tilde x)\, d\tilde
x$.
Since $\tilde\mu$ is the median of the population, by definition, we have $\int_{-\infty}^{\tilde\mu} f(\tilde x)\,
d\tilde x=\foh$, so that
\begin{equation}
{\rm Prob}(\tilde X\le\tilde\mu-c)\ <\ \alpha^m\sqrt{m}.\nonumber\
\end{equation}
Since $\alpha<1$, it follows that the right side of this inequality must converge to $0$ as $m$ goes to infinity, so the probability on the right side must likewise converge to $0$. \qed \ \\


\begin{exe} Let \task $\alpha \in (0,1)$. Prove \be \lim_{m\to\infty}
\alpha^m \sqrt{m} \ = \ 0. \ee In fact, this expression tends to
zero exponentially fast. Let $\delta = 1 - \alpha$. Show that for
$m$ sufficiently large, \be \alpha^m \sqrt{m} \ \le \ A
\left(1-\frac{\delta}2\right)^m \ = \ A e^{-Bm}, \ee where $A$ and
$B$ are constants (with $B = \log\left(1-\frac{\delta}2\right)$.
\end{exe}


%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%%
%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%%
\section{The Median of Normal Random Variables}

Consider \ex the case of a normal population with mean $\mu$ and variance $\sigma^2$. The normal density is symmetric about the mean $\tilde\mu$, hence
$\tilde\mu=\mu$. Furthermore, we have
\begin{eqnarray}
f(\tilde \mu)&=&f(\mu)\nonumber \\
&\ =\ &\frac{1}{\sqrt{2\pi\sigma^2}}\ \exp\left(-\frac{(\mu-\mu)^2}{2\sigma^2}\right) \nonumber\\
&=&\frac{1}{\sqrt{2\pi\sigma^2}}, \nonumber
\end{eqnarray}
which implies that
\begin{equation}
\frac{1}{8m f(\tilde\mu)^2}\ =\ \frac{\pi\sigma^2}{4m}. \nonumber
\end{equation}
For large $n=2m+1$, we therefore see that the distribution of the median
(from a normal distribution with mean $\mu$ and variance $\sigma^2$)
will be approximately normal with mean $\mu$ and variance
$\pi\sigma^2/4m$.

What can we say about the population mean? Either from the Central Limit Theorem, or calculating directly as the sum of normal random variables is normal, we see that the sample mean is normally distributed with mean $\mu$ and variance $\sigma^2/n = \sigma^2 / (2m+1)$.

So, both the sample median and the sample mean converge to being normally distributed with mean $\mu$; however, the sample median has variance approximately $\pi\sigma^2/4m$, while the mean has variance $\sigma^2/(2m+1)$. If we take the ratio of the two, we find $$\frac{{\rm Variance\ of\ Sample\ Median}}{{\rm Variance\ of\ Sample\ Mean}} \ \approx \ \frac{\pi \sigma^2 / 4m}{\sigma^2/(2m+1)} \ = \ \frac{\pi}{2} \frac{2m+1}{2m}.$$ For large $m$, this ratio is about $\pi/2 \approx 1.57$. What does this mean? It means that while the sample median and sample mean have the same expected value, the sample median has larger fluctuations. How should we interpret this? The cleanest is that the sample mean will do a better job; it's `tighter' about the true value.

The moral of this example is that, as nice as the Median Theorem is, it's most emphatically \emph{not} a replacement for the Central Limit Theorem whenever the mean and the median are equal. The Central Limit Theorem can give better results; the Median Theorem should be kept in reserve for situations where the Central Limit Theorem isn't applicable (for instance, when we have a distribution like the Cauchy which has infinite variance, and possibly even undefined mean!).


\end{document}


