# How to find this pgf in a game of roulette?

Here's an exercise in An Intermediate Course in Probability by Gut.

The probability generating function (pgf) of a nonnegative integer-valued random variable $$Y$$ is $$g_Y(t)=Et^Y$$, and the pgf of a sum $$S_N$$ of a random number $$N$$ of i.i.d. random variables $$X_1,X_2,\ldots$$ is $$g_{S_N}(t)=g_N(g_X(t))$$.

Exercise 6.2 Consider a game of roulette and [someone] who bets one dollar until number $$13$$ appears, with the roulette wheel having numbers $$0,\ldots,36$$. Then [they bet] one dollar the same number of times on number $$36$$. Find the pgf of [their] loss in the second round. Try also finding the pgf for [their] overall loss.

Here's my attempt. Let $$N\in \text{Fs}(1/37)$$ be the number of bets on number $$13$$ (here $$\text{Fs}(1/37)$$ is the geometric distribution that models the first success), and let $$Y_1,Y_2,\ldots$$ be the losses in the bets on number $$36$$. Thus $$Y_k=\begin{cases} 1,&\text{if number 36 does not appear}\\ -35&(\text{i.e.} -36+1)\quad\text{otherwise},\end{cases}$$and $$Y_1,Y_2,\ldots$$ are independent with $$P(Y_k=1)=36/37$$ and $$P(Y_k=-35)=1/37$$ (note that a negative loss is a gain).

So the player's loss in the second round equals $$X=Y_1+\ldots +Y_N$$. We know the generating function of $$X$$ is $$g_X(t)=g_N(g_Y(t))$$. Computing the generating function of the geometric distribution is straightforward; it is $$\frac{tp}{1-(1-p)t}$$ where $$p=1/37$$. But what is the pgf of $$Y$$? $$Y$$ seems to be both positive and negative, and hence I'm confused if it even has a pgf.

The total loss is $$X+N-36$$, but from the first part I am unsure how to find the pgf of this random variable.

The number of spins until the first $$13$$ appears follows a Geometric distribution with $$p = 1/37$$, i.e. the probability that the first $$13$$ appears on spin $$n$$ is $$p (1-p)^n$$ for $$n \ge 1$$. So the PGF for the number of spins is $$g_N(t) = \sum_{n=1}^{\infty} p(1-p)^n t^n= \frac{pt}{1-(1-p)t}$$ where we have applied the formula for the sum of an infinite geometric series.

If $$X$$ is the loss on a single spin in the second part, then $$X=0$$ with probability $$p$$ and $$X=1$$ with probability $$1-p$$ (regardless of the number of the spin). So the PGF of $$X$$ is $$g_X(t) = p + (1-p)t$$

Applying the theorem quoted in the OP, the PGF of the total loss is $$g_N(g_X (t)) = \frac{p(p + (1-p)t)}{1-(1-p)(p + (1-p)t)}$$

• Thanks! I don't see how the expression for $g_N(g_X (t))$ can be true. The expected total loss is $E(X+N-36)=2$. This follows from the fact that $$EX=EN\cdot EY=37\cdot\left(1\cdot\frac{36}{37}-35\cdot\frac1{37}\right)=1,$$and $EN=37$. The left-hand derivative of a PGF at $t=1$ should give the expected value. Differentiating your expression with $p=1/37$ and evaluating at $t=1$, WolframAlpha yields $36$. Something's not right, but I don't know what.
– psie
Commented Jul 27 at 16:48
• Maybe it is supposed to be that way. Would you know how to find the PGF for his overall loss? I'm unsure which random variable describes the overall loss.
– psie
Commented Jul 27 at 17:41
• @pse The expected value of the loss is the expected value of the number of spins times the expected value of the loss on one spin: $37 \times (36/37) = 36$. The PGF above is the PGF of the overall loss. Frankly, I don't understand what the exercise statement means by "the loss in the second round", unless by that is meant the overall loss. So maybe I don't understand the problem. Commented Jul 27 at 20:54