\documentclass[10pt,final]{flbook}
%\usepackage[LY1]{fontenc}
%\usepackage[LY1,mtbold]{pupfonts}
\usepackage{bm}
\usepackage{eurosans}
\usepackage{comment}
%\usepackage{hyperref}
%\usepackage{url}

\addtolength{\textwidth}{1cm} \addtolength{\hoffset}{-.5cm}
%\addtolength{\marginparwidth}{-.5cm}\addtolength{\textheight}{1cm}
%\addtolength{\voffset}{-1cm}


\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{mathrsfs}
\usepackage{makeidx}

%\usepackage{mbboard} %Schurger needs
\makeatletter
\def\imod#1{\allowbreak\mkern10mu({\operator@font mod}\,\,#1)}
\makeatother




\usepackage{latexsym}
\usepackage[dvips]{graphics}
%\usepackage{pb-diagram}
\usepackage{epsfig}\usepackage{psfrag}
%\usepackage{hyperref, amsmath, amsthm, amsfonts, amscd, flafter,epsf}
\usepackage{amsmath,amsfonts,amsthmalt,amssymb,amscd,dsfont}
\input amssym.def
\input amssym.tex
\usepackage{tabularx}
\usepackage{url}
\usepackage{color}
%\renewcommand{\baselinestretch}{1.}
%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
%\setlength{\oddsidemargin}{-.6in} \setlength{\textwidth}{7.2in}
%\setlength{\topmargin}{-1in} \setlength{\textheight}{9.6in}
%\setlength{\unitlength}{0.2in}





\renewcommand{\d}{{\mathrm{d}}} % differential, used in integrals
\newcommand{\bs}[2]{b_{i_{#1}-i_{#2}}}
\newcommand{\oa}[1]{\vec{#1}}

\newcommand{\hf}{\hat{f}}
\newcommand{\hg}{\hat{g}}
\newcommand{\sumnz}{\sum_{n \in \Z}}
\newcommand{\summz}{\sum_{m \in \Z}}
\newcommand{\sumkz}{\sum_{k \in \Z}}
\newcommand{\sumooo}{\sum_{n=1}^\infty}
\newcommand{\intr}{\int_{\R}}
\newcommand{\intzo}{\int_0^1}


\newcommand{\ol}[1]{\overline{#1}}
\newcommand{\lp}{\left(}
\newcommand{\rp}{\right)}

\newcommand{\burl}[1]{\textcolor{blue}{\url{#1}}}
\newcommand{\emaillink}[1]{\textcolor{blue}{\href{mailto:#1}{#1}}}

\newcommand\st{\text{such that\ }}
\newcommand\be{\begin{equation}}
\newcommand\ee{\end{equation}}
\newcommand\bea{\begin{eqnarray}}
\newcommand\eea{\end{eqnarray}}
\newcommand\bi{\begin{itemize}}
\newcommand\ei{\end{itemize}}
\newcommand\ben{\begin{enumerate}}
\newcommand\een{\end{enumerate}}
\newcommand\bc{\begin{center}}
\newcommand\ec{\end{center}}
\newcommand\ba{\begin{array}}
\newcommand\ea{\end{array}}
%\newcommand\mod{\text{mod\ }}
\newcommand{\mo}{\text{mod}\ }
% General Symbols

\def\notdiv{\ \mathbin{\mkern-8mu|\!\!\!\smallsetminus}}
\newcommand{\done}{\Box} %use in linux

%Blackboard Letters
\newcommand{\B}{\mathbb{B}}
\newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\C}{\ensuremath{\mathbb{C}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\Qoft}{\mathbb{Q}(t)}  %use in linux

% Finite Fields and Groups
% Fractions

\newcommand{\fof}{\frac{1}{4}}  %oneforth
\newcommand{\foh}{\frac{1}{2}}  %onehalf
\newcommand{\fot}{\frac{1}{3}}  %onethird
\newcommand{\fop}{\frac{1}{\pi}}    %1/pi
\newcommand{\ftp}{\frac{2}{\pi}}    %2/pi
\newcommand{\fotp}{\frac{1}{2 \pi}} %1/2pi
\newcommand{\fotpi}{\frac{1}{2 \pi i}}


% Theorem / Lemmas et cetera

\newtheorem{chap}{Theorem}[chapter]
\newtheorem{thm}{Theorem}[section]
\newtheorem{condition}{Condition}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{assumption}[thm]{Assumption}
\newtheorem{exa}[thm]{Example}
\newtheorem{defi}[thm]{Definition}
\newtheorem{exe}[chap]{Exercise}
\newtheorem{exeh}[thm]{Exercise\textsuperscript{(h)}}
\newtheorem{exehr}[thm]{Exercise\textsuperscript{(hr)}}
\newtheorem{que}[thm]{Question}
\newtheorem{prob}[thm]{Problem}
\newtheorem{cla}[thm]{Claim}

\newtheorem{exaS}[thm]{Example} %SCH�RGEREXAMPLE TEXT UPSHAPE
\newtheorem{conjS}[thm]{Conjecture} %SCH�RGEREXAMPLE TEXT UPSHAPE
\newtheorem{probS}[thm]{Problem} %SCH�RGEREXAMPLE TEXT UPSHAPE


%s\theoremstyle{definition}
\newtheorem{rek}[thm]{Remark}
\newtheorem{proj}[thm]{Research Project}

\newcommand{\vars}[2]{ #1_1, \dots, #1_{#2} }
\newcommand{\ncr}[2]{{#1 \choose #2}}
\newcommand{\twocase}[5]{#1 \begin{cases} #2 & \text{{\rm #3}}\\ #4
&\text{{\rm #5}} \end{cases}   }
\newcommand{\twocaseother}[3]{#1 \begin{cases} #2 & \text{{\rm #3}}\\ 0
&\text{{\rm otherwise}} \end{cases}   }

\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{\matfour}[16]
%{\left(\begin{array}{cccc}
%                        #1  & #2 & #3 & #4 \\
%                        #5  & #6 & #7 & #8 \\
%                        #9  & #10 & #11 & #12 \\
%                        #13 & #14 & #15 & #16
%                          \end{array}\right) }


%\newcommand{\matfive}[25]
%{\left(\begin{array}{ccccc}X
%                        #1  & #2 & #3 & #4  & #5 \\
%                        #6 & #7 &  #8 & #9  & #10 \\
%                        #11 & #12 & #13 & #14 & #15 \\
%                        #16 & #17 & #18 & #19 & #20 \\
%                        #21 & #22 & #23 & #24 & #25
%                         \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| }


% arrows

\newcommand{\ua}{\uparrow}
\newcommand{\da}{\downarrow}
\newcommand{\uda}{\updownarrow}
\newcommand{\ra}{\rightarrow}
\newcommand{\la}{\leftarrow}
\newcommand{\hookra}{\hookrightarrow}
\newcommand{\hookla}{\hookleftarrow}
\newcommand{\circlela}{\circlearrowleft}
\newcommand{\circlera}{\circlearrowright}
%\newcommand{\squigglela}{\leftrightsquigarrow}
\newcommand{\squigglera}{\rightsquigarrow}
\newcommand{\mto}{\mapsto}  %maps to

\newcommand{\hqone}{\frac{h_1}{q_1}}
\newcommand{\hqm}{\frac{h_m}{q_m}}
\newcommand{\hqi}{\frac{h_i}{q_i}}

\newcommand{\gep}{\epsilon}
\newcommand{\gl}{\lambda}
\newcommand{\ga}{\alpha}
\newcommand{\gb}{\beta}
\newcommand{\gd}{\delta}
\newcommand{\gG}{\Gamma}
\newcommand{\gL}{\Lambda}
\newcommand{\GG}{\Gamma}
\newcommand{\w}{\omega}

\newcommand{\bra}[1]{\left\langle #1\right|}
\newcommand{\ket}[1]{\left|#1\right\rangle}
\newcommand{\braket}[2]{\left\langle #1 \left|#2\right.\right\rangle}
\newcommand{\braOket}[3]{\left\langle #1\left|#2\right|#3\right\rangle}
% matrices
% 2x2 symm
\newcommand{\sym}[3]{\ensuremath{\left(\begin{array}{ll}#1 &#2 \\ #2 &#3%
\end{array}\right)}}
\newcommand{\mat}[4]{\ensuremath{\left(\begin{array}{ll}#1 &#2 \\ #3 &#4%
\end{array}\right)}}
\newcommand{\half}{\text{\small $\frac{1}{2}$}}
\newcommand{\sfrac}[1]{\text{\small $\frac{1}{#1}$}}
\newcommand{\mbf}[1]{{\mathbf #1}}
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\infint}{\int_{-\infty}^{\infty} \!\!}  % infinite integral
\newcommand{\diag}{diag}
\newcommand{\OO}{O}

% Random Matrices

\newcommand{\Poo}{P_{11}}
\newcommand{\Pot}{P_{12}}
\newcommand{\Ptt}{P_{22}}
\newcommand{\aoo}{a_{11}}
\newcommand{\aot}{a_{12}}
\newcommand{\att}{a_{22}}
\newcommand{\oof}{\frac{1}{|\mathcal{F}|}} % 1/|F|
\newcommand{\sumef}{\sum_{E \in \mathcal{F}}}
\newcommand{\plogne}{\frac{\log p}{\log N_E}}
\newcommand{\hfi}{\widehat{f_i}}
\newcommand{\hfo}{\widehat{f_1}}
\newcommand{\hft}{\widehat{f_2}}
\newcommand{\NF}{|\mathcal{F}|}   %|F|
\newcommand{\sumtinF}{\sum_{t \in \mathcal{F}}}
\newcommand{\ooNF}{\frac{1}{|\mathcal{F}|}}   %1/|F|
\newcommand{\oop}{\frac{1}{p}}


\newcommand{\unif}[1]{{\rm Unif}(0,#1)}
\newcommand{\expd}[1]{{\rm Exp}(#1)}
\newcommand{\err}[1]{{\rm Err}\left(#1\right)}
\newcommand{\meijer}[9]{G^{#1, #2}_{#3, #4}\left(#5 \Big| {#6, \dots, #7 \atop #8, \dots, #9}\right)}
\newcommand{\meijerone}[7]{G^{#1, #2}_{#3, #4}\left(#5 \Big| {#6 \atop #7}\right)}
\newcommand{\Bmeijer}[9]{B^{#1, #2}_{#3, #4}\left(#5 \Big| {#6, \dots, #7 \atop #8, \dots, #9}\right)}
\newcommand{\E}{{\mathbb E}} % expectation
%\newcommand{\I}{1\!\!1} % indicator function
\newcommand{\mel}{\mathcal{M}}


\newcommand{\bbp}{\mathbb{P}}
%\newcommand{\Q}{\mathbb{Q}}
%\newcommand{\R}{\mathbb{R}}
\newcommand{\bbs}{\mathbb{S}}
%\newcommand{\T}{\mathbb{T}}
\newcommand{\X}{\mathbb{X}}
%\newcommand{\Z}{\mathbb{Z}}
%
%
%\newcommand{\B}{\mathbb{B}}
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cD}{\mathcal{D}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cM}{\mathcal{M}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cS}{\mathcal{S}}



\pagenumbering{roman}

\begin{document}
%\frontmatter

\title{Exercises to ``The Theory and Applications of Benford's Law''}

\author{Steven J. Miller (editor)}

%%%%% <----- NEW!

\maketitle




%\begin{bookepigraph}
%\end{bookepigraph}




\tableofcontents


\begin{thepreface}

As Benford's law arises in so many different fields, there is a tremendous opportunity to design an interdisciplinary class on its theory and applications. Our hope is that this collection of exercises for the book \emph{The Theory and Applications of Benford's Law} will facilitate its use as a textbook.\\ \

There are almost as many possible classes that could be offered on Benford's law as there are researches in the subject; the goal of our book and these exercises is to provide a good, common denominator starting ground. As the book begins with several chapters where the theory is developed to various levels, from an informal discussion to a detailed discourse involved advanced analysis, one option is to use these chapters as a springboard to motivate numerous topics in advanced analysis.\\ \

After the theory, we turn to some of the large number of applications. The instructor has many options here, and can use these chapters and exercises to illustrate the far-reaching consequences of simple ideas. Additionally, this material may be used to motivate a quick introduction to statistics.\\ \

In order to assist instructors and students, for many chapters at \begin{center} \footnotesize \burl{http://web.williams.edu/Mathematics/sjmiller/public_html/benford/} \normalsize \end{center} we provide links to relevant material and other resources (such as videos and programs) as available. Many authors contributed exercises for their and other chapters. Additionally, numerous other problems were written or assembled by the editor and students working with him (especially John Bihn of Williams College). It is a pleasure to thank everyone for their contributions. Further, one advantage of posting problems online is that this need not be a static list, and thus please feel free to email the editor suggestions for additional exercises.\\ \

Finally, if you are interested in using this  book for a class, or have done so and have suggestions or requests, we would love to hear from you and work with you. Please contact the editor at the email address below.   \\ \

\hfill Steven J. Miller

\hfill Williams College

\hfill Williamstown, MA

\hfill June 2014 %originally had 2010!!!

%\ \\

\hfill sjm1@williams.edu, Steven.Miller.MC.96@aya.yale.edu

%\hfill OTHER EDITORS?

%\hfill LOCATION TBD

%\hfill TBD month 2013 %originally 2010!!!

\end{thepreface}

%\section*{Notation}
%\centerline{\textbf{Notation\\ \ \\ }}

\begin{thenotation}

\noindent $\Box$ : indicates\index{$\Box$} the end of a proof.\\

\noindent $\equiv$: $x \equiv y \ \bmod\ n$ means there exists an integer $a$ such that $x = y + an$.\\

\noindent $\exists$ : there\index{$\exists$} exists.\\

\noindent $\forall$ : for\index{$\forall$} all.\\

\noindent $|\cdot|$ : $|S|$ (or $\# S$) is the number of elements\index{$|S|$}\index{$\#S$} in the set $S$.\\

\noindent $\lceil \cdot \rceil$ : $\lceil x \rceil$ is the smallest integer\index{$\lceil x \rceil$} greater than or equal to $x$, read ``the ceiling of $x$.'' \\

\noindent $\lfloor \cdot \rfloor$ or $[\cdot]$ : $\lfloor x \rfloor$ (also written $[x]$) is the greatest\index{$\lfloor x \rfloor$}\index{$\lfloor x \rfloor$} integer less than or equal to $x$, read ``the floor of $x$.''\\

\noindent $\{\cdot\}$ or $\langle \cdot \rangle$ : $\{x\}$ is the fractional part\index{fractional part}\index{$\{x\}$} of $x$; note $x = [x] + \{x\}$.\\

\noindent $\ll, \gg$ : see Big-Oh notation. \\

\noindent $\vee$ : $a \vee b$ is the maximum of $a$ and $b$. \\

\noindent $\wedge$ : $a \wedge b$ is the minimum of $a$ and $b$. \\

\noindent $\mathds{1}_A$ (or $I_A$) : the indicator function of set $A$; thus $\mathds{1}_A(x)$ is 1 if $x\in A$ and 0 otherwise.\\

\ \\

\noindent $\delta_a$ : Dirac probability measure concentrated at $a\in \Omega$. \\

\noindent $\lambda$ : Lebesgue measure on $(\R, \cB)$ or parts thereof. \\

\noindent $\lambda_{a,b}$ : normalized Lebesgue measure (uniform distribution) on $\bigl([a,b), \cB [a,b)\bigr)$.\\

\noindent $\sigma(f)$ : the $\sigma$-algebra generated by the function $f:\Omega \to \R$. \\

\noindent $\sigma (A)$ : the spectrum (set of eigenvalues) of a $d\times d$-matrix $A$. \\

\ \\

\noindent $A^c$ : the complement of $A$ in some ambient space $\Omega$ clear from the context; i.e., $A^c =\{\omega \in \Omega : \omega \not \in A \}$.\\

\noindent $A\backslash B$ : the set of elements of $A$ not in $B$, i.e., $A\backslash B = A\cap B^c$.\\

\noindent $A\Delta B$ : the symmetric difference of $A$ and $B$, i.e., $A\Delta B = A\backslash B \cup B \backslash A$.\\

\noindent a.e. : (Lebesgue) almost every (or almost everywhere). \\

\noindent a.s. : almost surely, i.e., with probability one.\\

\noindent $\mathbb{B}$ : Benford distribution on $(\R^+, \cS)$. \\

\noindent $\cB$ : Borel $\sigma$-algebra on $\R$ or parts thereof. \\

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

\noindent $\C$ : the set of complex\index{complex numbers} numbers: $\{z: z = x + iy,\ x, y \in \R\}$.\\

\noindent $C^\ell$ : the set of all $\ell$ times continuously differentiable functions, $\ell\in \N_0$.\\

\noindent $C^{\infty}$ : the set of all smooth (i.e., infinitely differentiable) functions; $C^{\infty} = \bigcap_{\ell\ge 0}C^\ell$.\\

\noindent $D_1,D_2,D_3, \dots$ : the first, second, third, $\dots$ significant decimal digit.\\

\noindent $D_m^{(b)}$ : the $m$-th significant digit base $b$. \\

\noindent $\E[X]$ (or $\E X)$ : the expectation of $X$.\\

\noindent $e(x)$ :  $e(x) = e^{2\pi i x}$.\\

\noindent $f_* \bbp$ : a probability measure on $\R$ induced by $\bbp$ and the measurable function $f:\Omega \to \R$, via $f_* \bbp (\cdot) := \bbp \bigl(f^{-1}(\cdot)\bigr)$.\\

\noindent $F_n$: $\{F_n\}$ is the sequence of Fibonacci numbers, $\{F_n\} = \{0, 1, 1, 2, 3, 5, 8, \dots\}$ ($F_{n+2} = F_{n+1} + F_n$ with $F_0 = 0$ and $F_1 = 1$).\\

\noindent $F_{P}$, $F_X$ : the distribution functions of $P$ and $X$. \\

\noindent $i$ : $i = \sqrt{-1}$. \\

\noindent i.i.d. : independent, identically distributed (sequence or family of random variables); often one writes i.i.d.r.v.\\

\noindent $\Im z$: see $\Re z$. \\

\noindent infimum\index{infimum} : the infimum of a set, denoted $\inf_n x_n$, is the largest number $c$ (if one exists) such that $x_n \ge c$ for all $n$, and for any $\gep > 0$ there is some $n_0$ such that $x_{n_0} < c + \gep$. If the sequence has finitely many terms, the infimum is the same as the minimum value.\\

\noindent $j$ : in some chapters $j = \sqrt{-1}$ (this convention is frequently used in engineering).\\

\noindent $\operatorname{Leb}$ : Lebesgue measure.\\

\noindent Little-oh\index{Little-oh} notation : $A(x) = o(B(x))$, read ``$A(x)$ is little-Oh of $B(x)$'', means\index{$o(x)$}
$\lim_{x\to\infty} A(x)/B(x) = 0$.\\

\noindent $L^1(\R)$ : all $f: \R \longrightarrow \C$ which are measurable and Lebesgue integrable.  \\

\noindent $\log$ : usually the natural logarithm, though in some chapters it is the logarithm base 10.\\

\noindent $\ln$ : the natural logarithm. \\

\noindent $\N$ : the set of natural\index{natural numbers} numbers: $\{0, 1, 2, 3, \dots \}$.\\

\noindent $\N_0$ : the set of positive natural number: $\{1, 2, 3, \dots \}$.\\

\noindent $N_f$ : the Newton map associated with a differentiable function $f$. \\

\noindent $o(\cdot)$, $O(\cdot)$: see `Little-oh' and `Big-Oh' notation, respectively. \\

\noindent $O_T(x_0)$ : the orbit of $x_0$ under the map $T$, possibly nonautonomous. \\

\noindent $\{p_n\}$ : the set of prime numbers: 2, 3, 5, 7, 11, 13, $\ldots$.\\

\noindent $P$ : probability measure on $(\R, \cB)$, possibly random. \\

\noindent $P_X$ : the distribution of the random variable $X$. \\

\noindent ${\rm Prob}$ (or ${\rm Pr}$) : a probability function on a probability space. \\

\noindent $\Q$ : the set of rational\index{rational numbers} numbers: $\{x: x = \frac{p}{q}, p,q \in \Z, q \neq 0\}$.\\

\noindent $\R$ : the set of real\index{real numbers} numbers.\\

\noindent $\R^+$ : the set of positive real\index{positive real numbers} numbers.\\

\noindent $\Re z$, $\Im z$ :  the real\index{real part} and imaginary\index{imaginary part}\index{$\Re z$}\index{$\Im z$}
parts of $z\in \C$; if $z = x+iy$, $\Re z = x$ and $\Im z = y$.\\

\noindent $S$ : the significand function: if $x > 0$ then $x = S(x) \cdot 10^{k(x)}$, where $S(x) \in [1, 10)$ and $k(x) \in \Z$; more generally one can study the significand function $S_B$ in base $B$.\\

\noindent $\cS$ : the significand $\sigma$-algebra. \\

\noindent supremum\index{supremum} : given a sequence $\{x_n\}_{n=1}^\infty$, the supremum of the set, denoted $\sup_n x_n$, is the smallest number $c$ (if one exists) such that $x_n \le c$ for all $n$, and for any $\gep > 0$ there is some $n_0$ such that $x_{n_0} > c - \gep$. If the sequence has finitely many terms, the supremum is the same as the maximum value.\\

\noindent u.d. mod $1$ : uniformly distributed modulo one. \\

\noindent ${\rm Var}(X)$ (or ${\rm var}(X)$) : the variance of the random variable $X$, assuming the expected value of $X$ is finite; ${\rm Var}(X) = \E[(X - \E[ X])^2]$.\\

\noindent $\W$ : the set of whole\index{whole numbers} numbers: $\{1, 2, 3, 4, \dots \}$.\\

\noindent $X_n \stackrel{\cD}{\to} X$ : $(X_n)$ converges in distribution to $X$. \\

\noindent $X_n \stackrel{a.s.}{\to} X$ : $(X_n)$ converges to $X$ almost surely. \\

\noindent $\overline{z}$, $|z|$ : the conjugate and absolute value of $z\in \C$.\\

\noindent $\Z$ : the set of\index{integers} integers: $\{ \dots, -2, -1, 0, 1, 2, \dots \}$.\\

\noindent $\Z^+$ : the set of non-negative integers, $\{ 0, 1, 2, \dots \}$.\\


\end{thenotation}



%\mainmatter

\pagenumbering{arabic}



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

\part{General Theory I: Basis of Benford's Law}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{A Quick Introduction to Benford's Law}

\begin{center}
\large \textsl{Steven\index{Miller, Steven J.} J. Miller\footnote{Department of Mathematics and Statistics, Williams College, Williamstown, MA 01267. The author was partially supported by NSF grants DMS0970067 and DMS1265673.}}\\ \ \normalsize
\end{center}

A couple of important points. \ \\

\begin{itemize}

\item There are many problems that would fit in multiple chapters. To help both the instructors and the readers, we have decided to collect them here. Thus, some of the exercises in this chapter will be far more accessible after reading later parts of the book. \\ \

\item In Mathematica, if you define the following function you can then use it to find the first digit: \begin{center} \begin{verbatim} firstdigit[x_] := Floor[10^Mod[Log[10,x],1]] \end{verbatim}\end{center} (a similar function is definable in other languages, but the syntax will differ slightly).

\end{itemize}

\ \\

\begin{exe} If $X$ is Benford base 10, find the probability that its significand starts 2.789. \end{exe}

%Answer:  $Prob( (D_1,D_2,D_3,D_4) = (2, 7, 8, 9) ) = \log_{10}  \frac{2790}{2789} = 0.0001557$


\begin{exe} If $X$ is Benford base 10, find the probability that its
significand starts with 7.5 (in other words, its significand is in $[7.5,
7.6)$). \end{exe}

%Answer: ${\rm Prob}((D_1,D_2) = (7, 5) ) = log_{10}  \frac{76}{75} = 0.007572$


\begin{exe} If $X$ is Benford base 10, find the probability that its significant has no 7's in the first $k$ digits (thus a significand of 1.701 would have no 7 in its first digit, but it would have a 7 in its first two digits. \end{exe}

E


\begin{exe} Consider $\alpha^n$ for various $\alpha$ and various ranges of $n$; for example, take $\alpha \in \{2, 3, 5, 10, \sqrt{2}, \sqrt{5}, \sqrt{10}, \pi, e, \gamma\}$ (here $\gamma$ is the Euler-Mascheroni constant, see \hfill\\ \burl{http://en.wikipedia.org/wiki/Euler-Mascheroni_constant} \ for a description and properties), and let $n$ go from 1 to $N$, where $N \in \{10^3, 10^5, 10^7\}$. Which of these data sets do you expect to be Benford? Why or why not. Read up about chi-square goodness of fit tests (see for example \hfill \\ \burl{http://en.wikipedia.org/wiki/Pearson_chi_square}) and compare the observed frequencies with the Benford probabilities.
\end{exe}

\begin{exe} Revisit the previous problem with more values of $N$. The problem is there we looked at three snapshots of the behavior; it is far more interesting to plot the chi-square values as a function of $N$, for $N$ ranging from say 100 to $10^7$ or more. You will see especially interesting behavior if you look at the first digits of $\pi^n$. \end{exe}

\begin{exe} We have seen that Benford behavior of a sequence is related to equidistribution of its logarithm. Thus, in the previous problem it may be useful to look at a log-log plot. Thus instead of plotting the chi-square value against the upper bound $N$, plot the logarithm of the chi-square value against $\log N$.
\end{exe}

\begin{exe} Frequently taking logarithms helps illuminate relationships. For example, Kepler's third law (see \hfill\\ \footnotesize \burl{http://www.physicsclassroom.com/class/circles/Lesson-4/Kepler-s-Three-Laws} \ \normalsize) says that the square of the time it takes a planet to orbit a sun is proportional to the cube of the semi-major axis. Find data for these quantities for the eight planets in our system (or nine if you count Pluto!) and plot them, and then do a log-log plot. A huge advantage of log-log plots is that linear relations are easy to observe and estimate; try and find the best fit line here, and note that the slope of the line should be close to 1.5 (if $T$ is the period and $L$ is the length of the semi-major axis, Kepler's third law is that there is a constant $C$ such that $T^2 = C L^3$, or equivalently $T = C L^{3/2}$, or $\log T = \frac32 \log L + \log C$). Revisit the original plot, and try to see that it supports $T^2$ is proportional to $L^3$! \end{exe}

\begin{exe} Prove the log-laws: If $\log_b x_i = y_i$ and $r > 0$ then
\begin{itemize}

\item $\log_b b = 1$ and $\log_b 1 = 0$ (note $\log_b x = y$ means $x = b^y$);

\item $\log_b (x^r) = r \log_b x$;

\item $\log_b(x_1 x_2) = \log_b x_1 + \log_b x_2$ (the logarithm of a product is the sum of the logarithms);

\item $\log_b(x_1 / x_2) = \log_b x_1 - \log_b x_2$ (the logarithm of a quotient is the difference of the logarithms; this follows directly from the previous two log-laws);

\item $\log_c x = \log_b x / \log_b c$ (this is the change of base formula).

\end{itemize}

\end{exe}


\begin{exe} The last log-law (the change of base formula) is often forgotten, but is especially important. It tells us that if we can compute logarithms in one base then we can compute them in any base. In other words, it suffices to create just \emph{one} table of logarithms, so we only need to find one base where we can easily compute logarithms. What base do you think that is, and how would you compute logarithms of arbitrary positive real numbers? \end{exe}

\begin{exe} The previous problem is similar to issues that arise in probability textbooks. These books only provide tables of probabilities of random variables drawn from a normal distribution\footnote{The random variable $X$ is normally distributed with mean $\mu$ and variance $\sigma^2$ if its probability density function is $f(x;\mu,\sigma) = \exp\left(-(x-\mu)^2/(2\sigma^2)\right) / \sqrt{2\pi \sigma^2}$.}, as one can convert from such a table to probabilities for any other random variable. One such table is online here:\hfill\\ \footnotesize \burl{http://www.mathsisfun.com/data/standard-normal-distribution-table.html} \ \normalsize. Use a standard table to determine the probability a normal random variable with mean $\mu = 5$ and variance $\sigma^2 = 16$ (so the standard deviation is $\sigma = 4$) takes on a value between -3 and 7. Thus, similar to the change of base formula, there is an enormous computational savings as we only need to compute probabilities for one normal distribution.
\end{exe}

\begin{exe} Prove $\frac{d}{dx} \log_b x = \frac1{x\log b}$. \emph{Hint: first do this when $b = e$, the base of the natural logarithms; use $e^{\log x} = x$ and the chain rule.} \end{exe}

\begin{exe} Revisit the first two problems, but now consider some other sequences, such as $n!$, $\cos(n)$ (in radians of course as otherwise the sequence is periodic), $n^2$, $n^3$, $n^{\log n}$, $n^{\log\log n}$, $n^{\log\log\log n}$, $n^n$.  \emph{In some situations $\log_4$ does not mean the logarithm base 4, but rather four iterations of the logarithm function. It might be interesting to investigating $n^{\log_{f(n)} n}$ under this definition for various integer-valued functions $f$.}
\end{exe}

\begin{comment}
firstdigit[x_] := Floor[10^Mod[Log[10, x], 1]]
num = 10000;
obs = {};
benf = {};
For[d = 1, d <= 9, d++, count[d] = 0];
For[n = 1, n <= num, n++,
  {
   x = n^(Log[n] 1.0);
   x = firstdigit[x];
   count[x] = count[x]  +  1;
   }];
For[d = 1, d <= 9, d++,
  {
   count[d] = count[d]/num;
   obs = AppendTo[obs, {d, count[d]}];
   benf = AppendTo[benf, {d, Log[10, 1 + 1/d]}];
   }];
Print[ListPlot[{obs, benf}]]
Print[ListPlot[{benf}]]
\end{comment}

\begin{exe} Revisit the previous problem but for some recurrence relations. For example, try the Fibonacci numbers ($F_{n+2} = F_{n+1} + F_n$ with $F_0 = 0$ and $F_1 = 1$) and some other relations, such as:

\begin{itemize}

\item Catalan numbers: $C_n = \frac1{n+1}\ncr{2n}{n}$; these satisfy a more involved recurrence (see \hfill \\  \textcolor{blue}{\url{http://en.wikipedia.org/wiki/Catalan_number}}\ ).

\item Squaring Fibonaccis: $G_{n+2} = G_{n+1}^2 + G_n^2$ with $G_0 = 0$ and $G_1 = 1$.

\item $F_p$ where $p$ is a prime (i.e., only look at the Fibonaccis at a prime index).

\item The logistic map: $x_{n+1} = r x_n (1 - x_n)$ for various choices of $r$ and various starting values $x_0$ (see \footnotesize \burl{http://en.wikipedia.org/wiki/Recurrence_relation} \ \normalsize).

\item Newton's method for the \emph{difference} between the $n$\textsuperscript{th} prediction and the true value. For example, to find the square-root of $\alpha$ one uses $x_{n+1} = \frac12\left(x_n + \frac{\alpha}{x_n}\right)$, and thus we would study the distribution of leading digits of $|\sqrt{\alpha} - x_n|$. One could also look at other roots, other numbers, or more complicated functions. For more on Newton's method, see \burl{http://mathworld.wolfram.com/NewtonsMethod.html}.

\item The $3x+1$ Map: $x_{n+1} = 3x_n+1$ if $x_n$ is odd and $x_n/2$ if $x_n$ is even (though some authors use a slightly different definition, where for $x_n$ even one instead lets $x_{n+1} = x_n/2^d$, where $d$ is the highest power of 2 dividing $x_n$). It is conjectured that no matter what positive starting seed $x_0$ you take, eventually $x_n$ cycles among 4, 2 and 1 for $n$ sufficiently large (or is identically 1 from some point onward if we use the second definition). We return to this problem in Chapter 3.

\end{itemize}

\end{exe}

For the remaining problems, whenever a data set satisfies Benford's law we mean the \emph{strong} version of the law. This means the  cumulative distribution function of the significand is $F_X(s) = \log_{10}(s)$ for $s \in [1, 10)$, which implies that the probability of a first digit of $d$ is $\log_{10}(1 + 1/d)$.

\begin{exe} If a data set satisfies (the strong version of) Benford's law base 10, what are the probabilities of all pairs of leading digits? In other words, what is the probability the first two digits are $d_1d_2$ (in that order)? What if instead our set were Benford base $b$?  \end{exe}

\begin{exe} Let $X$ be a random variable that satisfies (the strong version of) Benford's law. What is the probability that the second digit is $d$? Note here that the possible values of $d$ range from 0 to 9. \end{exe}

\begin{exe} Building on the previous problem, compute the probability that a random variable satisfying the strong version of Benford's law has its $k$\textsuperscript{th} digit equal to $d$. If we denote these probabilities by $p_k(d)$, what is $\lim_{k\to\infty} p_k(d)$? Prove your claim.
\end{exe}

%Thought for proof: show no matter what the significand is, if $k$ is large the next probabilities are almost constant.


\begin{exe} Find a data set that is spread over several orders of magnitude, and investigate its Benfordness. For example, stock prices or volume traded on a company that has been around for decades. \end{exe}

\begin{exe} Look at some of the data sets from the previous exercises that were \emph{not} Benford, and see what happens if you multiply them together. For example, consider $n^2 \cdot \cos(n)$ (in radians), or $n^2 \sqrt{10}^n \cos(n)$, or even larger products. Does this support the claim in the chapter that products of random variables tend to converge to Benford behavior? \end{exe}

\begin{exe} Let $\mu_{k;b}$ denote the mean of significands of $k$ digits of random variables perfectly satisfying Benford's law, and let $\mu_b$ denote the mean of the significands of random variables perfectly following Benford's law. What is $\mu_{k;b}$ for $k \in {1,2,3}$? Does $\mu_{k;b}$ converge to $\mu_b$? If yes, bound $|\mu_{k;b}  - \mu_b|$ as a function of $k$.
\end{exe}

\begin{exe} Benford's law can be viewed as the distribution on significands arising from the density $p(x) = \frac{1}{x\log (10)}$ on $[1,10)$ (and 0 otherwise). More generally, consider densities $p_r(x) = C_r / x^r$ for $x \in [1, 10)$ and 0 otherwise with $r \in (-\infty, \infty)$, where $C_r$ is a normalization constant so that the density integrates to 1. For each $r$, calculate the probability of observing a first digit of $d$, and calculate the expected value of the first digit. \end{exe}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\chapter{A Short Introduction to the Mathematical Theory of Benford's Law}

\addtocounter{chapter}{1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Fourier Analysis and Benford's Law}

\begin{center}
\large \textsl{Steven\index{Miller, Steven J.} J. Miller\footnote{Department of Mathematics and Statistics, Williams College, Williamstown, MA 01267. The author was partially supported by NSF grants DMS0970067 and DMS1265673.}}\\ \ \normalsize
\end{center}

\section{Problems from Introduction to Fourier Analysis}

The following exercises are from the chapter ``An Introduction to Fourier Analysis'', from the book \emph{An Invitation to Modern Number Theory} (Princeton University Press, Steven J. Miller and Ramin Takloo-Bighash). This chapter is available online on the webpage for this book (go to the links for Chapter 3).

\begin{exe} Prove $e^x$ converges for all $x \in \R$ (even better,
for all $x \in \C$). Show the series for $e^x$ also equals \be
\lim_{n \rightarrow \infty} \left(1 + \frac{x}{n} \right)^n, \ee
which you may remember from compound interest problems. \end{exe}

\begin{exe} Prove, using the series definition, that $e^{x+y} =
e^x e^y$and calculate the derivative of $e^x$.
\end{exe}

\begin{exe} Let $f$, $g$ and $h$ be continuous functions on $[0,1]$, and $a, b \in
\C$. Prove \ben \item $\langle f, f \rangle \ge 0$, and equals $0$
if and only if $f$ is identically zero; \item $\langle f, g\rangle
= \overline{ \langle g, f\rangle }$; \item $\langle af + bg,
h\rangle = a\langle f, h\rangle + b\langle g, h\rangle$. \een
\end{exe}

\begin{exe} Find a vector $\vec{v} = \left( {v_1 \atop v_2} \right)
\in \C^2$ such that
$v_1^2 + v_2^2 = 0$, but $\langle \vec{v}, \vec{v}\rangle \neq 0$.
\end{exe}

\begin{exe} Prove $x^n$ and $x^m$ are not perpendicular on
$[0,1]$. Find a $c \in \R$ such that $x^n - c x^m$ is
perpendicular to $x^m$; $c$ is related to the projection of $x^n$
in the direction of $x^m$.
\end{exe}

\begin{exe}[Important] Show for $m,n\in\Z$ that
\be \twocase{\langle e_m(x),e_n(x)\rangle \ = \ }{1}{if
$m=n$}{0}{otherwise.}\ee \end{exe}

\begin{exe} Let $f$ and $g$ be periodic functions with period $a$.
Prove $\alpha f(x) + \beta g(x)$ is periodic with period $a$.
\end{exe}

\begin{exe} Prove any function can be written as the sum of an
even and an odd function.
\end{exe}

\begin{exe} Show
\be \langle f(x) - \widehat{f}(n) e_n(x), e_n(x)\rangle \ = \  0
.\ee This agrees with our intuition: after removing the projection
in a certain direction, what is left is perpendicular to that
direction.
\end{exe}

\begin{exe}\label{exegoodpropsfourier} Prove
\ben \item $\langle f(x) - S_N(x), e_n(x)\rangle = 0$ if $|n| \le
N$. \item $|\widehat{f}(n)| \le \int_0^1 |f(x)|dx$. \item
Bessel's\index{Fourier analysis!Bessel's
inequality}\index{Bessel's inequality} Inequality: if $\langle f,f
\rangle < \infty$ then $\sum_{n=-\infty}^\infty |\widehat{f}(n)|^2
\le \langle f,f \rangle$. \item
Riemann-Lebesgue Lemma: if
$\langle f,f \rangle < \infty$ then $\lim_{|n| \rightarrow \infty}
\widehat{f}(n) = 0$ (this holds for more general $f$; it suffices
that $\int_0^1|f(x)|dx < \infty$). \item Assume $f$ is
differentiable $k$ times; integrating by parts, show
$|\widehat{f}(n)| \ll \frac{1}{n^k}$ and the constant depends only
on $f$ and its first $k$ derivatives. \een
\end{exe}

\begin{exe} Let $h(x) = f(x) + g(x)$. Does $\widehat{h}(n) =
\widehat{f}(n)+\widehat{g}(n)$? Let $k(x) = f(x)g(x)$. Does
$\widehat{k}(n) = \widehat{f}(n)\widehat{g}(n)$? \end{exe}

\begin{exe} Remark 11.2.4 shows that if $\langle
f,f\rangle, \langle g,g\rangle < \infty$ then the dot product of
$f$ and $g$ exists: $\langle f, g \rangle < \infty$. Do there
exist $f, g:[0,1] \to \C$ such that $\int_0^1 |f(x)|dx, \int_0^1
|g(x)|dx < \infty$ but $\int_0^1 f(x)\overline{g}(x)dx = \infty$?
Is $f \in L^2([0,1])$ a stronger or an equivalent assumption as $f
\in L^1([0,1])$?
\end{exe}

\begin{exe} Define
\be \twocase{A_N(x) \ = \ }{N}{for $|x| \le
\frac{1}{N}$}{0}{otherwise.} \ee Prove $A_N$ is an approximation
to the identity on $[-\foh,\foh]$. If $f$ is continuously
differentiable and periodic with period $1$, calculate \be \lim_{N
\to \infty} \int_{-\foh}^\foh f(x) A_N(x) dx. \ee
\end{exe}

\begin{exe} Let $A(x)$ be a non-negative function with $\int_\R
A(x)dx = 1$. Prove $A_N(x) = N\cdot A(Nx)$ is an approximation to
the identity on $\R$.
\end{exe}

\begin{exe}[Important]\label{exeapproxiden}
Let $A_N(x)$ be an approximation to the identity on
$[-\foh,\foh]$. Let $f(x)$ be a continuous function on
$[-\foh,\foh]$. Prove \be \lim_{N \to \infty} \int_{-\foh}^\foh
f(x) A_N(x)dx \ = \ f(0). \ee
\end{exe}

\begin{exe} Prove the two formulas above. The
geometric series formula
will be helpful: \be \sum_{n= N}^M r^n \ = \ \frac{r^N -
r^{M+1}}{1 - r}. \ee
\end{exe}

\begin{exe} Show that the Dirichlet kernels are \emph{not} an
approximation to the identity. How large are $\int_0^1 |D_N(x)|dx$
and $\int_0^1 D_N(x)^2dx$?
\end{exe}

\begin{exe} Prove the Weierstrass Approximation Theorem implies
the original version of Weierstrass' Theorem. \end{exe}

\begin{exe} Let $f(x)$ be periodic function with period $1$. Show
\be S_N(x_0) \ = \  \int_{-\foh}^\foh f(x) D_N(x-x_0) dx \ = \
\int_{-\foh}^\foh f(x_0-x) D_N(x) dx. \ee
\end{exe}

\begin{exe} Let $\widehat{f}(n) = \frac{1}{2^{|n|}}$. Does
$\sum_{-\infty}^\infty \widehat{f}(n) e_n(x)$ converge to a
continuous, differentiable function? If so, is there a simple
expression for that function? \end{exe}

\begin{exe} Fill in the details for the above proof. Prove the result
for all $f$ satisfying $\int_0^1|f(x)|^2dx < \infty$. \end{exe}

\begin{exe} If $\int_0^1 |f(x)|^2dx < \infty$, show Bessel's
Inequality implies there exists a $B$ such that $|\widehat{f}(n)|
\le B$ for all $n$. \end{exe}

\begin{exe} Though we used $|a+b|^2 \le 4|a|^2 + 4|b|^2$, any
bound of the form $c|a|^2 + c|b|^2$ would suffice. What is the
smallest $c$ that works for all $a,b \in \C$? \end{exe}

\begin{exe}\label{exe:calczetatwo} Let $f(x) = \foh - |x|$ on $[-\foh,\foh]$. Calculate
$\sum_{n=0}^\infty \frac1{(2n+1)^2}$. Use this to deduce the value
of $\sum_{n =1}^\infty \frac{1}{n^2}$. This is often denoted
$\zeta(2)$  (see Exercise 3.1.7). See [BP]\footnote{E. Bombieri and A. van der Poorten, \emph{Continued fractions of
algebraic numbers}. Pages 137--152 in \emph{Computational Algebra
and Number Theory (Sydney, 1992)}, Mathematical Applications,  Vol.
325, Kluwer Academic, Dordrecht, 1995.} for
connections with continued fractions, and [Kar]\footnote{A. Karlsson, \emph{Applications of heat kernels on Abelian groups:
$\zeta(2n)$, quadratic reciprocity, Bessel integral}, preprint.
} for connections
with quadratic reciprocity.
\end{exe}

\begin{exe} Let $f(x) = x$ on $[0,1]$. Evaluate
$\sum_{n=1}^\infty \frac1{n^2}$. \end{exe}

\begin{exe}\label{exe:pi4} Let $f(x) = x$ on $[-\foh,\foh]$. Prove $\frac{\pi}{4}
= \sum_{n=1}^\infty \frac{(-1)^{n+1}}{(2n-1)^2}$. See also
Exercise 3.3.29; see Chapter $11$ of [BB]\footnote{J. Borwein and P. Borwein, \emph{Pi and the AGM: A Study in
Analytic Number Theory and Computational Complexity}, John Wiley
and Sons, New York, $1987$.} or [Sc]\footnote{P. Schumer, \emph{Mathematical Journeys}, Wiley-Interscience, John
Wiley \& Sons, New York, $2004$.} for a history of calculations of $\pi$.
\end{exe}

\begin{exe} Find a function to determine $\sum_{n=1}^\infty \frac1{n^4}$.\end{exe}

\begin{exe} Show the Gaussian $f(x) =
\frac{1}{\sqrt{2\pi\sigma^2}}\ e^{-(x-\mu)^2/2\sigma^2}$ is in
$\mathcal{S}(\R)$ for any $\mu, \sigma\in\R$. \end{exe}

\begin{exe}\label{exe:schwartzcsA}
Let $f(x)$ be a Schwartz function with compact
support contained in $[-\sigma,\sigma]$ and denote its Fourier
transform by $\widehat{f}(y)$. Prove for any integer $A>0$ that
$|\widehat{f}(y)| \le c_f y^{-A}$, where the constant $c_f$
depends only on $f$, its derivatives and $\sigma$. As such a bound
is useless at $y=0$, one often derives bounds of the form
$|\widehat{f}(y)| \le \frac{\widetilde{c_f}}{(1+|y|)^A}$.
\end{exe}

\begin{exe} Consider \be \twocase{f(x) \ = \
}{n^6\left(\frac{1}{n^4} - |n - x|\right)}{if $|x-n| \le
\frac{1}{n^4}$ for some $n\in\Z$}{0}{otherwise.} \ee Show $f(x)$
is continuous but $F(0)$ is undefined. Show $F(x)$ converges and
is well defined for any $x \not\in\Z$.
\end{exe}

\begin{exe} Prove Lemma 11.4.8. \end{exe}

\begin{exe} For what weaker assumptions
on $f, f', f''$ is the conclusion of Lemma 11.4.10 still
true?
\end{exe}

\begin{exe}\label{exefubini}
One cannot always interchange orders of integration. For
simplicity, we give a sequence $a_{mn}$ such that $\sum_m (\sum_n
a_{m,n}) \neq \sum_n (\sum_m a_{m,n})$. For $m, n \ge 0$ let \be
a_{m,n} \ = \ \begin{cases} \ \ \ 1 & \text{{\rm if $n=m$}} \\
-1 & \text{{\rm if $n=m+1$}} \\ \ \ \ 0 & \text{{\rm otherwise.}}
\end{cases}\ee Show that the two different orders of summation yield
different answers (the reason for this is that the sum of the
absolute value of the terms diverges).
\end{exe}

\begin{exe} The example in the previous remark has $\lim_{n\to\infty} \max_x |f_n(x)| = \infty$; in other words, there is no $M$ such that $|f_n(x)| \le M$ for all $M$ and $x$. Find a family of functions $f_n(x)$ such that \be \lim_{n\to\infty} \int_{-\infty}^\infty f_n(x)dx \ \neq \ \int_{-\infty}^\infty \lim_{n\to\infty} f_n(x)dx \ee and each $f_n(x)$ and $f(x)$ is continuous and $|f_n(x)|, |f(x)| \le M$ for some $M$ and all $x$. \end{exe}

\begin{exe}\label{exe:conv0} Let $f, g$ be continuous functions on $I = [0,1]$ or $I=\R$.
Show if $\langle f,f\rangle, \langle g,g\rangle  < \infty$ then $h
= f \ast g$ exists. \emph{Hint:} Use the Cauchy-Schwarz
inequality. Show further that $\widehat{h}(n) = \widehat{f}(n)
\widehat{g}(n)$ if $I = [0,1]$ or if $I = \R$. Thus the Fourier
transform converts convolution to multiplication.
\end{exe}

\begin{exe} Prove (11.77). \end{exe}

\begin{exe}[Important]\label{exe:conv1} If for all $i = 1, 2, \dots$
we have $\langle f_i,f_i\rangle < \infty$, prove for all $i$ and
$j$ that $\langle f_i\ast f_j, f_i\ast f_j\rangle < \infty$. What
about $f_1 \ast (f_2 \ast f_3)$ (and so on)?  Prove $f_1 \ast (f_2
\ast f_3) = (f_1\ast f_2) \ast f_3$. Therefore convolution is
associative, and we may write $f_1 \ast \cdots \ast f_N$ for the
convolution of $N$ functions.
\end{exe}

\begin{exe}\label{exe:conv2} Suppose $X_1, \dots, X_N$ are
i.i.d.r.v. from a probability distribution $p$ on $\R$. Determine
the probability that $X_1 + \cdots +X_N \in [a,b]$. What must be
assumed about $p$ for the integrals to converge? \end{exe}

\begin{exe}\label{exe:FTdtom} One useful property of the Fourier transform is that the
derivative of $\widehat{g}$ is the Fourier transform of $2\pi i x
g(x)$; thus, differentiation (hard) is converted to multiplication
(easy). Explicitly, show \be \widehat{g}'(y)\ =\
\int_{-\infty}^\infty 2\pi i x\cdot g(x) e^{-2\pi i x y} dx. \ee
If $g$ is a probability density, note $\widehat{g}'(0) = -2\pi i
\mathbb{E}[x]$ and $\widehat{g}''(0) = -4\pi^2\mathbb{E}[x^2]$.
\end{exe}

\begin{exe}\label{exe:cltBA} If $B(x) = A(cx)$ for some fixed $c\neq 0$, show
$\widehat{B}(y) = \frac1{c} \widehat{A}\left(\frac{y}{c}\right)$.
\end{exe}

\begin{exe} Show that if the probability density of $X_1 + \cdots
+ X_N = x$ is $(p \ast \cdots \ast p)(x)$ (i.e., the distribution
of the sum is given by $p\ast \cdots \ast p$), then the
probability density of $\frac{X_1 + \cdots + X_N}{\sqrt{N}} = x$
is $(\sqrt{N} p \ast \cdots \ast \sqrt{N} p)(x\sqrt{N})$. By
Exercise \ref{exe:cltBA}, show \be \text{FT}\left[(\sqrt{N} p \ast
\cdots \ast \sqrt{N} p)(x\sqrt{N})\right](y) \ =\ \left[
\widehat{p}\left(\frac{y}{\sqrt{N}}\right)\right]^N. \ee
\end{exe}

\begin{exe} Show for any fixed $y$ that
 \be \lim_{N\to\infty}\left[1 - \frac{2\pi^2 y^2}{N} +
O\left(\frac{y^3}{N^{3/2}}\right) \right]^N \ = \ e^{-2\pi^2 y^2}.\ee
\end{exe}

\begin{exe} Show that the Fourier transform of $e^{-2\pi^2 y^2}$ at
$x$ is $\frac{1}{\sqrt{2\pi}}\ e^{-x^2/2}$. \emph{Hint:} This
problem requires contour integration from complex analysis.
\end{exe}

\begin{exe} Modify the proof to deal with the case of $p$ having
mean $\mu$ and variance $\sigma^2$. \end{exe}

\begin{exe} For reasonable assumptions on $p$, estimate the rate
of convergence to the Gaussian. \end{exe}

\begin{exe} Let $p_1, p_2$ be two probability densities satisfying
(11.79). Consider $S_N = X_1 + \cdots + X_N$, where
for each $i$, $X_1$ is equally likely to be drawn randomly from
$p_1$ \emph{or} $p_2$. Show the Central Limit Theorem is still
true in this case. What if we instead had a fixed, finite number
of such distributions $p_1, \dots, p_k$, and for each $i$  we draw
$X_i$ from $p_j$ with probability $q_j$ (of course, $q_1 + \cdots
+ q_k = 1$)?
\end{exe}

\begin{exe}[Gibbs Phenomenon] Define a periodic with period $1$
function by \be \twocase{f(x) \ = \ }{-1}{if $-\foh \le x < 0$}{\
1}{if $0 \le x < \foh$.} \ee Prove that the Fourier coefficients
are \be \twocase{\widehat{f}(n) \ = \ }{0}{if $n$ is
even}{\frac{4}{n\pi i}}{if $n$ is odd.} \ee Show that the
$N$\textsuperscript{th} partial Fourier series $S_N(x)$ converges
pointwise to $f(x)$ wherever $f$ is continuous, but overshoots and
undershoots for $x$ near $0$. \emph{Hint:} Express the series
expansion for $S_N(x)$ as a sum of sines. Note $\frac{\sin(2m\pi
x)}{2m\pi} = \int_0^x \cos(2m\pi t)dt$. Express this as the real
part of a geometric series of complex exponentials, and use the
geometric series formula. This will lead to \be S_{2N-1}(x) \ = \
8\int_0^{x} \Re\left( \frac{1}{2i} \frac{e^{4n\pi i t} -
1}{\sin(2\pi t)} \right) dt \ = \ 4\int_0^{x} \frac{\sin(4n\pi
t)}{\sin(2\pi t)}dt, \ee which is about $1.179$ (or an overshoot
of about $18\%$) when $x = \frac{1}{4n\pi}$. What can you say
about the Fej\'{e}r series $T_N(x)$ for $x$ near $0$? \end{exe}

\begin{exe}[Nowhere Differentiable Function] Weierstrass
constructed a continuous but nowhere differentiable function! We
give a modified example and sketch the proof. Consider \be f(x) \ =
\ \sum_{n=0}^\infty a^n \cos(2^n \cdot 2\pi x), \ \ \ \ \foh < a <
1. \ee Show $f$ is continuous but nowhere differentiable.
\emph{Hint:} First show $|a| < 1$ implies $f$ is continuous. Our
claim on $f$ follows from: if a periodic continuous function $g$ is
differentiable at $x_0$ and $\widehat{g}(n) = 0$ unless $n = \pm
2^m$, then there exists $C$ such that for all $n$, $|\widehat{g}(n)|
\le C n 2^{-n}$. To see this, show it suffices to consider $x_0 = 0$
and $g(0) = 0$. Our assumptions imply that $(g,e_m) = 0$ if $2^{n-1}
< m < 2^{n+1}$ and $m\neq 2^n$. We have $\widehat{g}(2^n) = (g,
e_{2^n} F_{2^{n-1}}(x))$ where $F_N$ is the Fej\'{e}r kernel. The
claim follows from bounding the integral $(g, e_{2^n}
F_{2^{n-1}}(x))$. In fact, more is true: Baire showed that, in a
certain sense, ``most'' continuous functions are nowhere
differentiable! See, for example, [Fol]\footnote{G. Folland, \emph{Real Analysis: Modern Techniques and Their
Applications}, 2nd edition, Pure and Applied Mathematics,
Wiley-Interscience, New York, 1999.}.
\end{exe}

\begin{exe}[Isoperimetric Inequality]
Let $\gamma(t) = (x(t),y(t))$ be a smooth closed curve in the
plane; we may assume it is parametrized by arc length and has
length $1$. Prove the enclosed area $A$ is largest when
$\gamma(t)$ is a circle. \emph{Hint:} By Green's Theorem (Theorem
A.2.9), \be\label{eq:greenipi} \oint_\gamma xdy - ydx \
= \ 2{\rm Area}(A). \ee The assumptions on $\gamma(t)$ imply
$x(t), y(t)$ are periodic functions with Fourier series expansions
and $\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 =
1$. Integrate this equality from $t=0$ to $t=1$ to obtain a
relation among the Fourier coefficients of $\frac{dx}{dt}$ and
$\frac{dx}{dt}$ (which are related to those of $x(t)$ and $y(t)$);
\eqref{eq:greenipi} gives another relation among the Fourier
coefficients. These relations imply $4\pi {\rm Area}(A) \le 1$
with strict inequality unless the Fourier coefficients vanish for
$|n| > 1$. After some algebra, one finds this implies we have a
strict inequality unless $\gamma$ is a circle.
\end{exe}

\begin{exe}[Applications to Differential Equations] One reason for
the introduction of Fourier series was to solve differential
equations. Consider the vibrating string problem: a unit
string with endpoints fixed is stretched into some initial
position and then released; describe its motion as time passes.
Let $u(x,t)$ denote the vertical displacement from the rest
position $x$ units from the left endpoint at time $t$. For all $t$
we have $u(0,t) = u(1,t) = 0$ as the endpoints are fixed. Ignoring
gravity and friction, for small displacements Newton's laws imply
\be \frac{\partial^2 u(x,t)}{\partial x^2} \ = \ c^2
\frac{\partial^2 u(x,t)}{\partial t^2}, \ee where $c$ depends on
the tension and density of the string. Guessing a solution of the
form \be u(x,t) \ = \ \sum_{n=1}^\infty a_n(t) \sin(n\pi x), \ee
solve for $a_n(t)$.

One can also study problems on $\R$ by using the Fourier
Transform. Its use stems from the fact that it converts
multiplication to differentiation, and vice versa: if $g(x) =
f'(x)$ and $h(x) = xf(x)$, prove that $\widehat{g}(y) =
2\pi iy\widehat{f}(y)$ and $\frac{d\widehat{f}(y)}{dy} =
-2 \pi i\widehat{h}(y)$. This and Fourier Inversion allow us to solve
problems such as the heat equation \be \frac{\partial
u(x,t)}{\partial t} \ = \ \frac{\partial^2 u(x,t)}{\partial x^2},
\ \ \ \ x \in \R, \ t
> 0\ee with initial conditions $u(x,0) = f(x)$.
\end{exe}


\section{Problems from Chapter 1: Revisited}

Many of the problems from Chapter 1 are appropriate here as well. In addition to re-examining those problems, consider the following.

\begin{exe} Is the sequence $a_n = n^{\log n}$ Benford? \end{exe}

\begin{exe} In some situations $\log_4$ does not mean the logarithm base 4, but rather four iterations of the logarithm function. Investigate $n^{\log_{f(n)} n}$ under this definition for various integer-valued functions $f$. \end{exe}


\section{Problems from Chapter 3}

\begin{exe} Assume an infinite sequence of real numbers $\{x_n\}$ has its logarithms modulo 1, $\{y_n = \log_{10} x_n \bmod 1\}$, satisfying  the following property: as $n\to\infty$ the proportion of $y_n$ in any interval $[a,b] \subset [0,1]$ converges to $b-a$ \textbf{\emph{if}} $b-a > 1/2$. Prove or disprove that $\{x_n\}$ is Benford. \end{exe}

\begin{exe} As $\sqrt{2}$ is irrational, the sequence $\{x_n = n\sqrt{2}\}$ is uniformly distributed modulo 1. Is the sequence $\{x_n^2\}$
uniformly distributed modulo 1? \end{exe}

\begin{exe} Does there exist an irrational $\alpha$ such that $\alpha$ is a root of a quadratic polynomial with integer coefficients \emph{and} the sequence  $\{\alpha^n\}_{n=1}^\infty$ is Benford base 10? \end{exe}

%\begin{exe} Is $(\pi n+\sin(\pi n/16)+1) = \{\pi+\sin(\pi/16)+1, 2\pi+\sin(\pi/8)+1, 3\pi+\sin(3\pi/16)+1, \dots\}$ uniformly distributed mod 1? \end{exe}

\begin{exe} Which of the following are Benford, and why?
\begin{itemize}
\item $\{nx^2\} = \{x^2, 2x^2, 3x^2, 4x^2, \dots\}$ for $x>1$.
\item $\{n\pi^2\} = \{\pi^2, 2\pi^2, 3\pi^2, 4\pi^2, \dots\}$.
\item $\{n^2\pi^2\} = \{\pi^2, 4\pi^2, 9\pi^2, 16\pi^2, \dots\}$.
\item $\{5^n+2^n\} = \{7, 29, 133, 641, \dots\}$.
\item $\{e^{1+n\pi}\} = \{e^{1+\pi}, e^{1+2\pi}, e^{1+3\pi}, e^{1+4\pi}, \dots\}$.
\item $1/X$, where $X$ is a random variable uniformly distributed on $[0,5)$.
\end{itemize}
\end{exe}


\begin{exe} We showed a Geometric Brownian Motion is a Benford-good process; is the sum of two independent Geometric Brownian Motions Benford-good? \end{exe}

The next few questions are related to a map we now describe. We showed that, suitably viewed, the $3x+1$ Map leads to Benford behavior (or is close to Benford for almost all large starting seeds). Consider the following map. Let $R(x)$ be the number formed by writing the digits of $x$ in reverse order. If $R(x) = x$ we say $x$ is palindromic. If $x$ is not a palindromic number set $P(x) = x + R(x)$, and if $x$ is palindromic let $P(x) = x$. For a given starting seed $x_0$ consider the sequence where $x_{n+1} = P(x)$. It is not known if there are any $x_0$ such that the resulting sequence diverges to infinity, though it is believed that almost all such numbers do. The first candidate to escape is 196; for more see \burl{http://en.wikipedia.org/wiki/Lychrel_number} (this process is also called ``reverse-and-add'', and the candidates are called Lychrel numbers).

\begin{exe} Consider the reverse-and-add map described above applied to a large starting seed. Find as good of a lower bound as you can for the number of seeds between $10^n$ and $10^{n+1}$ such that the resulting sequence stabilizes (i.e., we eventually hit a palindrome). \end{exe}

\begin{exe} Come up with a model to estimate the probability a given starting seed in $10^n$ and $10^{n+1}$ has its iterates under the reverse-and-add map diverge to infinity. \emph{Hint: $x$ plus $R(x)$ is a palindrome if and only if there are no carries when we add; thus you must estimate the probability of having no carries.} \end{exe}

\begin{exe} Investigate the Benfordness of sequences arising from the reverse-and-add map for various starting seeds. Of course the calculation is complicated by our lack of knowledge about this map, specifically we don't know even one starting seed that diverges! Look at what happens with various Lycherel numbers. For each $N$ can you find a starting seed $x_0$ such that it iterates to a palindrome after $N$ or more steps? \end{exe}

\begin{exe} Redo the previous three problems in different bases. Your answer will depend now on the base; for example, much more is known base 2 (there we can give specific starting seeds that iterate to infinity). \end{exe}

\begin{exe} Use the Erd\"os-Turan Inequality to calculate upper bounds for the discrepancy for various sequences, and use those results to prove Benford behavior. Note you need to find a sequence where you can do the resulting computation. For example, earlier we investigated $a_n = n^{\log n}$; are you able to do the summation for this case? \end{exe}

\begin{exe} Consider the analysis of products of random variables. Fix a probability $p$ (maybe $p = 1/2$), and independent identically distributed random variables $X_1, \dots, X_n$. Assume as $n\to\infty$ the product of the $X_i$'s becomes Benford.  What if now we let $\widetilde{\mathcal{X}_n}$ be the random variable where we toss $n$ independent coins, each with probability $p$, and if the $i$\textsuperscript{th} toss is a head then $X_i$ is in the product (if the product is empty we use the standard convention that it is then 1). Is this process Benford? \end{exe}

\begin{exe} Redo the previous problem, but drop the assumption that the random variables are identically distributed. \end{exe}

\begin{exe} Redo the previous two problems, but now allow the probability that the $i$\textsuperscript{th} toss is a head to depend on $i$. \end{exe}

\begin{exe} Consider \be \twocase{\phi_{m} \ = \ }{m}{{\rm if} $|x - \frac18|
\le \frac1{2m}$}{0}{{\rm otherwise;}} \ee this  is the function from Example 3.3.5 and led to non-Benford behavior for the product. Can you write down the density for the product? \end{exe}

\begin{exe} In the spirit of the previous problem, find other random variables where the product is not Benford. \end{exe}

\begin{exe} Consider a Weibull random variable where we fix the scale parameter $\alpha$ to be 1 and the translation parameter $\beta$ to be 0; thus $f(x;\gamma) = x^{\gamma-1} \exp(x^\gamma)$ for $x\ge 0$ and is zero otherwise. Investigate the Benfordness of chaining random variables here, where the shape parameter $\gamma$ is the output of the previous step. \end{exe}

\begin{exe} The methods of [JKKKM] led to good bounds for chaining exponential and uniform random variables. Can you obtain good, explicit bounds in other cases? For example, consider a binomial process with fixed parameter $p$. \end{exe}

\begin{exe} Apply the methods of Cuff, Lewis and Miller (for the Weibull distribution)to other random variables. Consider the generalized Gamma distribution (see \begin{center} \small \burl{http://en.wikipedia.org/wiki/Generalized_gamma_distribution} \normalsize \end{center} for more information), where the density is $$f(x;a,d,p) \ = \ \frac{p/d^a}{\Gamma(d/p)} x^{d-1} \exp\left(-(x/a)^p\right)$$ for $x > 0$ and 0 otherwise, where $a,d,p$ are positive parameters. \end{exe}


%\begin{exe}
%Show that if $p_{a}\left(x\right)=\frac{C_{a}}{\left(1+\left(\frac{x}{a}\right)^{2}\right)}$,
%where $0<a$ and $C_{a}$ is a constant such that
%$\int_{-\infty}^{\infty}p_{a}\left(x\right) = 1$, then the error term $E_{a}$ of $p_{a}\left(x\right)$
%is the same as the error term for the Standard Gaussian Distribution function, $p\left(x\right)$.
%\end{exe}

For the next few problems, let $f_r(x) - 1/(1+|x|^r)$ with $r>1$.

\begin{exe}
Show that for
$r>1$, $\int_{-\infty}^{\infty}f_{r}\left(x\right)dx$
is finite. Verify that $\int_{-\infty}^{\infty}f_{r}\left(x\right)dx$
$=\frac{2\pi}{r}\csc\left(\frac{\pi}{r}\right)$.
\end{exe}

\begin{exe}\label{fouriertransform}
Verify that the Fourier transform identity used in our analysis:
\be\label{exerciseft} p_{r}\left(e^{b+y}\right)e^{b+y}\ =\ \frac{1}{2}\sin\left(\frac{\pi}{r}\right)e^{2\pi iby}\csc\left(\frac{\pi}{r}\left(1-2\pi iy\right)\right),\nonumber\ee where $b \in [0,1]$.
\end{exe}



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

\part{General Theory II: Distributions and Rates of Convergence}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Benford's Law Geometry}

\begin{center}
\large \textsl{Lawrence\index{Leemis, Lawrence} Leemis\footnote{Department of Mathematics, The College of William \& Mary, Williamsburg, VA 23187.}}\\ \ \normalsize
\end{center}


\begin{exe} Perform a chi-square goodness-of-fit test on the data values in Table 4.1. \end{exe}

\begin{exe} Let the random variable $X$ have the Benford distribution as defined in this chapter.  Find $\mathbb{E}[X]$.  Next, generate one million Benford random variates and compute their sample mean. Perform this Monte Carlo experiment several times to assure that the sample means are near $\mathbb{E}[X]$. \end{exe}

\begin{exe} Let $T \sim \hbox{exponential}(1)$.  Find the probability mass function of the leading digit to three-digit accuracy. Compare your results to those in Table 4.2. \end{exe}

\begin{exe} Redo the previous exercise, but instead of finding the probability mass function of the leading digit, find  the cumulative distribution function of the significand (i.e., find the probability of observing a significand of at most $s$). \end{exe}

\begin{exe} Determine the set of conditions on $a$, $b$, and $c$ associated with $W \sim$ $\hbox{triangular}(a, b, c)$ which result in $T = 10^W$ following Benford's Law. \end{exe}

%In Section 4.2, code in R is provided to determine the probability mass function of $Y$ for the unit Raleigh distribution, where $Y$ is leading digit of the continuous random variable $T$.

\begin{exe} Use R to confirm that the cumulative distribution function $F_x(x) = {\rm Prob}(X\le x) = \log_{10}(x+1)$ results in a probability mass function that gives the distribution specified in Benford's Law. What is the range of $x$? \end{exe}

\begin{exe} Use R to determine if the cumulative distribution function $F_x(x) = {\rm Prob}(X\leq x) = x^2$ (for some range for $x$) results in a probability mass function that gives the distribution specified in Benford's Law. If yes, what is the range for $x$? \end{exe}

\begin{exe} Which of the following distributions of $W$ follow Benford's Law?
\begin{itemize}
\item $f_W(w) \sim U(0,3.5)$.						%(NO)

\item $f_W(w) \sim U(17,117)$.						%(YES)

\item $f_W(w) = w^3-w^2+w$ for $0\le w \le 1$, and $1-w^3+w^2-w$ for $1 \le w \le 2$.		%(YES)

\item $f_W(w) = \sqrt{w}$ for $0 \le w \le 1$, and $1- \sqrt{w-1}$ for $1 \le w \le 2$.		%(YES)

\end{itemize}
\end{exe}

\begin{exe} Let $b_1$ and $b_2$ be two different integers exceeding 1. Is there a probability density $p$ on an interval $I$ such that if a random variable $X$ has $p$ for its probability density function then $X$ is Benford in both base $b_1$ and $b_2$? What if the two bases are allowed to be real numbers exceeding 1? Prove your claims. \end{exe}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Explicit Error Bounds via Total Variation}

\begin{center}
\large \textsl{Lutz D\"{u}mbgen\index{D\"{u}mbgen, Lutz} and Christoph\index{Leuenberger, Christoph} Leuenberger\footnote{University of Bern, Bern, Switzerland and University of Fribourg, Fribourg, Switzerland respectively.}} \normalsize
\end{center}

\def\TV{\mathop{\mathrm{TV}}\nolimits}

%\begin{exe} What is the probability that $X$ has leading digits $d_0 = 3$ and $d_1 = 2$ in base 10? In base 4? In base 16? \end{exe}

%\begin{exe}
%Prove that KD(G) is bounded by the interval $[\sup\limits_{x\epsilon[0,1]} |{G(x)-x}|,
%2 (\sup\limits_{x\epsilon[0,1]} |G(x)-x|) ]$.
%\end{exe}

\begin{exe} Find $TV(\sin(x), [-\pi,\pi])$. \end{exe}

\begin{exe} Confirm that $TV(h,\mathbb{J}) = TV^+(h,\mathbb{J}) + TV^-(h,\mathbb{J})$.
\end{exe}


\begin{exe}
Let $Y_o$ and $Z$ be independent random variables such that $Y_o$ has a density $f_o$ with $\TV(f_o) < \infty$ and $Z$ has distribution $\pi$. Verify that $Y := Y_o + Z$ has density $f(y) = \int f_o(y - z) \, \pi(dz)$ with $\TV(f) \le \TV(f_o)$.
\end{exe}

\begin{exe}
Show that an absolutely continuous probability density $f$ on $\R$ satisfies
\[
	\TV(f)^2 \ \le \ \int \frac{f'(x)^2}{f(x)} \, dx .
\]
\end{exe}

\begin{exe}
\label{exe:gamma.1}
Let $\gamma_{a,\sigma}$ be the density of the gamma distribution $\mathrm{Gamma}(a,\sigma)$ with shape parameter $a > 0$ and scale parameter $\sigma > 0$, i.e.,
\[
	\gamma_{a,\sigma}(x) \ = \ \sigma^{-a} x^{a-1} \exp(- x/\sigma) / \Gamma(a)
\]
for $x > 0$, and $\gamma_{a,\sigma} = 0$ on $(-\infty,0]$.\\[0.5ex]
%
\textbf{(i)} Show that for $a \ge 1$,
\[
	\TV(\gamma_{a,\sigma}) \ = \ \sigma^{-1} \TV(\gamma_{a,1})
	\quad\text{and}\quad
	\TV(\gamma_{a,1}) \ = \ 2 ((a-1)/e)^{a-1} / \Gamma(a) .
\]
%
\textbf{(ii)} It is well-known that $\Gamma(t+1) = (t/e)^t \sqrt{2\pi t} (1 + o(1))$ as $t \to \infty$ (this is Stirling's formula). What does this imply for $\TV(\gamma_{a,1})$? Show that $\TV(\gamma_{a,\sigma}) \to 0$ as $\sqrt{a} \, \sigma \to \infty$ and $a \ge 1$.
\end{exe}

\begin{exe}
Let $X$ be a strictly positive random variable with density $h$ on $(0,\infty)$. Verify that $Y := \log_B(X)$ has density $f$ given by $f(y) = \log(B) B^y h(B^y)$ for $y \in \R$.
\end{exe}

\begin{exe}
Let $X$ be a random variable with distribution $\mathrm{Gamma}(a,\sigma)$ for some $a,\sigma > 0$; see Exercise~\ref{exe:gamma.1}\\[0.5ex]
%
\textbf{(i)} Determine the density $f_{a,\sigma}$ of $Y := \log_B(X)$. Here you should realize that $f_{a,\sigma}(y) = f_{a,1}(y - \log_B(\sigma))$. Show then that
\[
	\TV(f_{a,\sigma}) \ = \ 2 \log(B) (a/e)^a / \Gamma(a) .
\]
What happens as $a \to \infty$?\\[0.5ex]
%
\textbf{(ii)} To understand why the leading digits of $X$ are far from Benfords law for large $a$, verify that $X = \sigma(a + \sqrt{a} Z_a)$ for a random variable $Z_a$ with mean zero and variance one. (Indeed, the density of $Z_a$ converges uniformly to the standard Gaussian density as $a \to \infty$.) Now investigate the distribution of $Y = \log_B(X)$ as $a \to \infty$.
\end{exe}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{L\'evy Processes and Benford�s Law}

\begin{center}
\large \textsl{Klaus\index{Sch\"urger, Klaus} Sch\"urger\footnote{Department of Economics, University of Bonn, Adenauerallee 24-42, 53113 Bonn, Germany.}}\\ \ \normalsize
\end{center}

%\begin{exe} Define the following terms:
%\begin{itemize}
%\item Characteristic function.
%\item Infinitely divisible.
%\item Generating triple.
%\item L\'{e}vy measure.
%\end{itemize}
%\end{exe}

\begin{exe} Provide an example of a non-continuous cadlag function. \end{exe}

\begin{exe} Prove that a Weiner Process is also a L\'{e}vy Process. \end{exe}

\begin{exe} Prove that a Poisson Process is also a L\'{e}vy Process. \end{exe}

\begin{exe} Prove that the exponential L\'{e}vy Process $\{\exp(X_t)\}$ $(t \in \mathbb{R})$ is a martingale with respect to $(\mathcal{F}_t) := \sigma\{X_s : s \leq t\}$ if and only if $\mathbb{E}[\exp(X_t)] = 1$. \end{exe}

%\begin{exe} Prove Example 6.1.29. \end{exe}

%\begin{exe} Prove Lemma 6.2.1. \end{exe}

%\begin{exe} Prove Lemma 6.6.7. \end{exe}


%%%%%%%

\begin{exe}
Let $f(t) = \E[\exp(it\xi)], g(t) = \E[\exp(it\eta)] \thickspace (t \in \R)$ be the characteristic functions of $($real-$)$ valued random variables $\xi, \eta \thickspace (i = \sqrt{-1})$. Recall that $\exp(it) = \cos t + i \sin t \thickspace (t \in \R)$ and $\E[\exp(it\xi)]:=\E[\cos(t\xi)]+i\E(\sin(t\xi)] \linebreak (t \in \R)$. Finally, $\overline{a+ib}:=a-ib \thickspace (a,b \in \R)$ denotes the complex conjugate of $a+ib$. Note that $|f|^2(t) = f(t)\cdot \bar{f}(t)$. Show the following.
\begin{enumerate}
	\item[(a)] $f$ is continuous, $f(0)=1$, and $|f(t)| \le 1, \thickspace t \in \R$.
	\item[(b)] $\bar{f}$ is a characteristic function.
	\item[(c)] $f \cdot g$ is a characteristic function. Hence, $|f|^2$is a characteristic function.
	\item[(d)] Let $h_1,h_2, \dots$ be characteristic functions. If $a_1 \ge 0, a_2 \ge 0, \dots$ are real numbers such that $a_1+a_2+ \cdots =1$, then $a_1h_1 + a_2h_2+\cdots$ is a characteristic function.
	\item[(e)] Show that every characteristic function h is non-negative definite, i.e., for all $n \ge 2$, real $t_1,\dots,t_n$ and complex $a_1,\dots,a_n$ we have that
	\[\sum_{j=1}^n \sum_{k=1}^n h (t_j - t_k) a_j \bar{a}_k \ge 0.\]
\end{enumerate}
\end{exe}

%---exercise 2-------------------------------------------------------------------------------------

\begin{exe}
Show that, for each real number $p > 0, f(z) := \cos(2 \pi pz) \thickspace (z \in \R)$ is a characteristic function. Deduce that $g(z):=(\cos(2 \pi pz))^2 \thickspace (z \in \R)$ is a characteristic function.
\end{exe}

%---exercise 3-------------------------------------------------------------------------------------

\begin{exe}
\textup{(This exercise gives an example of a characteristic function which ``wildly fluctuates''.)} It follows from Exercises $6.6$ and $6.5 (\textup{d})$ that
\[h(z)\ :=\ \sum_{k=1}^{\infty} 2^{-k} (\cos (2\pi 7^k z))^2,\thickspace z \in \R\]
is a characteristic function. Show that $h$ is of infinite total variation over each non-degenerate interval $[a,b]$, i.e.,
\[\sup\left\{\sum_{k=1}^n|h(z_{k+1})-h(z_k)|\right\} \ = \  \infty,\]
the supremum taken over all $n \ge 1$ and real numbers $a \le z_1 < z_2 < \cdots < z_{n+1} \le b$.\\

\noindent$[$Hint: It suffices to prove the claim for intervals $[r+7^{-N},r+2 \cdot 7^{-N}]$ $($being convenient for calculations!$)$ where $N \ge 1$ is an integer and $r \ge 0$ a real number. Let $k \ge N+1$ and denote by $I(k)$ the set of integers $j$ such that $1+(r+7^{-N})7^k<j\le((r+2 \cdot 7^{-N})7^k$. For $j \in I(k)$ put $t_{2j-1}(k)=(j-1/4)7^{-k}, t_{2j}(k)=j \cdot 7^{-k}$. Show, by using the inequalities $|a+b| \ge |a| - |b|$ and $|(\cos b)^2 - (\cos a)^2| \le 2 | b - a| \thickspace (a,b \in \R)$ that
\[\sum_{j \in I(k)}|h(t_{2j}(k))-h(t_{2j-1}(k))| \ \ge\ 2(1-\pi/5)7^{-N}(7/2)^k+\textup{const.}]\]
\end{exe}

%---exercise 4-------------------------------------------------------------------------------------

\begin{exe} $(a)$ Try to guess how the integral $\int_a^b f(z) \exp (itz) dz$ behaves as \linebreak $t \ra \infty$ if $f:[a,b] \ra \R$ is a step function of the form $f(t)=\sum_{j=1}^m c_j \mathbb{1}_{[b_{j-1},b_j)}(t)$ where $a \le b_0 < b_1 < \cdots < b_m \le b$.
\begin{enumerate}
	\item [(b)] Verify your guess when $f$ is an indicator function of an interval.
	\item [(c)] How does the above integral behave when $f$ is continuous on $[a,b]$?
\end{enumerate}
\end{exe}

%---exercise 5-------------------------------------------------------------------------------------

\begin{exe}
Show that a L\'{e}vy measure $Q$ satisfies $Q(\R \smallsetminus (-\alpha,\alpha)) < \infty$ for all $\alpha > 0$.
\end{exe}

%---exercise 6-------------------------------------------------------------------------------------

\begin{exe}
Let $X$ be a L\'{e}vy process having L\'{e}vy measure $Q$. Show that, for fixed $c>0$ and $s\ge0$, the process $X^*$ given by $X_t^*=X_{ct+s}-X_s \thickspace (t \ge 0)$ is a L\'{e}vy process having L\'{e}vy measure $Q^*=cQ$.
\end{exe}

%---exercise 7-------------------------------------------------------------------------------------

\begin{exe}
Let $N = (N_t) \thickspace (t \ge 0)$ be a Poisson process with parameter $\lambda > 0$.
\begin{enumerate}
	\item [(a)] Verify that the generating triple of $N$ is given by $(\lambda,0,Q^*)$ where $Q^*$ has total mass $\lambda$ concentrated on $\{1\}$.
	\item [(b)] Verify $(6.15)$ directly for $X=N$, i.e.,
	            \[Q^*(A)\ =\ c^{-1} \E[\#\{s<t\le s+c: \Delta N_t \in A \smallsetminus \{0\}\}]\]
							holds for all $c>0, s \ge 0$ and every Borel set $A \subset \R$.
\end{enumerate}
\end{exe}

%---exercise 8-------------------------------------------------------------------------------------

\begin{exe}
Let $T_t = \sum_{j=1}^{N_t} \zeta_j \thickspace (t \ge 0)$ denote the compound Poisson process of Example $6.1.21$. $($Here, $(N_t)$ is a Poisson process with parameter $\lambda>0; \zeta_1, \zeta_2,\dots$ are independent random variables with a common distribution $Q_1$ such that $Q_1(\{0\})=0$. Furthermore, the processes $(\zeta_n)$ and $(N_t)$ are independent of each other.$)$
\begin{enumerate}
	\item [(a)] Show that the characteristic function $g_t$ of $T_t \thickspace (t \ge 0)$ is given by
	            \[g_t(z)\ =\ \exp\left[\lambda t \int_{\R}(e^{izx}-1)Q_1(dx)\right]\]
							for all $z \in \R$ and $t \ge 0$.
	\item [(b)] It can be shown $($see the reference in Example $6.1.21)$ that $(T_t)$ is a L\'{e}vy process. Determine its generating triple $(\beta,\sigma^2,Q)$.
\end{enumerate}
\end{exe}

%---exercise 9-------------------------------------------------------------------------------------

\begin{exe}
Let $W$ be a (standard) Brownian motion \textup{(BM)}. Show that, for each $c>0, W^*=(cW_{t/c^2})$ is a \textup{BM} $($scaling property$)$.
\end{exe}

%---exercise 10-------------------------------------------------------------------------------------

\begin{exe}
Let $\xi \sim N(\mu,\sigma^2)$ where $\mu \in \R$ and $\sigma > 0$.
\begin{enumerate}
	\item [(a)] Deduce from $(6.26)$ that the characteristic function of $\xi$ is given by
	            \[\E[\exp(iz \xi)]\ =\ \exp(i \mu z - \sigma^2 z^2/2), \thickspace z \in \R.\]
	\item [(b)] Deduce from the result in $(\textup{a})$ that, for all $\mu, z \in \R$ and $\sigma>0$,
	            \[\int_{-\infty}^{\infty} \cos(zx) \exp(-(x-\mu)^2/(2\sigma^2))dx\ =\ \sqrt{2 \pi \sigma^2} \cos(\mu z) \exp(-\sigma^2 z^2/2)\]
							and
							\[\int_{-\infty}^{\infty} \sin(zx) \exp(-(x-\mu)^2/(2\sigma^2))dx\ =\ \sqrt{2 \pi \sigma^2} \sin(\mu z) \exp(-\sigma^2 z^2/2).\]
\end{enumerate}
\end{exe}

%---exercise 11-------------------------------------------------------------------------------------

\begin{exe}
Let $W=(W_t)$ be a \textup{BM}. Put
\[S_{t,u}\ := \ \sup_{0 \le s \le u} |W_{t+s}-W_t|, \thickspace t \ge 0, u>0. \]
\begin{enumerate}
	\item [(a)] Show that $S_{t,u}$ is a random variable. $($This requires a little argument since the definition of $S_{t,u}$ involves uncountably many random variables!$)$ \\ $[$Hint: Recall that all sample paths of $W$ are continuous.$]$
	\item [(b)] Show that $W_n/n \ra 0 \thickspace (n \ra  \infty)$ a.s.
	\item [(c)] Since, for each fixed $t \ge 0, (W_{u+t}-W_t) \thickspace (u \ge 0)$ is a \textup{BM}, it follows that
	\begin{equation}\tag{$*$} \textit{For each $t > 0, S_{t,1}$ has the same distribution as $S_{0,1}$.} \end{equation}
  Furthermore, we have that
	\begin{equation}\tag{$**$} P(S_{0,1} \ge a)\ \le\ 2 \exp(-a^2/2), \thickspace a \ge 0\end{equation}
	$($see, e.g., [KaSh] or [RY]$)$. Use $(b)$ as well as $(*)$ and $(**)$ to show that
	\[W_t/t \ra 0 \thickspace (t \ra \infty) \thickspace \textit{a.s.}\]
	$[$Hint:Use the Borel-Cantelli Lemma.$]$
\end{enumerate}
\end{exe}

%---exercise 12-------------------------------------------------------------------------------------

\begin{exe}
Let $\xi_1,\xi_2,\dots$ be independent random variables defined on some probability space $(\Omega,\cF,P)$, which have a common distribution given by $P(\xi_n=+1)=p, P(\xi_n=-1) = 1-p =: q \thickspace (n \ge 1)$, where $0 < p< 1$. Put $S_n:=\xi_1+\cdots+\xi_n, \thickspace n \ge 0 \thickspace (S_0=0)$, and let $(\cF_n) \thickspace (n \ge 0)$ be the filtration generated by $(\xi_n)$. $($Note that $\cF_0 = \{\emptyset,\Omega\}$.$)$
\begin{enumerate}
	\item [(a)] Show that $Y_n := (q/p)^{S_n} \thickspace (n \ge 0)$ is an $(\cF_n)$-martingale.
	\item [(b)] Put $c(\alpha):=\E[\exp(\alpha \xi_1)] = p \exp(\alpha) + q \exp (-\alpha) \thickspace (\alpha \in \R)$. Show that, for every fixed $\alpha \in \R$,
	            \[Z_n\ := \  \exp(\alpha S_n) / (c(\alpha))^n \thickspace (n \ge 0)\]
							is an $(\cF_n)$-martingale.
\end{enumerate}
\end{exe}

%---exercise 13-------------------------------------------------------------------------------------

\begin{exe}
Let $\xi_1,\xi_2,\dots$ be independent random variables defined on the same probability space, which have a common distribution given by $P(\xi_n=+1)=P(\xi_n=-1)=1/2$. Put $S_0=0$ and $S_n=\xi_1+\cdots+\xi_n \thickspace (n \ge 1)$ which means that $(S_n)$ is a simple symmetric random walk on $\mathbb{Z}$, starting at $0$. Let $(\cF_n)$ be the filtration generated by $(\xi_n)$. Show that following two sequences are $(\cF_n)$-martingales:
\begin{enumerate}
	\item [(a)] $(S_n^3-3n S_n)$.
	\item [(b)] $(S_n^4-6n S_n^2+3n^2+2n)$.
\end{enumerate}
$[$Hint: Note that $\E[\xi_n|\cF_{n-1}]=\E[\xi_n]=0$ a.s. $($since $\xi_n$ is independent of $\cF_{n-1})$, and that $\E[S_{n-1}^2 \xi_n | \cF_{n-1}] = S_{n-1}^2 \E[\xi_n] = 0$ a.s. $($since $S_{n-1}$ is $\cF_{n-1}$-measurable$)$. Note that $S_n = S_{n-1}+ \xi_n$.$]$
\end{exe}

%---exercise 14-------------------------------------------------------------------------------------

\begin{exe}
Let $(\Omega,\cF,P)$ be a probability space and let $(\cF_n) \thickspace (n \ge 0)$ be any filtration on $(\Omega,\cF)$. In the sequel let $Z = (Z_n) \thickspace (n\ge 0)$ and $H = (H_n) \thickspace (n\ge 1)$ be sequences of random variables defined on $(\Omega,\cF)$ such that $Z$ is adapted and $H$ is predictable which means that, for all $n \ge 1$, $H_n$ is $\cF_{n-1}$-measurable. The sequence $H \bullet Z$ given by
\[(H \bullet Z)_n \ := \  \sum_{j=1}^n H_j (Z_j - Z_{j-1}), \thickspace n \ge 0 \thickspace ((H \bullet Z)_0=0)\]
is called the $H$-transform of $Z$ or the $($discrete$)$ stochastic integral of $H$ with respect to $Z$. Now let $Z$ be an $(\cF_n)$-martingale and assume that $H_j(Z_j-Z_{j-1}) \in L^1, \thickspace j=1,2,\dots$ Show that $H \bullet Z$ is an $(\cF_n)$-martingale. \\
$[$Hint: Use the iteration property of conditional expectations $($see Example $6.1.29)$.$]$
\end{exe}

%---exercise 15-------------------------------------------------------------------------------------

\begin{exe}
Let $W=(W_t)$ be a \textup{BM} and let $(\cF_t)$ be the filtration generated by $W$. Show that the following processes are $(\cF_t)$-martingales:
\begin{enumerate}
	\item [(a)] $(W_t)$.
	\item [(b)] $(W_t^2-t)$.
	\item [(c)] $(W_t^4-6tW_t^2+3t^2)$.
\end{enumerate}
$[$Hint: Note that $W_t-W_s$ is independent of $\cF_s \thickspace ( 0 \le s \le t)$.$]$
\end{exe}

%---exercise 16-------------------------------------------------------------------------------------

\begin{exe}
Let $(N_t)$ be a Poisson process with parameter $\lambda > 0$, and put $M_t=N_t - \lambda t \thickspace (t \ge 0)$. Let $(\cF_t)$ be the filtration generated by $(N_t)$.
\begin{enumerate}
	\item [(a)] Show that $(M_t)$ is an $(\cF_t)$-martingale.\\
	$[$Hint: $N_t - N_s$ is independent of $\cF_s \thickspace (0 \le s < t)$.$]$
	\item [(b)] Show that $(M_t^2-\lambda t)$ is an $(\cF_t)$-martingale. \\
	$[$Hint: Write $M_t^2-M_s^2= (M_t - M_s)^2+2M_s(M_t-M_s) \thickspace (0 \le s < t)$.$]$
\end{enumerate}
\end{exe}

%---exercise 17-------------------------------------------------------------------------------------

\begin{exe}
Let $(N_t)$ be a Poisson process with parameter $\lambda > 0$, and let $c > 0$ be any constant.
\begin{enumerate}
	\item [(a)] Determine the constant $\mu (c)$ such that the process $(\exp(c N_t + \mu (c) t)) \thickspace (t \ge 0)$ is a martingale with respect to the filtration $(\cF_t)$ generated by $(N_t)$.\\
	$[$Hint: Use Theorem $6.1.30$ and Exercise $6.11$.$]$
	\item [(b)] Verify directly that the process obtained in $(\textup{a})$ is an $(\cF_t)$-martingale.. \\
	$[$Hint: Use that $\E[\exp(c(N_t-N_s))|\cF_s] = \E[\exp(c(N_t-N_s))]$ a.s. $(0 \le s < t)$ since $N_t-N_s$ is independent of $\cF_s$.$]$
\end{enumerate}
\end{exe}

%---exercise 18-------------------------------------------------------------------------------------

\begin{exe}
Let $\xi$ have a binomial distribution with parameters $n \ge 1$ and $0 \le p \le 1$, i.e.,
\[P(\xi = k)\ =\ {n \choose k} p^k (1-p)^{n-k}, \thickspace k=0,1,\dots,n.\]
\begin{enumerate}
	\item [(a)] Use Azuma's inequality $($Theorem $6.3.1)$ to prove the following inequality which is due to H. Chernoff $($Ann. Math. Statist. \textbf{\textup{23}} $(1952)$, $493-507)$:
	\begin{equation}\tag{$*$} P(|\xi-np| \ge t) \le 2 \exp (-2t^2/n), \thickspace t \ge 0, \thickspace n \ge 1. \end{equation} %need leqno here - maybe there exist another solution
	$[$Hint: $\xi$ has the same distribution as a sum of suitable $0-1$ random variables $\xi_1,\dots,\xi_n$.$]$
	\item [(b)] Verify $(*)$ directly for $n=1$.
\end{enumerate}
\end{exe}

%---exercise 19-------------------------------------------------------------------------------------

\begin{exe}
Prove $(6.147)$.\\
$[$Hint: First note that $|g(z)|=: \exp(I(z))$, where
\[I(z)\ := \  \int_0^z \frac{\cos x -1}{x} \left( \log \left(\frac{z}{x}\right) \right)^r dx, \thickspace z \ge 0, \thickspace r > 0.\]
Then $(6.147)$ says that
\begin{equation}\tag{$*$} I(z) \le \frac{1}{2(r+1)}\left(1-\left( \log (2z/(3 \pi)) \right)^{r+1} \right), \thickspace z \ge 4 \pi , \thickspace r > 0. \end{equation} %need leqno here - maybe there exist another solution
In order to prove $(*)$ note that the cosine is $\le0$ on the intervals $J(k):=[(2k-1) \pi - \pi/2, (2k-1)\pi + \pi/2]$, and that
\begin{equation}\tag{$**$} J(k) \subset [0,z] \quad \textit{iff} \quad 1 \le k \le k(z)\ := \  \lfloor z/(2\pi)+1/4\rfloor. \end{equation} %need leqno here - maybe there exist another solution
Hence
\[I(z) \ \le\ - \sum_{k=1}^{k(z)-1} \int_{J(k)} \frac{1}{x} \left( \log \left( \frac{z}{x}\right)\right)^r dx.\]
Using $(**)$ and comparing with a certain Riemann integral finally yields $(*)$.$]$
\end{exe}

%---exercise 20-------------------------------------------------------------------------------------

\begin{exe}
A process $Z_t=Z_0 \exp (X_t), \thickspace t \ge 0 \thickspace (Z_0 > 0)$ is observed at time points $t= 0,1,2,\dots,T$, where $(X_t)$ is a L\'evy process of jump-diffusion type as in Example $6.5.2$. Let $H_0(2)$ denote the null hypothesis which says that there exist $\alpha \in \R, c \ge 2, \lambda \ge 0$ and a distribution $Q_1$ on $\R$ satisfying $Q_1(\{0\})=0$ such that $(X_t)$ is associated with $\alpha, c, \lambda$, and $Q_1$. $($Note that $H_0(2))$ has a meaning different from that at the beginning of $\S 6.5!)$ Let $H_0(2)$ be rejected if $|\widetilde{L}_T/T-p_{10}(1)| \ge 0.1$ $($see $(6.100)$ and $(6.150))$. Let the level of significance be $0.1$. $($Note that the rejection of $H_0(2)$ entails the rejection of the null hypothesis that $(Z_t)$ is a Black-Scholes process having volatility $\ge2$ $($see $(6.27)).)$ How large has $T$ to be? $($ Answer: $T \ge 1715.)$
\end{exe}

%---exercise 21-------------------------------------------------------------------------------------

\begin{exe}
A process $Z_t = Z_0 \exp(X_t), t \ge 0 \thickspace (Z_0 > 0)$ is observed at the time points $t= 0,1,2,\dots,T$, where $(X_t)= \alpha t + T_t, t \ge 0$. Here, $\alpha \in \R; (T_t)$ is a compound Poisson $($or \textup{CP}-$)$process associated with $\lambda > 0$ and $Q_1 = N(\mu,\sigma^2)$ $($see Example $6.1.21)$. Suppose that the null hypothesis $H_0(\lambda^*,\sigma^*) \thickspace (\lambda^*>0,\sigma^*>0)$ is to be tested, which says that there exist $\alpha \in \R, \mu \in \R, \lambda \ge \lambda^*$, and $\sigma \ge \sigma^*$ such that $X_t = \alpha t + T_t \thickspace (t \ge 0)$, and $(T_t)$ is a \textup{CP}-process associated with $\lambda$ and $Q_1$. Verify that the test outlined in Exercise $6.24$, which rejects $H_0(\lambda^*,\sigma^*)$ if $|\widetilde{L}_T/T-p_{10}(1)| \ge 0.1$, is not applicable no matter how the level of significance $0 < p_0 < 1$ is chosen. \\
$[$Hint: Show that there does not exist any $($finite$)$ constant $\sum^*$ satisfying $(6.153) \thickspace (g$ being the characteristic function of $X_1$, $(X_t)$being an arbitrary L\'evy process satisfying $H_0(\lambda^*,\sigma^*)).$ Use Exercise $6.14(\textup{b})$.$]$
\end{exe}

%---exercise 22-------------------------------------------------------------------------------------

\begin{exe}
Suppose we observe a process $Z_t=Z_0 \exp (\mu t + c X_t), t \ge 0\thickspace (Z_0>0)$ at time points $t=0,1,\dots,T$. Let $(X_t)$ be a gamma process with parameters $\alpha$ and $\Delta$, and consider $($as in Example $6.5.5)$ the null hypothesis $H_0(c^*,\alpha^*,\Delta^*)$ where $B=10, c*=\alpha^*=1, \Delta^*=2, p_0=v=0.1, m=1, d_1 = 1$, and $\lambda(10)=(2\pi / \log 10)^2$ $($recall that $\log$ is the natural logarithm$)$.
\begin{enumerate}
	\item [(a)] Show that in this special case we can choose $\sum^* = ( \log 10)^2 /24$.
	\item [(b)] How large has the time horizon $T$ to be? $($Answer: $T \ge 2129$ $($instead of $T \ge 2582$ as in Example $6.5.5!).)$
\end{enumerate}
\end{exe}

%---exercise 23-------------------------------------------------------------------------------------

\begin{exe}
Prove the following elementary result $($Lemma $6.6.7)$: Let $a_1,a_2, \cdots$ be real numbers such that $0 \le a_n < 1 \thickspace (n \ge 1)$ and $\sum_{n=1}^{\infty} a_n < \infty$. Then
\[\sum_{n=1}^{\infty} a_n^t \ra 0 \thickspace (t \ra \infty).\]
\end{exe}

%---exercise 24-------------------------------------------------------------------------------------

\begin{exe}
Prove the claim in Example $6.1.28$.
\end{exe}

%---exercise 25-------------------------------------------------------------------------------------

\begin{exe}
Prove the iteration property of conditional expectations $($see Example $6.1.29)$.
\end{exe}

%---exercise 26-------------------------------------------------------------------------------------

\begin{exe}
Prove Lemma $6.2.1$.
\end{exe}




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

\part{Applications I: Accounting and Vote Fraud}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Benford's Law as a Bridge between Statistics and Accounting}

\begin{center}
\large \textsl{Richard J. Cleary\index{Cleary, Richard J.} and Jay C. Thibodeau\index{Thibodeau, Jay C.}\footnote{Mathematics \& Science Division, Babson College, and Department of Accountancy, Bentley University.}}\\ \ \normalsize
\end{center}

An auditor decides to run a Benford's law on a data set that consists of 1000 legitimate expense records from a business, plus a number of fraudulent transactions that an employee is making to a front for a business set up in a relative's name.  Because the employees of the business have to obtain special approval for expenditures over \$10,000, the fraudulent transactions are all for amounts between \$9,000 and \$9,999.
For the 1000 legitimate expenditures, we have this data:
\begin{center}
\begin{tabular}{|r|r|}
  \hline
First Digit & Observed \\
  1 & 314 \\
  2 & 178 \\
  3 & 111 \\
  4 & 92 \\
  5 & 88 \\
  6 & 59 \\
  7 & 56 \\
  8 & 56 \\
  9 & 46 \\
  \hline
\end{tabular}
\end{center}

\begin{exe} Using the Benford law test at \begin{center}\footnotesize \textcolor{blue}{\url{http://web.williams.edu/Mathematics/sjmiller/public_html/benford/chapter01/MillerNigrini_ExcelBenfordTester_Ver401.xlsx}}\normalsize
\end{center} (or any other suitable software), verify that the data conforms reasonably well to Benford's Law.
\end{exe}

%appears to follow Benford's law

\begin{exe} Use trial and error (or some more clever approach) to determine how many fraudulent transactions with first digit nine would need to be added to the 1000 legitimate observations above in order for the hypothesis that the data follows Benford's Law to be rejected at a five percent significance level.   Does this seem plausible?
\end{exe}

% 23.  Entirely plausible ... doesn't take that much fraud to put us on alert!

\begin{exe} What is the role of sample size in the sensitivity of Benford's law?  Suppose there are 10,000 legitimate observations instead of 1000, but the ratios for legitimate observations remains the same, i.e., the number of observations for teach digit is multiplied by 10.  Try the problem again.  What changes? \end{exe}

% When you scale up, the original data appears to not follow Benford's law.  Not enough threes and sixes, too many fives.  A good lesson in practical vs. statistical significance.


\begin{exe}
In which of the following situations is an auditor most likely to use Benford's Law?
\begin{itemize}
\item An analysis of a fast food franchise's inventory of hamburgers.
\item An audit of a Fortune 500 company's monthly total revenue over the fiscal year.
\item An analysis of a multi-billion dollar technology company's significant assets.
\end{itemize}
\end{exe}

%Answer: The auditor is most likely to use Benford's Law to analyze the technology company. Auditors will not use Benford's Law on a small sample size such as the Fortune 500 company, nor will they prioritize lower-valued items such as the fast food franchise's hamburgers. The technology company both has reason to misstate their assets, and the assets in question are materially significant.

\begin{exe}
Give an additional example of a way that including Benford's Law in an introductory-level statistics class will meet the four goals of the GAISE report of 2005.
\end{exe}

\begin{exe}
Determine whether the following situations are Type I errors, Type II errors, or neither.
\begin{itemize}
\item An auditor uses Benford's Law to analyze the values of canceled checks by a business in the past fiscal year. The auditor finds that there are significant spikes in the data set, with 23 and 37 appearing as the first two digits more often than expected. After further investigation, it was found that there were valid non-fraudulent explanations for the variations in the first digits.
\item An auditor finds that a company's reported revenue does not follow Benford's Law. Further investigation is taken, and it is found that a manager has been rounding up her weekly sales to the nearest thousand to earn an incentive based on a weekly sales benchmark. The manager claims that the inflated sales were an accounting error.
\item An owner of a business has falsely claimed to give his employees bonuses on each paycheck based on their monthly sales in order to lower his income taxes. An auditor examines the data, but is unable to confidently claim that the data does not follow Benford's Law. Rather than waste funds on a costly investigation, the auditor chooses not to investigate the owner.
\end{itemize}
\end{exe}

%Answers:
%\begin{itemize}
%\item TYPE I
%\item	NEITHER
%\item TYPE II
%\end{itemize}

\begin{exe}
What are the negative effects of a Type I error in an audit? A Type II error? In what situations might one be more dangerous than the other?
\end{exe}

\begin{exe}
What are some of the reasons listed in the chapter that might explain why a data set should not be expected to follow Benford's Law?
\end{exe}

\begin{exe}
Give an example of a reason other than fraud that explains why a data set that is expected to conform to Benford's Law does not.
\end{exe}






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Detecting Fraud and Errors Using Benford's Law}

\begin{center}
\large \textsl{Mark\index{Nigrini, Mark} Nigrini\footnote{Department of Accounting, West Virginia University, Morgantown, West Virginia 26506.}}\\ \ \normalsize
\end{center}

\begin{exe}
Do the following data sets meet the requirements described by Nigrini in order to be expected to follow Benford's Law? Explain why or why not.
\begin{itemize}
\item The 4-digit PIN numbers chosen by clients of a local bank.
\item The annual salaries of graduates from a public university.
\item Numeric student ID numbers assigned by a school.
\item The distances in miles between Washington, DC and the 500 most populated cities in the United States (excluding Washington, DC).
\item Results to a survey of 1,000 students asked to provide a number in between 1 and 1,000,000.
\item The number of tickets bought for all events held in a particular stadium over the past five years.
\end{itemize}
\end{exe}



%\textbf{Answers:}
%\begin{itemize}
%\item \textbf{NO.} 4-digit PIN numbers are not expected to follow Benford's Law, since they do not represent the size of facts or events. Instead, clients choose PIN numbers with the intent of making them easy to remember yet difficult for someone else to guess, which will skew the distribution of the first digits.
%\item \textbf{YES.} Annual salaries of graduates are expected to follow Benford's Law since they are the size of financial facts, there are no minimum or maximum values for salaries, and salaries are not used as identification numbers.
%\item \textbf{NO.} Student ID numbers are assigned identification numbers, and therefore should not be expected to follow Benford's Law.
%\item \textbf{YES.} Since distances are facts with no inherent maxima or minima and are not used as identification numbers or labels, this data set is expected to follow Benford's Law.
%\item \textbf{NO.} The data set should not be expected to follow Benford's Law because it does not represent the size of events or facts. (See Chapter 14 for a description of experiments confirming that such data sets do not follow Benford's Law)
%\item \textbf{NO.} Each stadium has a maximum capacity, so there is a maximum number of tickets that can be bought for an event. This means that the data set is not expected to follow Benford's Law.
%\end{itemize}

\begin{exe} Take a company which has been at the heart of a scandal (for example, Enron) and investigate some of its publicly available data. \end{exe}

\begin{exe} An audit of a small company reveals a large number of transactions starting with a 5. Come up with some explanations other than fraud. \emph{Hint: there are two cases: it is the same amount to the same source each time, and it isn't.}\end{exe}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Can Vote Counts' Digits and Benford's Law Diagnose Elections?}

\begin{center}
\large \textsl{Walter\index{Mebane, Walter J.} R. Mebane, Jr.\footnote{Department of Political Science and Department of Statistics, University of Michigan, Ann Arbor, MI. The author thanks
Jake Gatof, Joe Klaver, William Macmillan and Matthew Weiss for their assistance.}}\\ \ \normalsize
\end{center}

\begin{exe} If $X$ satisfies Benford's law, then the mean of its second digit is 4.187. What is the mean of the $k$\textsuperscript{th} digit?
\end{exe}

\begin{exe} If $X$ satisfies Benford's law, multiply by an appropriate power of 10 so that it has $k$ integer digits. What is the probability the last digit is $d$? What is the probability the last two digits are equal? What is the probability the last two digits differ by 1? \end{exe}

\begin{exe} Find some recent voting data (say city or precinct totals) and investigate the distribution of the first and second digits. \end{exe}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Complementing Benford's Law for small $N$: a local bootstrap}

\begin{center}
  \large \textsl{Boudewijn F.\index{Roukema, Boudewijn F.} Roukema}\footnote{Toru\'n Centre for
    Astronomy, Faculty of Physics, Astronomy and Informatics, Nicolaus Copernicus University, ul. Gagarina 11, 87-100
    Toru\'n, Poland.}\\ \ \normalsize
\end{center}

\begin{exe}
Do you agree with the assessment that Nigrini's conditions for applying Benford's Law are mostly satisfied? Why or why not?
\end{exe}

\begin{exe}
Why does having a large $\sigma(\log_{10}x_i)$ and a large $\sigma(\log_{10}w_{i,j})$ ensure that $v_{i,j}$ first-digit distribution approaches Benford's Law?
\end{exe}

\begin{exe}
What does it mean for bootstrap methods to be considered ``conservative?'' Identify some of the ways in which bootstrap methods are conservative.
\end{exe}

\begin{exe} There are many conservative statistics. Look up the Bonferroni adjustment for multiple comparisons, as well as alternatives to that. \end{exe}

\begin{exe}
How would a local bootstrap realization change if the value of $\Delta$ were changed?
\end{exe}

\begin{exe}
Confirm that if $c_{bK7} > 99.924\%$, then $c_{eK7} > 99.99960\%$.
\end{exe}




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

\part{Applications II: Economics} %50

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Measuring the Quality of European Statistics}

\begin{center}
\large \textsl{Bernhard\index{Rauch, Bernhard} Rauch, Max\index{G\"ottsche, Max} G\"ottsche, Gernot\index{Br\"ahler, Gernot} Br\"ahler, Stefan\index{Engel, Stefan} Engel\footnote{Rauch: University of Regensburg, Department of Economics, Universit\"atsstra{\ss}e 31, 93053 Regensburg, Germany; G\"ottsche and Engel: Catholic University of Eichst\"att-Ingolstadt, Department of Auditing and Controlling, Auf der Schanz 49, 85049, Ingolstadt, Germany; Br\"ahler: Ilmenau University of Technology, Department of Taxation Theory and Auditing, Helmholtzplatz 3, 98693 Ilmenau, Germany.}
}\\ \ \normalsize
\end{center}

\begin{exe}
In which of the following two scenarios would $\chi^2$ be larger?
\begin{itemize}
\item The first-digit frequencies are mostly identical to the expected Benford distribution, but the digit 1 appears 31.1\% of the time and the digit 2 appears 16.6\% of the time (compared with the expected values of approximately 30.1\% and 17.6\%, respectively)
\item The first-digit frequencies are mostly identical to the expected Benford distribution, but the digit 8 appears 6.12\% of the time and the digit 2 appears 3.58\% of the time (compared with the expected values of approximately  5.12\% and 4.58\%, respectively)
\end{itemize}
\end{exe}

\begin{exe}
What is $\mu_b$, the value of the mean of the Benford distribution of first digits base $b$?
\end{exe}

\begin{exe}
What is the value of $a^*$ if $\mu_e$ = 3.5?
\end{exe}

\begin{exe}
Using Figure 11.1, confirm the values of $\chi^2$, $\chi^2/n$, and $d^*$ for the distribution of first digits for Greece social statistics in the year 2004.
\end{exe}

\begin{exe}
Using Figure 11.1 and the formula for distance measure $a^*$ used by Judge and Schechter, calculate the value of the mean of the dataset ($\mu_e$) in the year 2004. Confirm this value by using the formula $\mu_e = \frac{\Sigma_{i=1}^9  n {\rm Prob}(D_1=i)}{n}$.
\end{exe}

The final problem uses data on two fictitious countries, which is available online \begin{center}\burl{http://web.williams.edu/Mathematics/sjmiller/public_html/benford/chapter11/} \end{center} (some of the additional readings on that webpage may be useful as well).

\begin{exe} Calculate the values $\chi^2$, $\chi^2/n$, $d^\ast$ and $a^\ast$ and compare the results for both countries.
Which one of these two countries should be examined closer? Are the outcomes consistent? \end{exe}

%Results:
%
% 	Country A	Country B
%?�	19,14535323	15,42399365
%?�/n	0,056144731	0,051932639
%d*	0,077088064	0,094062907
%a*	0,075363027	0,07130986
%
%"	Country A shows the higher ?� value
%"	As the sample size of both countries are not the same it is recommended also to include the other three measurement categories which are %invariable in relation to sample size
%"	Two of these measures show also higher values for Country A, just the d*-value of Country B exceeds the d*-value of Country A
%
%�	To sum up, it is recommended to further examine the data of Country A, as three of four measures show higher values for this country. As d* %contradicts these conclusion, the results are not totally consistent and should not be over-intellectualized.
%�	In general, the Benford-test will never proof the fraudulence in data. It just should be interpreted as an indicator which recommends some data %for a further examination





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Benford's Law and Fraud in Economic Research}

\begin{center}
\large \textsl{Karl-Heinz\index{T\"odter, Kar-Heinz} T\"odter\footnote{Research Centre, Deutsche Bundesbank}}\\ \ \normalsize
\end{center}

\begin{exe}
Use (12.1) to find $f(6)$ and $F(6)$ for Benford's Law.
%MAYBE REWORD???
\end{exe}

\begin{exe}
If $X$ is a Benford variable defined on $[1,10)$, then what is the probability that the second digit is 5 given that the first digit is also 5?
\end{exe}

\begin{exe}
Use (12.4) to confirm that when using Benford's Law for Rounded Figures, $Prob(D_1=8) = 0.054$.
\end{exe}

\begin{exe}
If $X$ is a Benford variable defined on $[1,10)$, given that the first digit is 8, what is the probability that the second digit is 0 when rounding to two significant digits? What is the probability that the second digit is 2?
\end{exe}

\begin{exe}
Using Benford's Law for Rounded Figures as the frequencies of first digits for a data set of 300 observed values, calculate $Q_1$, $Q_2$, $M_1$, and $M_2$ using (12.6) and (12.7).
\end{exe}

\begin{exe}
Should the $Q_1$ test or the $M_1$ test be used for attempting to detect variations in Benford's Law?
\begin{itemize}
\item What if the data set in question has a mean of 3.44?
\item Which test should be used for detecting variations in the Generalized Benford's Law?
\end{itemize}
\end{exe}

\begin{exe}
The Federal Tax Office (FTO) knows that $\Omega =$ 10\% of tax declarations of small and medium enterprises are falsified. The FTO checks the first digits using Benford's Law. Random samples of tax declarations are drawn and the null hypothesis (${\rm H}_{\rm o}$) ``Conformity to Benford's Law'' is tested at the $\alpha =$ 5\% level of significance.

\begin{itemize}

\item Using (12.9), what rejection rate of ${\rm H}_{\rm o}(\theta)$ would you expect if the probability of a type II error $\beta$ lies in the interval [0.05, 0.75]?

\item The FTO obtained the rejection rate $\theta = 0.12$. Use (12.9) to calculate the probability $\beta$ of a type II error.

\item The FTO arranges for an audit at the taxable enterprise if the Benford test rejects ${\rm H}_{\rm o}$ for a certain tax declaration at the $\alpha =$ 5\% level. What is the probability that such an audit will be provoked erroneously? And what is the probability to forbear an audit erroneously?

\end{itemize}

\end{exe}

\begin{exe} A sample of scientific articles is taken, and 17\% are found to have regression coefficients with a doubtful distribution of first digits. Use (12.10) to calculate $\Hat{\Omega}$. \end{exe}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Testing for Strategic Manipulation of Economic and Financial Data}

\begin{center}
  \large \textsl{Charles C. Moul\index{Moul, Charles C.} and John V. C.\index{Nye, John V. C.} Nye}\footnote{Economics Department, Farmer School of Business, Miami University, Ohio and Mercatus Center and Economics Department, George Mason University and National Research University -- Higher School of Economics, Moscow, respectively; We thank Marc Taub for excellent research assistance.}\\ \ \normalsize
\end{center}

\begin{exe} What are some of the potential reasons given in Section 13.1 for why data sets that are expected to follow Benford's Law fail to do so? \end{exe}

\begin{exe} Did Benford's Law prove financial misreporting during the financial crisis? Justify your assertion.
\end{exe}

\begin{exe} What are some of the potential motives that banks have for manipulating
VAR data? \end{exe}







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

\part{Applications III: Psychology and the Sciences}  %60

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Psychology and Benford's Law}

\begin{center}
  \large \textsl{Bruce D.\index{Burns, Bruce D.} Burns and Jonathan Krygier\index{Krygier, Jonathan}}\footnote{School of Psychology, The University of Sydney, NSW 2006, Australia. The authors would like to thank to Hal Willaby for comments on an earlier draft. The authors were supported by a grant from the University of Sydney, and it is a pleasure to thank them for their generosity.}
\\ \ \normalsize
\end{center}

\begin{exe} Using (11.1) in Section 11.3, find $\chi^2$ for the elaborated and unelaborated data from Scott, Barnard and May's study found in Table 14.1. \end{exe}

\begin{exe} What distribution of leading digits would you expect if people were asked to randomly give an integer from $1$ to $N$? How does your answer depend on $N$? Try an experiment with some of your friends and family. \end{exe}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Managing Risk in Numbers Games: Benford's Law and the Small Number Phenomenon}

\begin{center}
\large \textsl{Mabel C.\index{Chou, Mabel C.} Chou, Qingxia\index{Kong, Qingxia} Kong, Chung-Piaw\index{Teo, Chung-Piaw} Teo and Huan\index{Zheng, Huan} Zheng\footnote{Chou and Teo: National University of Singapore; Kong: Universidad Adolfo Iba\~{n}ez; Zheng: Shanghai Jiao Tong University.}}\\ \ \normalsize
\end{center}

\begin{exe} What are the risks associated with a high liability limit in a fixed-odds lottery game? What if the limit is too small? \end{exe}

\begin{exe} From the data obtained in Table 15.1, determine the probability that a given number on a ticket for the UK powerball game is a single digit. \end{exe}

\begin{exe} Figure 15.1 shows the proportion of tickets in a Pennsylvania Pick-3 game with a given first digit. Explain why there are several outliers larger than the mean proportion and no outliers smaller than the mean proportion. \end{exe}

\begin{exe} What is the probability that a Type I player chooses the number 345 in a Pick-3 game? \end{exe}

\begin{exe} Let Alice be a Type II player in a Pick-3 game that bets on a number with three significant digits $80\%$ of the time, a number with two significant digits $15\%$ of the time, and a number with one significant digit $5\%$ of the time. What is the probability that Alice bets on the number 345? The number 45? The number 5? \end{exe}

\begin{exe} In the Pennsylvania Pick-3 game, the least square model indicates that $60.42\%$ of the players are Type I players and $39.58\%$ of the players are Type II players. Based on this model, use (15.4) to calculate the expected proportion of the betting volume on a three-digit number with first significant digit 4. \end{exe}

\begin{exe} Let Bob be a Type II player in a Pick-3 game that bets on a number with three significant digits $80\%$ of the time, but also has a tendency to exhibit switching behavior; that is, he will switch later digits with probability 0.9105, and switch the digit to 0 with probability 0.1054. What is the probability that Bob bets on the number 345? \end{exe}

\begin{exe} Use (15.5) to calculate the probability that Bob chooses a three-digit number in between 520 and 529 inclusive. \end{exe}

\begin{exe} Calculate the variance using the equation in 15.4.1 under the scenario that all players randomly select a three-digit number. \end{exe}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Benford's Law in the Natural Sciences}

\begin{center}
\large \textsl{David\index{Hoyle, David} Hoyle\footnote{Thorpe Informatics Ltd., Adamson House, Towers Business Park, Wilmslow Rd., Manchester, M20 2YY, UK.}}\\ \ \normalsize
\end{center}

\begin{exe} Demonstrate that (16.3) holds for $\alpha = 2$. \end{exe}

\begin{exe} Rewrite the lognormal distribution density function (16.5) as the lognormal density function (16.6). \end{exe}

\begin{exe} Show that as $\sigma$ grows larger, the lognormal density function approaches the power law $p(x) = C_\sigma x^{-1}$, where $C_\sigma$ is a constant depending on $\sigma$. \end{exe}

\begin{exe} Provide examples not mentioned in the chapter of scientific data sets that are not effectively scale-invariant. \end{exe}

\begin{exe} Explain the intuition behind why the following distributions are approximately Benford:
\begin{itemize}
\item The Boltzman-Gibbs distribution (16.8).
\item The Fermi-Dirac distribution (16.9).
\item The Bose-Einstein distribution (16.10).
\end{itemize}
\end{exe}

\begin{exe} Obtain a physics textbook (or a CRC handbook, or...) and find a list of physical constants. Perform a chi-squared test to determine if the list of constants follow Benford's Law as expected. \end{exe}

\begin{exe} Sandon found agreement between Benford's Law and population and surface area data for the countries of the world. Find a source that provides the population density of each country. Then determine if population density follows Benford's Law. This can be done using a chi-squared test. In general, should the ratio of two of two Benford random variables be Benford? \end{exe}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Generalizing Benford's Law: A Re-examination of Falsified Clinical Data}

\begin{center}
\large \textsl{Joanne\index{Lee, Joanne} Lee, Wendy K. Tam\index{Cho, Wendy K. Tam} Cho, and George\index{Judge, George} Judge\footnote{Lee: Researcher, Mathematica Policy Research; Cho: Departments of Political Science and Statistics, and Senior Research Scientist, National Center for Supercomputing Applications at the University of Illinois at Urbana-Champaign; Judge: Department of Agricultural and Resource Economics, University of California at Berkeley.}}\\ \ \normalsize
\end{center}

\begin{exe} Use (17.1) to calculate the average frequency of first digits in Stigler's distribution of first significant digits. Check to see that the distribution matches the values displayed in Table 17.1. \end{exe}

\begin{exe} Verify (17.3), (17.5), and (17.6). Then verify that the sum of the three subsets matches (17.7). \end{exe}

\begin{exe} Calculate the mean of the Stiegler FSD distribution and Benford FSD distribution to confirm that they are equivalent to 3.55 and 3.44, respectively. \end{exe}

\begin{exe} For the Estimated Maximum Entropy FSD distribution for data with a FSD mean of 3.44 shown in Table 17.3, find $H(p)$ and ensure that the criterion from (17.13) and (17.14) are reached.
\begin{itemize}
\item If the Estimated Maximum Entropy FSD distribution is accurate, then the listed probabilities will maximize $H(p)$. First, determine if replacing $\hat{p_1}$ with 0.231 and $\hat{p_2}$ with 0.2 still allows (17.13) and (17.14) to hold. Now find $H(p)$. Is $H(p)$ larger or smaller than before?
\end{itemize}
\end{exe}

\begin{exe} If the FSD mean is 5, what will be the estimated maximum entropy FSD distribution? What is $Var(d)$ according to (17.18)? \end{exe}

\begin{exe} Examining the Poehlman data in Table 17.4, calculate the difference for each digit FSD distribution given by Benford's Law. \end{exe}

\begin{exe} The estimated empirical likelihood distributions given a FSD mean will maximize $\sum_{i=1}^9 p_i$. To test this, ensure that the product of the $p_i's$ from Table 17.5 are greater than the empirical data found in Table 17.4. \end{exe}

\begin{exe} A researcher is trying to decide if a dataset follows Benford's law or Stigler's law. What values of the mean of the leading digit suggest Benford over Stigler? What values suggest Stigler over Benford? \end{exe}



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

\part{Applications IV: Images} %70

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Partial Volume Modeling of Medical Imaging Systems using the Benford Distribution}


\begin{center}
\large \textsl{John\index{Chiverton, John} Chiverton and Kevin\index{Wells, Kevin} Wells}\footnote{J. Chiverton is with
the School of Engineering, University of Portsmouth, UK and K. Wells is with the Centre for Vision, Speech and Signal Processing,
University of Surrey, UK. \textit{john.chiverton@port.ac.uk, k.wells@surrey.ac.uk}. }\\ \ \normalsize
\end{center}


\begin{exe} What is the PV effect? What implications does the PV effect have for medical imaging? \end{exe}

\begin{exe} Prove Corollary 18.3.4. \end{exe}

\begin{exe} What advantages are there to describing the PV effect using matrices as in (18.11)? \end{exe}

\begin{exe} What are the differences between a Rician noise model described by (18.12) and a Gaussian noise model described in (18.13)? \end{exe}

\begin{exe} Use (18.22) to calculate $p(\alpha)$ for $\alpha = 0.50$, where $\alpha$ has two digits of precision. \end{exe}

\begin{exe} How is the contrast to noise ratio (CNR) affected if both the distance between the signal levels of two components and the standard deviation of each class is doubled.\end{exe}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Application of Benford's Law to Images}

\begin{center}
\large \textsl{Fernando P\'erez-Gonz\'alez\index{P\'erez-Gonz\'alez, Fernando}, Tu-Thach Quach\index{Quach, Tu-Thach},
Chaouki T. Abdallah\index{Abdallah, Chaouki T.}, Gregory L. Heileman\index{Heileman, Gregory L.} and Steven J. Miller\index{Miller, Steven J.}\footnote{Perez-Gonzalez: Department of Signal Theory and Communications, University of Vigo, EE Telecomunicacion, Campus Universitario, 36310 Vigo, Spain; Quach: Sandia National Laboratories, Albuquerque, NM; Miller: Department of Mathematics and Statistics, Williamstown, MA; Abdallah and Heileman: Electrical \& Computer Engineering Department, University of New Mexico, Albuquerque, NM. }}\\ \ \normalsize
\end{center}

\begin{exe} In (19.9) one of the factors is $\Gamma\left(\frac{-j 2\pi n + \log 10}{c \log 10}\right)$, where $j = \sqrt{-1}$. Estimate how rapidly this tends to zero as $|n| \to \infty$ as a function of $c$ (if you wish, choose some values of $c$ to get a feel of the behavior).\end{exe}

\begin{exe} In (19.19) we find that $|a_n(c,\sigma)| \le |a_n(c^+)|$ for all $n$; investigate how close these can be for various choices of $c$ and $\sigma$. \end{exe}

\begin{exe} In Example 19.5.1 we found four zero-mean Gaussians with shaping parameter $c=1$ with four different standard deviations and $a_1 =0$. Can you find six zero-mean Gaussians with shaping parameter $c=1$ and six different standard deviations with $a_1 = 0$? What about eight? More generally, can you find $2m$ such Gaussians for $m$ a positive integer? \end{exe}



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




\end{document}




\begin{exe}

\end{exe}



\begin{exe}

\end{exe}



\begin{exe}

\end{exe}



\begin{exe}

\end{exe}


page 358: Y can is --> Y is

DELETED CHAPTER 2:

%\begin{center}
%\large \textsl{Arno Berger\index{Berger, Arno} and T.\index{Hill, T. P.} P. Hill\footnote{Department of Mathematical \& Statistical Sciences,
%University of Alberta, and School of Mathematics, Georgia Institute of Technology.}}\\ \ \normalsize
%\end{center}


%Answer: ${\rm Prob}((D_1,D_2) = (7, 5) ) = log_{10}  \frac{76}{75} = 0.007572$

%\begin{exe} If $X$ is Benford base 10, find the probability that its
%significand starts 2.789. \end{exe}

%Answer:  $Prob( (D_1,D_2,D_3,D_4) = (2, 7, 8, 9) ) = \log_{10}  \frac{2790}{2789} = 0.0001557$

\begin{exe} If $X$ is Benford base 10, find the probability that its significant has no 7's in the first $k$ digits (thus a significand of 1.701 would have no 7 in its first digit, but it would have a 7 in its first two digits. \end{exe}

\begin{exe} Identify $D_i(813.6)$ for $i \in [1,4]$, and then use Proposition 2.2.5 Part 1 to find $S(813.6)$. \end{exe}

\begin{exe} Use Definition 2.2.3 to find $S(\pi/4)$, and then use Proposition 2.2.5 Part 2 to find $D_m(\pi/4)$ for $m \in \{1,2,3\}$. \end{exe}


%Answer: $D_1=8, D_2=1, D_3=3, D_4=6$. By Proposition 2.2.5, $S(x)=\sum\limits_{m\epsilon\mathbb{N}} 10^{1-m} D_m(x) = 10^0 \cdot 8 + 10^{-1} \cdot 1 + 10^{-2} \cdot 3 + 10^{-3} \cdot 6 = 8.136$

%Answer: $S(x) = 7.85398.$ By Proposition 2.2.5, $D_1 = \lfloor 10^0 \cdot 7.85398 \rfloor - 10 \lfloor 10^{-1} \cdot 7.85398 \rfloor = 7 - (10 \cdot 0) = 7$, $D_2 = \lfloor 10^1 \cdot 7.85398 \rfloor - 10 \lfloor 10^{-0} \cdot 7.85398 \rfloor = 78 - (10 \cdot 7) = 8$, $D_3 = \lfloor 10^2 \cdot 7.85398 \rfloor - 10 \lfloor 10^{1} \cdot 7.85398 \rfloor = 785 - (10 \cdot 78) = 5$. In summary, $S(x) = 7.85398$, $D_1 = 7$, $D_2 = 8$, $D_3 = 5$.

\begin{exe} Does the set $A_6 = \{ 5 \cdot 10^k: k \in \mathbb{Z}\}$ belong to $S$? \end{exe}

%Answer: By Lemma 2.2.11 Part 2, $\alpha A$ belongs to $S$ if $A \epsilon S$, and since $A_4 = \{10^k : k \epsilon \mathbb{Z} \}$ belongs to $S$, $A_6$ belongs to $S$.

\begin{exe} Does the set $A_7 = \{20^k: k \in \mathbb{Z}\}$ belong to $S$?
\end{exe}


%%%%\noindent \textbf{Section 2.3}

\begin{exe} If $X$ is a Benford random variable on a probability space $(\Omega, \mathbb{A}, \mathbb{P})$, find:
\begin{itemize}
\item $\mathbb{P}((D_1(X),D_2(X)) = (4,2))$.
\item $\mathbb{P}(D_1(X) = 4, D_2(X) \neq 2)$.
\item $\mathbb{P}((D_1(X), D_3(X)) = (4, 2))$.
\end{itemize}
\end{exe}

%Answer:
%\begin{itemize}
%\item $\mathbb{P}( (D_1(X),D_2(X)) = (4,2) ) = \log \frac{43}{42} = 0.02353$.
%\item $\mathbb{P}( D_1(X) = 4, D_2(X) \neq 2) = \log \frac{5}{4} - \log \frac{43}{42} = 0.199613$.
%\item $\mathbb{P}( (D_1(X), D_3(X)) = (4, 2) )$ =!!!!!!!!!!!!!!
%\end{itemize}


%%%\noindent \textbf{Section 2.4}
\begin{exe} Prove that a sequence of real numbers is Benford if and only if the logarithm of its absolute value is uniformly distributed modulo 1.
\end{exe}

\begin{exe} Prove Lemma 2.4.3 Part I (the second part): A sequence $\{x_n\}$ is
uniformly distributed modulo 1 if and only if there is a sequence $y_n$ with $\lim
|y_n - x_n|= 0$ and $\{y_n\}$ is also uniformly distributed modulo 1. \end{exe}



%\noindent \textbf{Section 2.5}

\begin{exe} For $T(x) = 0.1x+0.02x^2+0.03x^3$, is the orbit $O_T(x_0)$
Benford for $x_0\neq0$ sufficiently close to 0? For almost all $x_0\neq0$ sufficiently close to 0? \end{exe}


\begin{exe} For $T(x) = 0.1x+0.02x^2+0.03x^3$, is the orbit $x_0$
Benford for $x_0\neq0$ sufficiently close to 0? \end{exe}

\begin{exe} Let $A= \left( \begin{array}{cc}
-1 & 2 \\
1&2
\end{array}\right)$ be a $2\times 2$ matrix with real entries. Is the matrix $A$ Benford regular?
\end{exe}

\begin{exe} Are the nontrivial solutions of $x = F(x)$ Benford for
\begin{itemize}
\item $F(x) = -x-x^3+x^4e^{-x^2}$.
\item $F(x) = \cos(x+\pi/4) - \sin(x+\pi/4)$, but $x F(x)$ is not
\item $F(x) = -x^2-x^3+x^4e^{-x^2}$
\end{itemize}
\end{exe}


