Generating Functions: M15 Probability II Problems Sheet Gen. Fns
Generating Functions: M15 Probability II Problems Sheet Gen. Fns
Fns
Generating functions
The moment generating function MX (t) of a random variable X is defined via
def X EX k
tX
MX (t) = E e ≡ tk .
k!
k≥0
Notice that GX (s) is always finite (and analytic) for |s| < 1, whereas MX (t)
might not be defined for t 6= 0.
GF 1. Find the generating functions, both ordinary G(s) and moment M (t), for
the following discrete probability distributions:
(a) the distribution describing a fair die;
(b) the distribution describing a die that always comes up 3;
(c) the uniform distribution on the set {n, n + 1, n + 2, . . . , n + k};
(d) the binomial distribution on {n, n + 1, n + 2, . . . , n + k};
GF 2. Let a random variable X with values in {0, 1, 2} have moments µ1 = 1 and
µ2 = 3/2.
(a) Find its probability generating function G(s) and the probabilities P(X = k)
for k ∈ {0, 1, 2};
(b) find the moment generating function MX (t) and the first six moments of X.
GF 3. Let X be a discrete random variable with values in {0, 1, 2, . . . , n} and
moment generating function M (t). Find, in terms of M (t), the generating functions
for:
a) − X , b) X + 1 , c) 3X , d) aX + b .
GF 4. Let X be a random variable with generating function GX (s). In terms of
GX (s),
a) find the generating functions of the random variables X + 1 and 2X;
P
b) find the generating function of the sequence P(X ≤ n) = k≤n P(X = k);
c) find the generating function of the sequence P(X = 2n).
1
Hint: Which sequence has generating function 2
GX (s) + GX (−s) ?
a) Use the partition theorem for expectations to find E(SN ) in terms of EX and
EN ;
b) Use the partition theorem for expectations to find Var(SN ) in terms of EX,
VarX, EN , and VarN ;
c) Show that the generating function GSN (s) of SN is GSN (s) ≡ GN GX (s) ;
d) Use the previous result to compute E(SN );
e) Use the result in c) to compute Var(SN ).
GF 13. Let p be the probability distribution on {0, 1, 2} with p(1) = 31 , p(2) = 23 ,
and let pn = p ? p ? · · · ? p be the n-fold convolution of p with itself.
(e) Find those integers j for which pn (j) > 0 from Gn (s).
GF 14. Imagine a diligent janitor who replaces a light bulb the same day as it
burns out. Suppose the first bulb is put in on day 0 and let Xi be the lifetime of
the ith light bulb. For simplicity, we assume that the individual lifetimes Xi are iid
rv’s in {1, 2, . . . } having a common distribution with generating function GX (s).
In this interpretation Tk = X1 + X2 + · · · + Xk is the time the kth light bulb burns
out; we put T0 = 0. Let Rn be the event “a light bulb was replaced in n days”, so
that R0 ≡ {T0 = 0} ≡ Ω (a certain event).
Pn
a) Show that for every n ≥ 1 we have P(Rn ) = k=1 P X1 = k P Rn−k ;
b) Deduce that the characteristic function GR (s) of the sequence P(Rn ) equals
−1
GR (s) = 1 − GX (s) .
c) Show that the distributions in a) and b) above have the same mean, but not
necessarily the same variance.
[Hint: You might prefer to first consider the case k = 1, and then generalise.]
a) Show that
r − 1 a r−a
P(X = r) = p q , r ≥ a.
a−1
pa sa (1 − qs)−a
GF 17. Two players play a game called heads or tails. In this game, a coin coming
up heads with probability p is tossed consecutively. Each time a head comes up
Player I wins 1 pence, otherwise she loses 1 pence. Let Xk ∈ {−1, 1} denote the
outcome of the kth trial, and let Sn , n ≥ 0, be the total gain of Player I after n
trials, Sn = X1 + · · · + Xn , where different outcomes are assumed independent.
Let T be the moment when Player I is first in the lead, ie.,
GF 18. A slot machine operates so that at the first turn the probability for the
player to win is 1/2. Thereafter the probability for the player to win is 1/2 if she lost
at the last turn, but is p < 1/2 if she won at the last turn. If un is the probability
that the player wins at the nth turn, show that for n > 1
1 1
un + − p un−1 = .
2 2
Show that this equation also holds for n = 1, if u0 is suitably defined, and find un .
GF 19. A flea randomly jumps over non-negative integers according to the follow-
ing rule: a coin is flipped; if it shows “tails”, the flea jumps to the next integer (ie.,
k 7→ k + 1); if the coin shows “heads”, the flea jumps over the next integer (ie.,
k 7→ k + 2). Let un be the probability that, starting at the origin, the flea visits n
at some point.
a) if the coin is fair, show that un = (un−1 + un−2 )/2, compute the generating
function Gu (s) of the sequence un , and thus derive a formula for un ;
b) do the same for a biased coin showing “heads” with probability p ∈ [0, 1].
GF 20. A biased coin is tossed repeatedly; on each toss, it shows a head with
probability p. Let W be the number of tosses until the first occasion when r
consecutive tosses have shown heads. Find the probability generating function of
the random variable W .
GF 21. In a multiple-choice examination, a student chooses between one true and
one false answer to each question. Assume that the student answers at random,
and let N be the number of such answers until she first answers two successive
questions correctly. Show that E(sN ) = s2 (4 − 2s − s2 )−1 . Hence, find E(N ) and
P(N = k). Now find E(N ) directly.
GF 22. In a sequence of Bernoulli trials with success probability p, let un be the
probability that the first combination S(uccess)F (ailure) occurs (in that order) at
trials number n − 1 and n. Find the corresponding generating function, mean and
variance.
GF 23. A fair coin is tossed n times. Let un be the probability that the sequence
of tosses never has “head” followed by “head”. Show that
1 1
un = un−1 + un−2 .
2 4
Find un , using the condition u0 = u1 = 1. Compute u2 directly and check that
your formula gives the correct value for n = 2.
GF 24. A biased coin is tossed N times, where N is a Poisson random variable
with parameter λ. Let H be the number of heads and let T be the number of tails
observed in this experiment. Use generating functions to show that H and T are
Poisson random variables. Show that H and T are independent, and find the mean
and the variance of H − T .
5
Optional problems
GF 25.~ A loaded die may show different faces with different probabilities.
a) Is it possible to renumber two fair dice so that their sum is equally likely to
take any value between 2 and 12 inclusive?
b) Can one load two traditional cubic dice in such a way that the sum of their
scores is uniformly distributed on {2, 3, . . . , 12}?
c) Can the sum of three loaded dice have the same distribution as the sum of
three fair dice?
GF 26.~ Successive cars pass at instants Xi seconds apart, i ≥ 1. You require b
seconds to cross the road. If the random variables Xi (i ≥ 1) are independent and
identically distributed, find your expected waiting time until you cross. Evaluate
this when fX (k) = qpk−1 , k ≥ 1.
GF 27. ~ Let fn be the number of paths on the integer lattice Z2 of length n
starting from (0, 0), with steps of the type (1, 0), (−1, 0), or (0, 1), and never
intersecting themselves. For instance, f2 = 7, as shown in the figure below:
where the maximum is taken over all graphs G satisfying the conditions above.
Show that for all s ≥ 0 we have
d
ϕK (s) ≤ s 1 + ϕK (s) ;
thus deduce that the generating function ϕK (s) is finite for all complex s satisfying
|s| < s0 with s0 > 0 small enough, and derive the estimate
1 dd n
Kn ≤ .
d − 1 (d − 1)d−1
GF 31.~ For n ∈ N, let gn denote the number of k-element subsets of the set
(k)
(c) Use your answer in (b) to compute the probability of not seeing a pair of
consecutive numbers in a (random) draw of the lottery “6 out of 49”. Does
it correspond to your experience? You might wish to compare your answer
with the actual results, see e.g., http://lottery.merseyworld.com/.
P
n
(n)
Using generating functions, show that the distribution of Xk converges to that
k=1
of a Poisson(λ) random variable. This result is known as the law of rare events.
[Hint: You might wish to check that −y 2 ≤ log(1 − y) + y ≤ 0 for all y ∈ [0, 1/2].]
GF 33.~ In n tosses of a biased coin, let Ln be the length of the longest run of
heads, and set πn,r = P(Ln < r). Show that
∞
X
n 1 − pr sr
1+ s πn,r = .
n=1
1 − s + qpr sr+1
GF 34.~ Let the generating function of the family size in an ordinary branching
process be G(s) = 1 − p(1 − s)β , where 0 < p, β < 1. Show that if Z0 = 1, then
n−1 n
E(sZn ) = 1 − p1+β+···+β (1 − s)β .
If the check is not infallible, but errs with probability δ, find the above two quantities
in this case.