\documentclass{beamer}

\DeclareMathOperator{\prob}{probability}
\DeclareMathOperator{\pay}{payment}
\DeclareMathOperator{\av}{average}

\newcommand\fair{{\color{green} fair}}
\newcommand\subfair{{\color{red} subfair}}

\mode<presentation>
{
  \usetheme{Warsaw}
  \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}

%\usepackage[english]{babel}
%\usepackage[latin1]{inputenc}
%\usepackage{times}
%\usepackage[T1]{fontenc}

\title{Betting systems: how not to lose your money gambling}

\author{G.~Berkolaiko}

\institute[Texas A\&M University]
{
  Department of Mathematics\\
  Texas A\&M University
}

\date[MAM 2007] % (optional)
{28 April 2007 / Mini Fair, Math Awareness Month 2007}

% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}

% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 
\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}
%  \frametitle{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}

\section{Simple Gambling}

\subsection{Basic Setup and Examples}

\begin{frame}
  \frametitle{Gambling and Games of Chance}
  %  \framesubtitle{Subtitles are optional.}

  \begin{itemize}
  \item Simple games: 
    \begin{itemize}
    \item flipping a coin (head / tail)
    \item rolling a die (6 sided)
    \item roulette (18 black, 18 red and 2 green)
    \end{itemize}
  \item Player vs casino
  \item Player predicts outcome and agrees on the wager
  \item If prediction is correct, the player gets money, otherwise he pays.
  \item Examples:
    \begin{itemize}
    \item Coin: 
      \begin{tabular}{l}
        if {\em head\/}, player wins 1\$;\\ 
        if {\em tail}, player loses 1\$.
      \end{tabular}
    \item Die: 
      \begin{tabular}{l}
        if {\em 5 or above}, win 5\$;\\
        if {\em 4 or below}, lose 3\$.
      \end{tabular}
    \end{itemize}
  \end{itemize}
\end{frame}

\subsection{The Concepts of Fair Game and Average}

\begin{frame}
  \frametitle{Fair Game}
  Examples:
  \begin{itemize}
  \item Coin tossing with wager 1\$ --- \visible<+->{\fair}
  \item Roulette red-black, wager 1\$ --- 
    \visible<+->{unfair to player or \subfair}
  \item Die: 5 or above win 2\$, 4 or below lose 1\$ --- 
    \visible<+->{\fair}
  \item Die: 5 or above win 5\$, 4 or below lose 3\$ --- 
    \visible<+->{\subfair} 
  \item 2 dice:
    \begin{tabular}{l}
      sum 8 or above win 20\$,\\ 
      sum 7 or below lose 15\$
    \end{tabular}
    --- ?
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Average: Definition}

  \uncover<+->{
    \begin{displaymath}
      \av = \mbox{sum of }(\prob \times \pay).    
    \end{displaymath}
  }

  \uncover<+->{
    \begin{displaymath}
      \pay = 
      \begin{cases}
        \mbox{positive if a win},\\
        \mbox{negative if a loss}.
      \end{cases}
    \end{displaymath}
  }

  \uncover<+->{
    \begin{displaymath}
      \prob 
      = \frac{\mbox{\# favourable combinations}}{\mbox{\# all combinations}}
    \end{displaymath}
  }
\end{frame}

\begin{frame}
  \frametitle{Average: Examples}

  \begin{itemize}
  \item Coin tossing
    \begin{itemize}
    \item {\em head\/} $\prob = 1/2$.
    \item {\em tail\/} $\prob = 1/2$.
    \item $\av = 1\times \frac12 + (-1)\times \frac12 = 0$
      \visible<+->{--- \fair!}
    \end{itemize}
  \item Roulette
    \begin{itemize}
    \item \#total $= 18+18+2 = 38$.
    \item \#favourable $= 18$.
    \item $\av = 1\times \frac{18}{38} + (-1)\times \frac{20}{38} =
    -\frac{2}{38} < 0$ \visible<+->{--- \subfair!}
    \end{itemize}
%  \item Die:
%    \begin{itemize}
%    \item $\av = 2\times \frac26 + (-1)\times \frac46 = 0$ ---
%      {\color{green}fair}!
%    \item $\av = 5\times \frac26 + (-3)\times \frac46 = -\frac26 < 0$ ---
%      {\color{red}subfair}!
%    \end{itemize}
  \item 2 dice:
    \begin{itemize}
    \item \#total combinations $=36$.
    \item \#combinations with sum 8 or larger $=15$.
    \item \#combinations with sum 7 or smaller $=21$.
    \item $\av = 20\times \frac{15}{36} + (-15)\times \frac{21}{36} =
      -\frac{15}{36} < 0$ \visible<+->{--- \subfair!}
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Another type of average}

  \begin{itemize}
  \item Previous average was the {\em average winning\/} in one round.
  \item Another important average is {\em average capital after round $N$}:
%    \begin{displaymath}
%      \mbox{average capital} = \mbox{sum of} (N \times \mbox{probability to
%        have $N$ dollars}).
%    \end{displaymath}
  \item Example: 
    \begin{itemize}
    \item you had 10\$ and played a round of coin tossing.
    \item if you won (probability $1/2$), you have 11\$.
    \item if you lost (probability $1/2$), you have 9\$.
    \item on average you have $9\times \frac12 + 11 \times \frac12 = 10$
      dollars.
    \end{itemize}
  \item Example: 
    \begin{itemize}
    \item you had 10\$ and played a round of roulette.
    \item on average you have $9\times \frac{20}{38} + 10 \times \frac{18}{38}
      = 9\frac{36}{38} = 10 - \frac{2}{38}$ dollars.
    \end{itemize}
  \item You had 10\$ and played roulette.  What is you average capital after
    round 19? \visible<+->{9\$.}
  \end{itemize}
\end{frame}

\subsection{Gambler's Ruin}

\begin{frame}
  \frametitle{Gambler's Ruin : The Problem}
  
  \begin{itemize}
  \item Initially you have $n$ dollars.
  \item You play a game with a wager of 1\$ in each round.
  \item In each round, the probability to win is $p$.
  \item $p=1/2$ is \fair, $p<1/2$ is \subfair.
  \item You stop when you get to $m$ dollars or lose all your money.
  \item What is the probability to win the day?
  \item Looking from the other angle, what is the probability of you financial
    ruin?
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Gambler's Ruin : The Formula}

  \begin{itemize}
  \item Probability theory grew out of this problem.
  \item And it provides the answer:
    \begin{displaymath}
      P(n\to m) = 
      \begin{cases}
        \frac{\rho^n - 1}{\rho^m - 1} & \mbox{if }\rho \neq 1,\\
        \frac{n}{m} & \mbox{if }\rho = 1,
      \end{cases}
    \end{displaymath}
    where
    \begin{displaymath}
      \rho = \frac{1-p}{p}.
    \end{displaymath}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Gambler's Ruin: Examples}

  \begin{itemize}
  \item You start with 900\$, your goal is 1000\$,
    \begin{itemize}
    \item Tossing a coin, probability of success is $0.9$.
    \item Playing roulette, $P = 0.00003$.
    \end{itemize}
  \item You start with 100\$, and must raise 20,000\$ by dawn,
    \begin{itemize}
    \item Tossing a coin, probability to get the money is $0.005$.
    \item Playing roulette, it is $0.0000...003$\$ 
      \visible<+->{911 zeros!!!}
    \end{itemize}
  \end{itemize}
\end{frame}

\section{Betting Systems}

\subsection{Betting Systems: Definition and Examples}

\begin{frame}
  \frametitle{Betting Systems: Definition}

  \begin{itemize}
  \item Assume in each round, possible win = possible loss.
  \item Assume you can bet any amount, if you have the money.
  \item Before each round you decide how much you will bet,
    based only on the outcomes of the previous rounds.
  \item Simple examples:
    \begin{itemize}
    \item Straight Play: bet 1\$ every round.
    \item Chicken Play: bet 1\$ every round until the first loss, then stop.
    \end{itemize}
  \item In probability theory, the random variable\\
    \centerline{``capital after round $N$''} 
    is called {\em martingale} (if the game is \fair) 
    and {\em supermartingale} (if the game is \subfair).
  \item Before being adopted as a mathematical term, {\em martingale\/} was
    used to refer to a particular betting system.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The Matringale: An Example of a Betting System}
  \begin{itemize}
  \item Algorithm: 
    \begin{enumerate}
    \item \label{it:start} Bet 1\$.
    \item If you lost, bet 2\$.
    \item If lost again, bet 4\$.
    \item And so forth, doubling the stake each round until you win.
    \item If you win, go to stage \ref{it:start}. 
    \end{enumerate}
  \item Analysis:
    \begin{itemize}
    \item Suppose you lost 3 times in a row and then won.  Your total win
      (loss) is $-1 - 2 - 4 + 8 $\visible<+->{${}=1$.}
    \item In general, when a losing streak is followed by a win, the win pays
      for the losses and brings you 1\$ on top.
    \end{itemize}
  \item Benefit: you can never lose!
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The Martingale: A Practitioner's Testimonial}

  \begin{itemize}
  \item An excerpt from Casanova's diary, Venice, 1754:
    \begin{quote}
      Playing the martingale, and doubling my stakes continuously, I won every
      day during the remainder of the carnival. [..] I congratulated myself
      upon having increased the treasure of my dear mistress [..]
    \end{quote}
  \item Alas, several days later,
    \begin{quote}
      I still played on the martingale, but with such bad luck that I was soon
      left without a sequin. As I shared my property with my mistress, [..]
      %I was obliged to tell her of my losses, and it was 
      at her request I sold all her diamonds, losing what I got for them; she
      had now only five hundred sequins by her. There was no more talk of her
      escaping from the convent, for we had nothing to live on!
    \end{quote}
  \end{itemize}
\end{frame}

\subsection{Can Betting Systems Help?}

\begin{frame}
  \frametitle{You Cannot Reverse the Odds}

  \begin{itemize}
  \item Problem: you need {\bf a lot} of money if a losing streak is long.
  \item The martingale is a sure thing only with infinite capital!
  \end{itemize}

  \begin{theorem}
    If the game is \fair, your average capital remains constant regardless of
    the betting system.
  \end{theorem}

  \begin{theorem}
    If the game is \subfair, your average capital {\bf decreases after every
      round} regardless of the betting system.
  \end{theorem}

  \begin{itemize}
  \item If the game is \subfair, you lose no matter {\bf how} you bet.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Example: Gambler's Ruin with the Martingale}

  \begin{itemize}
  \item Are betting systems completely worthless then?
  \item Remember example: you have 900\$, you want to reach 1000\$.
  \item Suppose the game is \fair
    \begin{itemize}
    \item Using Straight Play, the probability to
      reach the target is $0.9$.
    \item Using the Martingale, the probability remains the same, $0.9$.
    \end{itemize}
  \item Suppose you play roulette
    \begin{itemize}
    \item Using Straight Play, the probability is $0.00003$.
    \item But with the Martingale, it is $0.783$!
    \item This is much better than Straight Play!
    \item And not much worse than in a \fair\ game.
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Bold Play System}

  \begin{itemize}
  \item If the game is \subfair, every round we lose some (on average).
  \item To minimize losses --- minimize rounds!
  \item Algorithm (Bold Play):
    \begin{enumerate}
    \item Suppose you are within $x$ dollar of your target.
    \item If your can afford a bet of $x$, do it!
    \item If your cannot afford, bet all you have got!
    \end{enumerate}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Bold Play: How Does it Fare?}      
  \begin{itemize}
  \item In roulette, going from 900\$ to 1000\$ will be sucessful with
    probability $0.88$.  
    \begin{itemize}
    \item Better than Straight Play ($0.00003$)
    \item or Martingale ($0.78$)
    \item and not much worse than in a fair game ($0.9$).
    \end{itemize}
  \item Raising 20,000\$ from 100\$ at roulette will succeed with probability
    $0.003$.  
    \begin{itemize}
    \item Unlikely
    \item but infinitely better than $0.00...03$ with Straight Play
    \item and not much worse than $0.005$ chance in a fair game.
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Bold Play is Optimal}

  \begin{theorem}
    For every fixed subfair game, starting capital $n$ and the target $m$,
    Bold Play provides the best chances of success.
  \end{theorem}
\end{frame}

\section{Conclusions}

\begin{frame}
  \frametitle{Conclusions}

  \begin{itemize}
  \item You cannot reverse the odds.
  \item If you must play and have a target,\\ 
    Bold Play will maximize your chances of reaching it.
  \item How not to lose your money gambling?\\~\\
    \visible<+->{\centerline{\LARGE DO NOT GAMBLE!}}
  \end{itemize}
\end{frame}

\end{document}

