You are on page 1of 2

STATS 100A HW2 Solution

Problem 1 Suppose we flip a fair coin independently 100 times. We define the outcome to be the
sequence of heads and tails generated by the 100 flips. All the sequences are equally likely.
(1) What is the sample space?
A: The set of all the 2100 sequences.
(2) Let X be the number of heads. What is the event that X = 50?
A: The subset of all the sequences with exactly 50 heads.
(3) Write down the formula for calculating P (X = 50).
A: P (X = 50) = 100
 100
50 /2 .
(4) Write down the formula for calculating P (X ∈ [40, 60]).
A: P (X ∈ [40, 60]) = 60 100
P  100
k=40 k /2 .
Problem 2 Consider a random walk on integers. We start from X0 = 0, and at each step, we flip
a fair coin. If it is head, we move forward by 1, and if it is tail, we move backward by 1. In math
notation, Xt+1 = Xt + t , where t = 1 with probability 1/2, and t = −1 with probability 1/2.
(1) At time t = 5, what are the possible values of Xt ?
A: (-5, -3, -1, 1, 3, 5).
(2) What is the probability of each possible value in (1)?
A: 50 /25 = 1/32, 51 /25 = 5/32, 52 /25 = 10/32, 53 /25 = 10/32, 54 /25 = 5/32, 55 /25 =
     

1/32.
(3) If 1 million people do the random walk independently, all starting from 0 at t = 0. At t = 5,
what is the distribution of these 1 million people?
A: Approximately 1/32 million, 5/32 million, 10/32 million, 10/32 million, 5/32 million, 1/32
million.
Problem 3 Suppose a person does random walk over 2 states, 1 and 2, starting from state 1. At
each step, the person will stay with probability 1/3, or move to the other state with probability
2/3. Let Xt be the state of the person at step t, with X0 = 1.
(1) Calculate P (Xt = 1) and P (Xt = 2) for t = 1, 2, 3, 4.
A: X0 = 1,

P (X1 = 1) = 1/3, P (X1 = 2) = 2/3


1 1 2 2
P (X2 = 1) = P (X2 = 1|X1 = 1)P (X1 = 1) + P (X2 = 1|X1 = 2)P (X1 = 2) = × + × = 5/9
3 3 3 3
2 1 1 2
P (X2 = 2) = P (X2 = 2|X1 = 1)P (X1 = 1) + P (X2 = 2|X1 = 2)P (X1 = 2) = × + × = 4/9
3 3 3 3
1 5 2 4
P (X3 = 1) = P (X3 = 1|X2 = 1)P (X2 = 1) + P (X3 = 1|X2 = 2)P (X2 = 2) = × + × = 13/27
3 9 3 9
2 5 1 4
P (X3 = 2) = P (X3 = 2|X2 = 1)P (X2 = 1) + P (X3 = 2|X2 = 2)P (X2 = 2) = × + × = 14/27
3 9 3 9
1 13 2 14
P (X4 = 1) = P (X4 = 1|X3 = 1)P (X3 = 1) + P (X4 = 1|X3 = 2)P (X3 = 2) = × + × = 41/81
3 27 3 27
2 13 1 14
P (X3 = 2) = P (X3 = 2|X2 = 1)P (X2 = 1) + P (X3 = 2|X2 = 2)P (X2 = 2) = × + × = 40/81
3 27 3 27
(2) Let Kij = P (Xt+1 = j|Xt = i). Let K be the 2 × 2 matrix. Write down K.
A:

1
From the definition Kij = P (Xt+1 = j|Xt = i) we have,

K11 = P (Xt+1 = 1|Xt = 1) = 1/3, K12 = P (Xt+1 = 2|Xt = 1) = 2/3


K21 = P (Xt+1 = 1|Xt = 2) = 2/3, K22 = P (Xt+1 = 2|Xt = 2) = 1/3

thus,
!
1/3 2/3
K=
2/3 1/3

(3) Let p(t) = (P (Xt = 1), P (Xt = 2)). Prove p(t+1) = p(t) K, and p(t) = p(0) K t .
A:
1 2
P (Xt+1 = 1) = P (Xt+1 = 1|Xt = 1)P (Xt = 1) + P (Xt+1 = 1|Xt = 2)P (Xt = 2) = P (Xt = 1) + P (Xt = 2)
3 3
2 1
P (Xt+1 = 2) = P (Xt+1 = 2|Xt = 1)P (Xt = 1) + P (Xt+1 = 2|Xt = 2)P (Xt = 2) = P (Xt = 1) + P (Xt = 2)
3 3
thus,
!
    1/3 2/3
P (Xt+1 = 1), P (Xt+1 = 2) = P (Xt = 1), P (Xt = 2) =⇒ p(t+1) = p(t) K
2/3 1/3

from the mathematical induction,

p(t) = p(t−1) K = p(t−2) K 2 = · · · = p(0) K t

(4) If 1 million people do the random walk independently, all starting from 1 at t = 0. At t = 4,
what is the distribution of these 1 million people?
A: 41/81 million, 40/81 million.
Problem 4 Watch
https://www.youtube.com/watch?v=Kq7e6cj2nDw
Write a brief memo on Galton’s board.

You might also like