% This is a simple LaTex sample document that gives a submission format
%   for IEEE PAMI-TC conference submissions.  Use at your own risk.

% Make two column format for LaTex 2e.


\documentclass[11pt]{article} %
\usepackage[dvips]{graphicx,graphics,color}
\usepackage{times,amsmath,amsfonts}

\setlength{\textheight}{10in} \setlength{\textwidth}{6.875in}
\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0in} \setlength{\headsep}{0in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.2in}  % Centers text.
\setlength{\evensidemargin}{-.2in}

% Add the period after section numbers.  Adjust spacing.
\newcommand{\Section}[1]{\vspace{-8pt}\section{\hskip -1em.~~#1}\vspace{-3pt}}
\newcommand{\SubSection}[1]{\vspace{-3pt}\subsection{\hskip -1em.~~#1}
        \vspace{-3pt}}
\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand{\bq}{\begin{eqnarray*}}
\newcommand{\eq}{\end{eqnarray*}}
\begin{document}

% Don't want date printed
\date{February 1, 2005}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 324: Lecture 05\\
Discrete Random Variables}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}

% For two authors (default example)
\maketitle \thispagestyle{empty}
\begin{enumerate}
\item Given a sample space $S$, a {\em random variable} $X$ is a rule that
assigns a number to each element of $S$. $X$ is a function that maps
element $s \in S$ to a real number. In mathematical notation, $X:S
\to \mathbb{R}$.

\item {\em Bernoulli random variable} $X$ takes values only 0 or 1.

\item The {\em probability distribution} $p$ of a random variable $X$ is
defined for every number $x$ such that $$p(x)=P(X=x)=P(s \in
S:X(s)=x).$$

\item  $X$ is a Bernoulli random variable with parameter $p$ if
$P(X=1)=p$ and $P(X=0)=1-p$. It will be denoted by $X \sim
Bernoulli(p)$. The distribution can be written as
$p(x)=(1-p)^{1-x}p^x$.

\item {\em Problem.} Toss a coin until the first head is obtained. Let $X$ be the
number of tosses until the first head is obtained. Find the
probability
distribution of $X$.\\
{\em Solution.} $P(X=x) = (1-p)^{x-1}p$. This is called the
geometric distribution.

\item The {\em cumulative distribution function} (cdf) of a discrete random
variable $X$ is is defined as $$F(x) = P(X \leq x)= \sum_{y \leq x}
p(y).$$
\item Find cdf of the geometric distribution.\\
{\em Solution.} For positive integer $x$, $F(x) = 1 - (1-p)^x$.
\item The {\em expected value} of a discrete random variable $X$
is defined as $\mathbb{E} X = \sum xp(x)$. The expectation of the
geometric distribution is $1/p$.



\item {\em Problem.} Two players $A$ and $B$ flip a biased coin alternately and the first player
to obtain a head wins. The probability of obtaining a head is $p > 0$ at each toss.
 If $A$ flips first, find the probability that $A$ wins the game.\\
{\it solution.} Let $X$ be the number of tosses $A$ makes until he
gets head.
\bq P(A \mbox{ wins }) &=& P(X=1)+P(X=2)+P(X=3) + \cdots \\
&=& p + (1-p)^2p + (1-p)^4p + \dots\\
&=& \frac{p}{1-(1-p)^2} \eq



\end{enumerate}

{\bf Assigned Problems} Exercise 3.18., Exercise 3.36.


\end{document}
