1 .
$\newcommand{\Heads}{{\rm H \scriptsize EADS}}$
Consider a coin that comes up heads with probability 1/3 and, thus, tails with probability 2/3.
Consider the following recursive algorithm $\Heads$, which takes as input a positive integer $k$:
$\mathbf{Algorithm}\ \Heads(k)\mathrm{:}$
$//$ |
$\text{all coin flips made}$ $\text{are mutually independent}$
|
$\text{flip the coin};$
$\mathbf{if}\ \text{the coin came up heads}$
$\mathbf{then}\ \mathrm{return}\ k + 1$
$\mathbf{else}\ \Heads(k + 1)$
$\mathbf{endif}$
You run algorithm $\Heads(1)$, i.e., with $k = 1$. Define the random variable $X$ to be the value of
the output of this algorithm. Let $m \geq 1$ be an integer. What is $\Pr(X = m + 1)$?