To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit 5fa130b8 authored by zrene's avatar zrene
Browse files

added example online algorithm and some page breaks

parent d04a634a
...@@ -7,9 +7,12 @@ ...@@ -7,9 +7,12 @@
\begin{multicols*}{3} \begin{multicols*}{3}
\maketitle \maketitle
\input{chapters/queueing.tex} \input{chapters/queueing.tex}
\input{chapters/online.tex} \newpage
\input{chapters/online.tex} \vfill \null \columnbreak
\columnbreak \input{chapters/onlineAlg.tex}
\vfill \null \columnbreak
\appendix \appendix
\input{chapters/appendix.tex} \input{chapters/appendix.tex}
% !TEX root = ../DES.tex
\subsection{Some Online Algorihms}
\subsubsection{Dating Problem}
Suppose we signed up for online Dating with n people. \\
We associate every person with a Matching Number m, which tells you, how good you and this person fit together. \\
What is the best algirthm to meet the best matching person? \\
\textbf{Answer} \\
We go out with the first $\frac{n}{e}$ people. Where e corresponds to eulers number. \\
After we met these people, we remember how high the best matching was. \\
The first person we meet afterwards, who has a higher matching than everybody we have seen so far, will be the chosen one. \\
\textbf{This strategy picks the best person with 37\% probabillity} \\
\textbf{Prove} \\
Let $\pi$ be the random permutation of the numbers $1,2,...,n$. \\
The process above, describes finding the maximum of the first $\pi[1],...,\pi[t]$ numbers, where $t=\frac{n}{e}$. \\
And then find finding the first j $ \geq $ t + 1 such that $\pi[j] > max\{\pi[1],...,\pi[t]\}$ \\
We want to compute the probabillity that $\pi[j] = 1$, we choose the best match possible.
P[we choose the best one] = $\displaystyle \sum_{j=t+1}^{n} P[\pi[j] = 1 $ and we pick the person on the j-th Date$]$
$\displaystyle \sum_{j = t + 1}^{n} P[ \pi[j] = 1 $ and the max\{ $\pi[1],...,\pi[j-1] \} $ is in $ \pi[1],...,\pi[t] ] $ \\
$ = \sum_{j=t+1}^{n} \frac{1}{n} \cdot \frac{t}{j - 1}$
So the probability of picking the best person is:
$\displaystyle \frac{t}{n} \sum_{j=t+1}^{n} \frac{1}{j - 1} = \frac{t}{n} \big( \sum_{j = 1}^{n-1} \frac{1}{j} - \sum_{j=1}^{t} \frac{i}{j} \big) \simeq \frac{t}{n} \cdot (ln(n) - ln(t) = \frac{t}{n} ln( \frac{n}{t}))$
And the last term is optimized for $t = n/e$
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment