Small fixes

This commit is contained in:
Antti H S Laaksonen 2017-02-26 11:57:14 +02:00
parent ee009bd9dd
commit 8a936ed246
3 changed files with 22 additions and 15 deletions

View file

@ -359,8 +359,10 @@ The expected value for $X$ in a geometric distribution is
\index{Markov chain}
A \key{Markov chain}\footnote{A. A. Markov (1856--1922)
was a Russian mathematician.} is a random process
A \key{Markov chain}
% \footnote{A. A. Markov (1856--1922)
% was a Russian mathematician.}
is a random process
that consists of states and transitions between them.
For each state, we know the probabilities
for moving to other states.
@ -515,11 +517,13 @@ just to find one element?
It turns out that we can find order statistics
using a randomized algorithm without sorting the array.
The algorithm is a Las Vegas algorithm:
The algorithm, called \key{quickselect}\footnote{In 1961,
C. A. R. Hoare published two algorithms that
are efficient on average: \index{quicksort} \index{quickselect}
\key{quicksort} \cite{hoa61a} for sorting arrays and
\key{quickselect} \cite{hoa61b} for finding order statistics.}, is a Las Vegas algorithm:
its running time is usually $O(n)$
but $O(n^2)$ in the worst case\footnote{C. A. R. Hoare
discovered both this algorithm, known as \key{quickselect} \cite{hoa61b},
and a similar sorting algorithm, known as \key{quicksort} \cite{hoa61a}.}.
but $O(n^2)$ in the worst case.
The algorithm chooses a random element $x$
in the array, and moves elements smaller than $x$
@ -563,9 +567,10 @@ but one could hope that verifying the
answer would by easier than to calculate it from scratch.
It turns out that we can solve the problem
using a Monte Carlo algorithm whose
time complexity is only $O(n^2)$\footnote{This algorithm is sometimes
called \index{Freivalds' algoritm} \key{Freivalds' algorithm} \cite{fre77}.}.
using a Monte Carlo algorithm\footnote{R. M. Freivalds published
this algorithm in 1977 \cite{fre77}, and it is sometimes
called \index{Freivalds' algoritm} \key{Freivalds' algorithm}.} whose
time complexity is only $O(n^2)$.
The idea is simple: we choose a random vector
$X$ of $n$ elements, and calculate the matrices
$ABX$ and $CX$. If $ABX=CX$, we report that $AB=C$,