MTH 202 Homework


Homework

HW 13, due May 1

Hints

Problem 1

Customers arrive at a service facility according to a Poisson process of intensity λ. The service times \(Y_1, Y_2 , \ldots\) of the arriving customers are independent random variables having the common probability distribution function \(G(y) = \Prob\{Y_k ≤ y\}\). Assume that there is no limit to the number of customers that can be serviced simultaneously; i.e., there is an infinite number of servers available. Let \(M(t)\) count the number of customers in the system at time t. Argue that \(M(t)\) has a Poisson distribution with mean \(λpt\), where

\[p = t^{−1} \int_0^t [1 − G(y)]dy.\]

Problem 2

Customers arrive at a service facility according to a Poisson process of rate λ customers/hour. Let \(X(t)\) be the number of customers that have arrived up to time t. Let \(W_1 , W_2 , \ldots\) be the successive arrival times of the customers.

  1. Determine the conditional mean $E[W_1|X(t) = 2]$.

  2. Determine the conditional mean $E[W_3|X(t) = 5]$.

  3. Determine the conditional probability density function for \(W_2\), given that \(X(t) = 5\).

Problem 3

Suppose that N points are uniformly distributed over the surface of a circular disk of radius r. Determine the probability distribution for the number of points within a distance of one of the origin as \(N → ∞, r → ∞, N/(π r^2) = λ\).

Problem 4

Let \(X(t)\) be a Poisson process of rate \(\lambda\). Validate the identity

\[\{W_1 > w_1, W_2 > w_2\} \Leftrightarrow \{X(w_1) = 0,\; X(w_2) - X(w_1) = 0 \text{ or } 1\}.\]

Use this to determine the joint upper tail probability

\[\begin{align*} \Pr\{W_1 > w_1, W_2 > w_2\} & = \Pr\{X(w_1) = 0,\; X(w_2) - X(w_1) = 0 \text{ or } 1\} \\ & = e^{-\lambda w_1}[1 + \lambda(w_2 - w_1)]e^{-\lambda(w_2 - w_1)}. \end{align*}\]

Finally, differentiate once in $w_1$ and once in $w_2$ to obtain the joint density function

\[f(w_1, w_2) = \lambda^2 \exp\{-\lambda w_2\} \quad \text{for } 0 < w_1 < w_2.\]

Problem 5

The joint probability density function for the waiting times \(W_1\) and \(W_2\) is given by

\[f(w_1, w_2) = \lambda^2 \exp\{-\lambda w_2\} \quad \text{for } 0 < w_1 < w_2.\]

Determine the conditional probability density function for \(W_1\), given that \(W_2 = w_2\). How does this result differ from that in Theorem 5.7 (I know the 4th edition of the textbook says Theorem 5.6, which is probably a typo)?

Problem 6

A critical component on a submarine has an operating lifetime that is exponentially distributed with mean \(0.50\) years. As soon as a component fails, it is replaced by a new one having statistically identical properties. What is the smallest number of spare components that the submarine should stock if it is leaving for a one-year tour and wishes the probability of having an inoperable unit caused by failures exceeding the spare inventory to be less than \(0.02\)?

Problem 1

Write \(M(t) = \sum_{i=1}^{N(t)} \mathbf{1}_{\{W_i + Y_i > t\}}\), where \(W_i\) is the arrival time and \(Y_i\) the service time of customer \(i\). Conditioning on \(N(t) = k\):

\[P(M(t)=j) = \sum_{k=j}^{\infty} P(M(t)=j \mid N(t)=k)\, P(N(t)=k)\]

Given \(N(t)=k\), the indicator \(\mathbf{1}_{\{W_i+Y_i>t\}}\) is a symmetric function of the arrival times, so by the Poisson order-statistic theorem the \(W_i\) are i.i.d. \(\mathrm{Unif}(0,t)\). Each indicator is then Bernoulli with success probability

\[p = P(U + Y_1 > t) = \int_0^t P(Y_1 > t-u)\,\frac{du}{t} = \frac{1}{t}\int_0^t [1-G(u)]\,du\]

so \(P(M(t)=j \mid N(t)=k) = \binom{k}{j}p^j(1-p)^{k-j}\). Substituting \(P(N(t)=k) = e^{-\lambda t}(\lambda t)^k/k!\) and summing:

\[P(M(t)=j) = \sum_{k=j}^{\infty} \binom{k}{j}p^j(1-p)^{k-j}\,e^{-\lambda t}\frac{(\lambda t)^k}{k!} = e^{-\lambda t p}\,\frac{(\lambda t p)^j}{j!}\]

Hence \(M(t) \sim \mathrm{Poisson}(\lambda t p)\).

Problem 2

a. Given \(X(t)=2\), the two arrival times are the order statistics of \(U_1,U_2 \overset{\text{iid}}{\sim} \mathrm{Unif}(0,t)\), so \(W_1 = \min(U_1,U_2)\). Then

\[E[W_1 \mid X(t)=2] = E[\min(U_1,U_2)] = \int_0^t P(\min(U_1,U_2)>s)\,ds = \int_0^t \!\left(1-\frac{s}{t}\right)^{\!2}ds = \frac{t}{3}\]

b. Given \(X(t)=5\), the arrival times are distributed accorrding to \(U_1,\ldots,U_5 \overset{\text{iid}}{\sim}\mathrm{Unif}(0,t)\).

Let \(\min_i(a_1,\ldots,a_n)\) be the \(i^{\text{th}}\) minimum of the sequence \(a_1,\ldots,a_n\). It is clear that \(\min_i\) is a symmetric function of the variables \(a_1,\ldots,a_n\).

For example \(\min_1(0,3,7,2,6) = 0\) and \(\min_2(0,3,7,2,6) = 2\).

Similarly define \(\max_i\). It’s clear that \(\min_i(a_1,\ldots,a_n) + \max_{i}(a_1,\ldots,a_n)\) is a symmetric function, since it is a sum of two symmetric functions.

Note $t - U_i \overset{d}{=} \Uniform(0,t)$ (it is easy to check by comparing densities), and therefore we get

\[\max_i(U_1,\ldots,U_5) \overset{d}{=} \max_i(t-U_1,\ldots,t-U_5) = t - \min_i(U_1,\ldots,U_5)\]

so

\[E[\min_i(U_1,\ldots,U_5) + \max_i(U_1,\ldots,U_5)] = t.\]

In particular \(E[W_1+W_5 \mid X(t)=5] = t\) and \(E[W_2+W_4\mid X(t)=5] = t\). Also

\[E[W_1+\cdots+W_5 \mid X(t)=5] = 5\,E[U_1] = \frac{5t}{2}\]

Therefore

\[E[W_3 \mid X(t)=5] = E[W_1+\cdots+W_5 \mid X(t)=5] - E[W_1+W_5 \mid X(t)=5] - E[W_2+\cdots+W_4 \mid X(t)=5] \frac{5t}{2} - t - t = \frac{t}{2}\]

Here is another way to do this. Note that

\[\begin{aligned} E[W_3 | X(t) = 5] & = \int_{0<W_1<\cdots<W_5<t} w_3 f_{W_1,\ldots,W_5|X(t) = 5}(w_1,\ldots,w_5) dw_1\cdots dw_5\\ & = \frac{5!}{t^5} \int_{0}^t \int_{w_1}^t \int_{w_2}^t \int_{w_3}^t \int_{w_4}^t w_3 dw_1\cdots dw_5\\ & = \frac{5!}{t^5} \int_{0}^t \int_{w_1}^t \int_{w_2}^t \int_{w_3}^t w_3 (t - w_4) dw_1\cdots dw_4\\ & = \frac{5!}{t^5} \int_{0}^t \int_{w_1}^t \int_{w_2}^t w_3 \frac{(t - w_3)^2}{2} dw_1\cdots dw_3\\ & = \frac{5!}{t^5} \int_{0}^t \int_{w_1}^t \frac{(t - w_2)^3 (t + 3w_2)}{24} dw_1 dw_2\\ & = \frac{5!}{t^5} \int_{0}^t \frac{(t - w_1)^4 (2t + 3w_1)}{120} dw_1 \\ & = \frac{5!}{t^5} \frac{t^6}{240} = \frac{t}{2} \end{aligned}\]

A bit unpleasant, but totally workable.

c. The joint density of \((W_1,W_2,W_3,W_4,W_5)\) given \(X(t)=5\) is \(5!/t^5\) on \(0<w_1<\cdots<w_5<t\). Integrating over \(w_1\in(0,s)\) and \(w_3,w_4,w_5\in(s,t)\):

\[f_{W_2|X(t)=5}(s) = \frac{5!}{t^5}\int_0^s dw_1 \int_s^t\!\int_{w_3}^t\!\int_{w_4}^t dw_5\,dw_4\,dw_3 = \frac{5!}{t^5}\cdot s\cdot \frac{(t-s)^3}{2\cdot 3} = \frac{20\,s(t-s)^3}{t^5}, \quad 0<s<t\]

Problem 3

Let \(X_i = \mathbf{1}_{\{\text{point }i\text{ falls within distance 1 of origin}\}}\). Each \(X_i \sim \mathrm{Bernoulli}(p)\) with

\[p = \frac{\pi \cdot 1^2}{\pi r^2} = \frac{1}{r^2} = \frac{\lambda \pi}{N}\]

The count \(S_N = \sum_{i=1}^N X_i \sim \mathrm{Binomial}(N, \lambda \pi/N)\). By the law of rare events, with Poisson approximant \(Y_N \sim \mathrm{Poisson}(\lambda \pi)\):

\[\bigl|P(S_N=k) - P(Y_N=k)\bigr| \leq Np^2 = N\cdot\frac{\lambda^2\pi^2}{N^2} \to 0\]

as \(N\to\infty\). Hence the number of points within distance 1 converges in distribution to \(\mathrm{Poisson}(\lambda \pi)\).

Problem 4

Note that \(W_1 > w_1\) means the first arrival comes after \(w_1\), i.e., no arrivals in \([0, w_1]\), which is exactly \(X(w_1) = 0\). Given \(X(w_1) = 0\), the event \(W_2 > w_2\) (for \(w_2 \ge w_1\)) means the second arrival comes after \(w_2\), so at most one arrival occurs in \((w_1, w_2]\), i.e., \(X(w_2) - X(w_1) \in \{0, 1\}\).

By independence of increments:

\[\begin{align*} \Pr\{W_1 > w_1,\, W_2 > w_2\} & = \Pr\{X(w_1)=0\}\cdot\Pr\{X(w_2)-X(w_1)\in\{0,1\}\}\\ & = e^{-\lambda w_1}\bigl[e^{-\lambda(w_2-w_1)} + \lambda(w_2-w_1)e^{-\lambda(w_2-w_1)}\bigr]\\ & = e^{-\lambda w_1}[1+\lambda(w_2-w_1)]e^{-\lambda(w_2-w_1)}. \end{align*}\]

Let \(\bar{F}(w_1,w_2) = e^{-\lambda w_2}[1+\lambda(w_2-w_1)]\). Differentiating once in \(w_1\):

\[\frac{\partial \bar{F}}{\partial w_1} = -\lambda e^{-\lambda w_2}.\]

Differentiating once more in \(w_2\):

\[f(w_1,w_2) = \frac{\partial^2 \bar{F}}{\partial w_2\,\partial w_1} = \frac{\partial}{\partial w_2}\bigl(-\lambda e^{-\lambda w_2}\bigr) = \lambda^2 e^{-\lambda w_2}, \quad 0 < w_1 < w_2.\]

Problem 5

The marginal density of \(W_2\) is obtained by integrating over \(w_1 \in (0, w_2)\):

\[f_{W_2}(w_2) = \int_0^{w_2} \lambda^2 e^{-\lambda w_2}\,dw_1 = \lambda^2 w_2\, e^{-\lambda w_2}, \quad w_2 > 0.\]

The conditional density is therefore

\[f_{W_1 \mid W_2}(w_1 \mid w_2) = \frac{f(w_1,w_2)}{f_{W_2}(w_2)} = \frac{\lambda^2 e^{-\lambda w_2}}{\lambda^2 w_2\, e^{-\lambda w_2}} = \frac{1}{w_2}, \quad 0 < w_1 < w_2.\]

So \(W_1 \mid W_2 = w_2 \sim \mathrm{Uniform}(0, w_2)\).

The problem originally asks you (in the 4th edition of Karlin and Pinsky at least) to compare with Theorem 5.6 in the textbook, which states states that

\[P(X(u) = 1 | X(t) = 2) = \binom{2}{1} \frac{1}{2}^2 = \frac{1}{2}\]

This is the binomial distribution. It has little to do with our problem.

It makes more sense to compare it with Theorem 5.7 for $n=2$, $k=1$, $t = w_2$ which says

\[f_{W_1|X(w_2) = 2}(w_1) = \frac{1}{w_2}\]

Problem 6

Each component has an exponentially distributed lifetime with mean \(0.50\) years, so the failure rate is \(\lambda = 1/0.50 = 2\) failures/year. Because lifetimes are exponential (memoryless), failures form a Poisson process, and the number of failures \(N\) in one year satisfies \(N \sim \mathrm{Poisson}(2)\).

The submarine has one active component and \(n\) spares, so the system becomes inoperable once it has experienced more than \(n\) failures. We need the smallest \(n\) with

\[\Pr\{N > n\} < 0.02, \quad \text{i.e.,} \quad \Pr\{N \le n\} > 0.98.\]

Computing the Poisson(2) CDF:

\(n\) \(\Pr\{N \le n\}\)
3 \(e^{-2}(1+2+2+\tfrac{4}{3}) \approx 0.857\)
4 \(e^{-2}(1+2+2+\tfrac{4}{3}+\tfrac{2}{3}) = 7e^{-2} \approx 0.947\)
5 \(7e^{-2} + \tfrac{4}{15}e^{-2} = \tfrac{109}{15}e^{-2} \approx 0.983\)

Since \(\Pr\{N > 4\} \approx 0.053 > 0.02\) and \(\Pr\{N > 5\} \approx 0.017 < 0.02\), the submarine must stock 5 spare components.

HW 12 due Apr 24

Problem 1

For each value of \(h > 0\), let \(X(h)\) have a Poisson distribution with parameter \(λh\). Let \(p_k (h) = P\left( X(h) = k \right)\) for \(k = 0, 1, \ldots\) Verify that

\[\begin{align*} \lim_{h→0} \frac{1 − p_0}{h} & = λ, \OR p_0 (h) = 1 − λh + o(h) \\ \lim_{h→0} \frac{p_1 (h)}{h} & = \lambda \OR p_1 (h) = λh + o(h)\\ \lim_{h→0} \frac{p_2 (h)}{h} & = 0 \OR p_2 (h) = o(h)\\ \end{align*}\]

Here \(o(h)\) stands for any remainder term of order less than \(h\) as \(h → 0\).

Problem 2

Shocks occur to a system according to a Poisson process of rate \(λ\). Suppose that the system survives each shock with probability α, independently of other shocks, so that its probability of surviving \(k\) shocks is \(α^k\). What is the probability that the system is surviving at time t?

Problem 3

Determine numerical values to three decimal places for \(P\left( X = k \right)\), \(k = 0, 1, 2\), when

(a) \(X\) has a binomial distribution with parameters \(n = 20\) and \(p = 0.06\).

(b) \(X\) has a binomial distribution with parameters \(n = 40\) and \(p = 0.03\).

(c) \(X\) has a Poisson distribution with parameter \(λ = 1.2\).

Problem 4

Suppose that 100 tags, numbered \(1, 2, . . . , 100\), are placed into an urn, and 10 tags are drawn successively, with replacement. Let A be the event that no tag is drawn twice. Show that

\[\Prob(A) = \left( 1 - \frac{1}{100} \right) \left( 1 - \frac{2}{100} \right) \left( 1 - \frac{3}{100} \right) \left( 1 - \frac{4}{100} \right) \cdots \left( 1 - \frac{9}{100} \right) = 0.6282\]

Use the approximation \(1 − x ≈ e^{−x}\) for \(x ≈ 0\) to get

\[P(A) \approx \exp \left\{ -\frac{1}{100} \left( 1 + 2 + \cdots + 9 \right) \right\} = e^{-0.45} = 0.6376\]

The law of rare events says that if

\[S_n = X_1 + X_2 + \cdots + X_n\]

where \(X_i \sim \Bernoulli(p_i)\), then let \(Y \overset{d}{=} \Poisson(\mu)\) where \(\mu = \sum_{i=1}^n p_i\), then

\[\begin{equation} | \Prob( S_n = k ) - \Prob(Y = k) | \leq \sum_{i=1}^n p_i^2 \label{eq:law of rare events} \end{equation}\]

Find

  1. The appropriate values for the parameters \(p_i\), \(n, \, k, \mu\) that correctly represents our problem.
  2. Identify $Y$ and the approximate the probability of the event $A$ you were asked to compute above using $Y$.
  3. Identify the worst-case error in the law of rare events for this particular problem.

Solution hw12-sols

Problem 1

Since \(p_k(h) = e^{-\lambda h} \frac{(\lambda h)^k}{k!}\), we have \(p_0(h) = e^{-\lambda h}\). Then

\[\lim_{h \to 0} \frac{1 - p_0(h)}{h} = \lim_{h \to 0} \frac{1 - e^{-\lambda h}}{h} = \lim_{h \to 0} \frac{\lambda e^{-\lambda h}}{1} = \lambda\] \[\lim_{h \to 0} \frac{p_1(h)}{h} = \lim_{h \to 0} \frac{e^{-\lambda h}\lambda h}{h} = \lambda\] \[\lim_{h \to 0} \frac{p_2(h)}{h} = \lim_{h \to 0} \frac{e^{-\lambda h}\lambda^2 h^2}{2!\, h} = 0\]

Problem 2

Condition on \(X(t) = k\), the number of shocks by time \(t\):

\[\begin{aligned} E[\text{survival at }t] &= E\!\left[E[\text{survival at }t \mid X(t)=k]\right] \\ &= \sum_{k=1}^{\infty} e^{-\lambda t}\frac{(\lambda t)^k}{k!}\, E[\text{survival}\mid X(t)=k] + e^{-\lambda t} \\ &= \sum_{k=1}^{\infty} \alpha^k\, e^{-\lambda t}\frac{(\lambda t)^k}{k!} + e^{-\lambda t} \\ &= e^{-\lambda t}\sum_{k=0}^{\infty} \frac{(\alpha\lambda t)^k}{k!} = e^{-\lambda t}\, e^{\alpha\lambda t} = e^{-\lambda t(1-\alpha)} \end{aligned}\]

If \(\alpha < 1\), then \(\lim_{t\to\infty} e^{-\lambda t(1-\alpha)} = 0\).

Problem 3

Note that \(np = 20 \cdot 0.06 = 40 \cdot 0.03 = 1.2\) for all three cases.

Distribution \(k\) \(P(X=k)\)
Binomial\((20, 0.06)\) 0 0.2901
  1 0.3703
  2 0.2257
Binomial\((40, 0.03)\) 0 0.2957
  1 0.3658
  2 0.2206
Poisson\((\lambda=1.2)\) 0 0.3012
  1 0.3614
  2 0.2169

Problem 4

1. Let \(X_i \sim \mathrm{Bernoulli}(i/100)\) for \(i = 1,\ldots,9\), \(S_9 = \sum_{i=1}^9 X_i\). Event \(A = \{S_9 = 0\}\), so \(k = 0\), \(n = 9\), \(\mu = \sum_{i=1}^9 \frac{i}{100} = \frac{45}{100} = 0.45\).

2. \(Y \sim \mathrm{Poisson}(0.45)\). Then \(P(Y = 0) = e^{-\mu} = e^{-45/100} \approx 0.6376\).

3. The law of rare events bound gives

\[\sum_{i=1}^9 p_i^2 = \sum_{i=1}^9 \frac{i^2}{100^2} = \frac{9\cdot 10 \cdot 19}{6 \cdot 100^2} = 0.0285\]

We verify: \(\lvert P(S_9 = 0) - P(Y=0)\rvert = \lvert 0.6282 - 0.6376\rvert = 0.009 \leq 0.0285\) ✓

HW 11 due Apr 17

Problem 1

Consider the Markov chain on \(\{0,1\}\) whose transition probability matrix is

\[\begin{bmatrix} 1 - \alpha & \alpha \\ \beta & 1 - \beta \end{bmatrix}\]
  1. Verify that \((\pi_0,\pi_1) = (\beta/(\alpha + \beta), \alpha/(\alpha + \beta))\) is a stationary distribution.

  2. Show that the first return distribution to state \(0\) is given by \(f_{00}^{(1)} = 1-\alpha\) and \(f_{00}^{(n)} = \alpha \beta (1 - \beta)^{n-2}\) for \(n=2,3,\ldots\).

  3. Calculate the mean return time \(m_0 = \sum_{n=1}^{\infty} n f_{00}^{(n)}\) and verify that \(\pi_0 = 1/m_0\).

Problem 2

Let \(\{\alpha_i \colon i=1,2,\ldots \}\) be a probability distribution, and consider the Markov chain whose transition probability matrix is

\[\begin{bmatrix} \alpha_1 & \alpha_2 & \alpha_3 & \alpha_4 & \alpha_5 & \alpha_6 & \cdots \\ 1 & 0 & 0 & 0 & 0 & 0 & \cdots \\ 0 & 1 & 0 & 0 & 0 & 0 & \cdots\\ 0 & 0 & 1 & 0 & 0 & 0 & \cdots\\ 0 & 0 & 0 & 1 & 0 & 0 & \cdots\\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \end{bmatrix}\]

What condition on the probability distribution \(\{\alpha_i \colon i=1,2,\ldots \}\) is necessary and sufficient in order that a limiting distribution exist, and what is this limiting distribution? Assume \(\alpha_1 > 0\) and \(\alpha_2 > 0\) so that chain is aperiodic.

Problem 3

Given the transition matrix

\[P = \begin{bmatrix} \frac{1}{4} & \frac{3}{4} & 0 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ 1 & 0 & 0 & 0 & 0 \\ \end{bmatrix}\]
  1. Draw a picture of the Markov chain, and determine the communication classes.

  2. Determine the period(s) of the communication class(es).

  3. Determine the limits as \(n \to \infty\) of \(P_{i0}^{(n)}\) for \(i=0,1,\ldots,4\).

Hint: Read section 4.5 of the textbook

Problem 4

A Markov chain on states 0,1,\ldots has transition probabilities

\[P_{ij} = \frac{1}{i+2} \quad \text{for } j=0,1,\ldots,i,i+1\]

Find the stationary distribution.

Problem 5

  1. Consider the reflected random walk on \(\mathbb{Z}^+\) (if you’re at state \(0\), then you go to state \(1\) with probability one), with probability \(p\) of going forward, and probability \(q\) of going backwards. If \(p > q\), determine the probability that you return to the origin.

  2. Now with \(p < q\), determine the stationary distribution. What is the mean return time to \(k\) given that you start at state \(k\)? If start in state \(i \neq k\), let \(T_{ik}\) be the first hitting time of \(k\). Determine \(E[T_{ik}]\).

hw11-sols

Problem 1

Part 1 — Stationary distribution.

\((\pi_0,\pi_1)P = (\pi_0,\pi_1)\) gives \(\pi_0(1-\alpha) + \beta\pi_1 = \pi_0\), hence \(\beta\pi_1 = \alpha\pi_0\). Together with \(\pi_0 + \pi_1 = 1\),

\[\pi_0\,\frac{\alpha+\beta}{\beta} = 1 \quad (0<\alpha<1,\;0<\beta<1) \qquad\Rightarrow\qquad \pi_0 = \frac{\beta}{\alpha+\beta},\quad \pi_1 = \frac{\alpha}{\alpha+\beta}.\]

Part 2 — First return distribution.

\[f_{00}^{(1)} = P_{00} = 1-\alpha\] \[f_{00}^{(2)} = P(X_2=0,\,X_1=1\mid X_0=0) = \alpha\beta\] \[f_{00}^{(3)} = P(X_3=0,\,X_2=1,\,X_1=1\mid X_0=0) = \alpha(1-\beta)\beta\]

By the same argument, for \(n \geq 2\):

\[f_{00}^{(n)} = \alpha\beta(1-\beta)^{n-2}\]

Part 3 — Mean return time.

\[m_0 = \sum_{n=1}^\infty n f_{00}^{(n)} = \sum_{n=2}^\infty n\,\alpha\beta(1-\beta)^{n-2} + (1-\alpha) = \frac{\alpha\beta}{1-\beta}\sum_{n=2}^\infty n(1-\beta)^{n-1} + 1-\alpha\]

Using \(S(x) = \sum_{n=1}^\infty x^n = \frac{x}{1-x}\) and \(S'(x) = \frac{1}{(1-x)^2}\), so \(\sum_{n=2}^\infty nx^{n-1} = \frac{1}{(1-x)^2}-1\), evaluated at \(x = 1-\beta\):

\[m_0 = \frac{\alpha\beta}{1-\beta}\left[\frac{1}{\beta^2}-1\right] + 1-\alpha = \frac{\alpha\beta}{1-\beta}\cdot\frac{1-\beta^2}{\beta^2} + 1-\alpha = \frac{\alpha(1+\beta)}{\beta} + 1-\alpha = \frac{\alpha+\beta}{\beta} = \frac{1}{\pi_0}\]

Problem 2

Markov chain for Problem 2

From state \(0\): self-loop with probability \(\alpha_1\), jump to state \(j\geq 1\) with probability \(\alpha_{j+1}\). From state \(k \geq 1\): go to \(k-1\) with probability \(1\).

The balance equations \(\pi P = \pi\) give, for \(i \geq 1\):

\[\pi_i - \pi_{i-1} = -\alpha_i\,\pi_0\]

Telescoping (adding from \(1\) to \(i\)):

\[\pi_i = \left(1 - \sum_{j=1}^{i}\alpha_j\right)\pi_0 \;=:\; \beta_i\,\pi_0, \qquad \beta_0 = 1.\]

Since \(P\) is stochastic, \(\sum_{i=1}^\infty\alpha_i = 1\), so \(\beta_i \to 0\). For \(\pi\) to be normalizable we need \(\sum_{i=0}^\infty\pi_i < \infty\), i.e.

\[\sum_{i=0}^\infty \beta_i < \infty.\]

Equivalent condition. Let \(X\) be a random variable with \(P(X=i) = \alpha_i\). Let \(T_0 = \min\{n\geq 1: X_n = 0\}\). From state \(0\), the chain jumps to state \(k\) (distance \(k\)) and then takes \(k\) deterministic steps back, so \(T_0 = 2k\), and

\[E[T_0\mid X_0=0] = 2E[X].\]

A stationary distribution exists if and only if \(E[T_0] < \infty\), i.e.

\[\boxed{E[X] = \sum_{i=1}^\infty i\,\alpha_i < \infty.}\]

When this holds, \(\pi_0 = 1/\!\sum_{i=0}^\infty\beta_i\) and \(\pi_i = \beta_i\pi_0\).

Problem 3

Markov chain diagram for Problem 3

The transition matrix given is (states \(0,1,2,3,4\)):

\[P = \begin{bmatrix} \frac{1}{4} & \frac{3}{4} & 0 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ 1 & 0 & 0 & 0 & 0 \end{bmatrix}\]

1. Communication classes: \(\{0,1\}\), \(\{2\}\), \(\{3\}\), \(\{4\}\).

2. Periods: \(d_0 = d_1 = 1\) (aperiodic). State 2 is absorbing; states 3 and 4 are transient — period is irrelevant.

3. Limits of \(P_{i0}^{(n)}\):

\[\lim_{n\to\infty} P_{00}^n = \pi_0 = \frac{3/4}{1/2 + 3/4} = \frac{3/4}{5/4} = \frac{3}{5} \qquad (i = 0,1,4)\]

For \(i = 3\): the chain passes through state 4 with prob \(\frac{2}{3}\) on each visit to 3 (eventually hitting \(\{0,1\}\) via state 4), so

\[\lim_{n\to\infty} P_{30}^n = \frac{2}{3}\cdot\pi_0 = \frac{2}{3}\cdot\frac{3}{5} = \frac{2}{5}\]

For \(i = 2\): state 2 is absorbing (“Hotel California”), so

\[\lim_{n\to\infty} P_{20}^n = 0\]

HW 10 due Apr 10

Problem 1

Consider the Markov Chain given by the transition matrix

\[P = \begin{bmatrix} 0 & \frac12 & 0 & \frac12 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \frac12 & 0 & 0 & \frac12 \end{bmatrix}\]

on the state space $0,1,2,3$. Recall the first return pmf $f_{ii}^{(n)}$ defined in the textbook and in our notes. Using the equation

\[P^{(n)}_{ii} = \sum_{k=0}^{n} f_{ii}^{(k)} P^{(n-k)}_{ii}\]

determine \(f^{(n)}_{00}\) for \(n = 1,2,3,4,5\).

Solution

$\textbf{n=1}:$

\[\begin{equation} f_{00}^{(1)}=P_{00}=0 \end{equation}\]

$\textbf{n=2}:$

\[\begin{equation} \begin{split} P_{00}^{(2)}&=P_{01}P_{10}+P_{03}P_{30}=\frac{1}{4}\\ P_{00}^{(2)}&=f_{00}^{(1)}P_{00}+f_{00}^{(2)}\\ \Rightarrow &=f_{00}^{(2)}=\frac{1}{4} \end{split} \end{equation}\]

$\textbf{n=3}:$

\[\begin{equation} \begin{split} P_{00}^{(3)}&=P_{01}P_{10}^{(2)}+P_{03}P_{30}^{(2)}\\ &=P_{03}(P_{30}P_{00}+P_{33}P_{30})\\ &=\frac{1}{4}\\ P_{00}^{(3)}&=f_{00}^{(1)}P_{00}^{(2)}+f_{00}^{(2)}P_{00}+f_{00}^{(3)}\\ \Rightarrow&f_{00}^{(3)}=\frac{1}{8} \end{split} \end{equation}\]

$\textbf{n=4}:$

\[\begin{equation} \begin{split} P_{00}^{(4)} &=P_{01}P_{10}^{(3)}+P_{03}P_{30}^{(3)}\\ &=P_{01}P_{12}P_{23}P_{30}+P_{03}(P_{30}P_{00}^{(2)}+P_{33}P_{30}^{(2)})\\ &=\frac{3}{8}\\ P_{00}^{(4)} &=f_{00}^{(2)}P_{00}^{(2)}+f_{00}^{(3)}P_{00}+f_{00}^{(4)}\\ \Rightarrow&f_{00}^{(4)}=\frac{5}{16} \end{split} \end{equation}\]

$\textbf{n=5}:$

\(\begin{equation} \begin{split} P_{00}^{(5)}&=P_{01}P_{10}^{(4)}+P_{03}P_{30}^{(4)}\\ &=P_{01}P_{12}P_{23}P_{33}P_{30}+P_{03}(P_{30}P_{00}^{(3)}+P_{33}P_{30}^{(3)})\\ &=\frac{7}{32}\\ P_{00}^{(5)}&=f_{00}^{(2)}P_{00}^{(3)}+f_{00}^{(3)}P_{00}^{(2)}+f_{00}^{(5)}\\ \Rightarrow&f_{00}^{(5)}=\frac{5}{32} \end{split} \end{equation}\)

Problem 2

Let \(X\) be a random variable taking values in the nonnegative integers. Show that

\[E[X] = \sum_{i=1}^{\infty} \Prob(X \geq i)\]

Solution

\(\begin{equation} \begin{split} E[X] &=\sum_{n=0}^{\infty}nP(X=n)\\ &=\sum_{n=1}^{\infty}(\sum_{i=1}^{n}1)P(X=n)\\ &=\sum_{i=1}^{\infty}\sum_{n=i}^{\infty}P(X=n)\\ &=\sum_{i=1}^{\infty}P(X\geq i) \end{split} \end{equation}\)

Problem 3

An individual either drives their car or walks in going from their home to their office in the morning, and from their office to their home in the afternoon. They use the following strategy: If it is raining in the morning, then they drive the car, provided it is at home to be taken. Similarly, if it is raining in the afternoon and their car is at the office, then they drive the car home. They walk on any morning or afternoon that it is not raining or if the car is not where they are. Assume that, independent of the past, it rains during successive mornings and afternoons with constant probability p. In the long run, on what fraction of days does our person walk in the rain? What if they own two cars?

Solution I have handwritten solutions with pictures here

Let $X_n$ = (whether you currently have access to a car, weather on previous excursion).

State space: \(S = \bigl\{(C,D),\,(C,W),\,(NC,D)\bigr\}\), where \(C\) = Car, \(NC\) = No Car, \(D\) = Dry, \(W\) = Wet.

Transition matrix (rows and columns ordered $CD,\,CW,\,NCD$):

\[P = \begin{pmatrix} 0 & p & 1-p \\ 0 & p & 1-p \\ 1-p & p & 0 \end{pmatrix}\]

You travel in the rain only when making the transition $(NC,D) \to (C,W)$, because if you currently have access to a car you will never get wet.

Fraction of days you get wet

A first attempt gives the fraction of trips (transitions) on which you get wet:

\[\begin{aligned} \frac{\text{Expected }\#\text{ wet trips}}{n} & = \frac{1}{n}\,\mathbb{E}\!\left[\sum_{i=1}^{n} \mathbf{1}_{\{X_{i-1}=NCD,\;X_i=CW\}}\right] \\ & = \frac{1}{n}\sum_{i=1}^{n} \underbrace{P(x_i=cw\mid x_{i-1}=ncd)}_{=\,p} \cdot P(x_{i-1}=ncd) \\ \end{aligned}\]

The second factor \(P(X_{i-1}=NCD)\) still depends on \(i\), so we cannot simplify immediately. But the limit theorem for Markov chains (one easily checks the chain is aperiodic) by looking at returns to state $CW$ for example) gives

\[P(X_{i-1} = NCD) \to \pi_{NCD}\]

the stationary distribution. Therefore

\[\begin{aligned} \lim_{n \to \infty} \frac{\text{Expected }\#\text{ wet trips}}{n} = p \pi_{NCD} \end{aligned}\]

Note that you cannot get wet twice consecutively: the transition $(NC,D)\to(C,W)$ can never occur twice in a row (after getting wet you have a car). Hence you get wet at most once per day. Therefore, in $n$ days,

\[\#\text{ wet trips} = \#\text{ wet days}\]

and we get

\[\begin{aligned} \lim_{n \to \infty} \frac{\text{Expected }\#\text{ wet days}}{n} = 2 p \pi_{NCD} \end{aligned}\]
This level of detail is not required — you will get points if the answer is more or less correct. The original (incorrect) answer was the fraction of trips you get wet, which is $p\,\pi_{NCD}$ (half of the correct answer).

Stationary distribution (1 car)

Solving \(\pi P = \pi\):

\[\pi_CD = (1-p) \pi_{NCD}\] \[\pi_{CW} = \pi_{cd}\,p + \pi_{ncd}\,p + \pi_{cw}\,p = p\]

Using \(\pi_{cd} + \pi_{ncd} + \pi_{cw} = 1\), we obtain

\[\Rightarrow\quad \pi_{NCD} = \frac{1-p}{2-p}\]

Therefore:

\[\mathbb{E}[\text{fraction of days you get wet}] = 2p\,\pi_{NCD} = \frac{2p(1-p)}{2-p}\]

2-car case

If 2 cars are available, the state space expands to ${NCD, 1CD, 2CD, 1CW, 2CW}$ (the number indicates how many cars the commuter currently has access to).

2-car Markov chain

Transition matrix (rows and columns ordered $NCD, 1CD, 2CD, 1CW, 2CW$):

\[P = \begin{pmatrix} 0 & 0 & 1-p & 0 & p \\ 0 & 1-p & 0 & 0 & p \\ 1-p & 0 & 0 & p & 0 \\ 0 & 1-p & 0 & 0 & p \\ 1-p & 0 & 0 & p & 0 \end{pmatrix}\]

You walk in the rain only on the transition $NCD \to 2CW$. By the same period-2 argument:

\[\mathbb{E}[\text{fraction of days wet}] = 2\,\pi_{NCD}\,p\]

Solving $\pi P = \pi$ gives:

\[\pi_{NCD} = \frac{1-p}{3-p}\]

Therefore:

\(\mathbb{E}[\text{fraction of days you get wet}] = \frac{2p(1-p)}{3-p}\)

Problem 4

  1. Show that if $i$ and $j$ communicate, then $d(i) = d(j)$.

  2. Show that a finite, irreducible, aperiodic Markov chain is recurrent.

hw10-sols

Problem 5

Problem of the points.

Blaise Pascal and Pierre Fermat discussed the problem of the points in 1654. Suppose you are your friend have contributed a sum S to a pot of money, and are playing until the first person wins $n$ rounds of a game. Assume that it is a game of chance and skill, but you and your friend are equally likely to win each round. Suppose the game stops after $r$ rounds due to an earthquake. Then, you must divide the pot $S$ fairly based on the fact that you have won $a < n$ rounds, and your friend has won $r - a < n$. Give a formula for the amount of money you should get in terms of $r, n$ and $a$.

HW 9 due Apr 03

Problem 1

Suppose $\{a_i\}$ is a sequence such that $a_i \to a$ as $i \to \infty$. Show that the Cesaro mean converges to $a$ as well:

\[\frac1n \sum_{i=1}^n a_i \to a\]

I expect an \(\epsilon-\delta\) proof

Solution Since \(a_n \to a\), for every \(\e > 0\), there is a \(N\) such that for all \(n > N\), we have

\[|a_n - a| < \e\]

So fix this \(N\) and let \(n>N\). Then,

\[\begin{equation*} \begin{split} \Bigg|\frac{1}{n}\sum_{i=1}^{n}a_{i}-a\Bigg| &=\Bigg|\frac{\sum_{i=1}^{n}a_{i}-na}{n}\Bigg|=\Bigg|\frac{\sum_{i=1}^{n}(a_{i}-a)}{n}\Bigg|\\ &\leq \frac{\sum_{i=1}^{n}\mid a_{i}-a\mid}{n}=\frac{\sum_{i=1}^{N}\mid a_{i}-a\mid+\sum_{i=N+1}^{n}\mid a_{i}-a\mid}{n}\\ &\leq \frac{\sum_{i=1}^{N}\mid a_{i}-a\mid+(n-N-1)\underset{i>N}{\sup}\mid a_{i}-a\mid}{n}\\ &\leq \frac{\sum_{i=1}^{N}\mid a_{i}-a\mid}{n}+\underset{i>N}{\sup}\mid a_{i}-a\mid :=A_{N} \end{split} \end{equation*}\]

As \(n\rightarrow\infty\), the first term goes to \(0\) in the above since \(N\) is fixed. So there is an \(N'\) such that for all \(n > N'\), we have

\[\frac{\sum_{i=1}^{N}\mid a_{i}-a\mid}{n} < \epsilon\]

Combining these two estimates, we get for \(n > \max(N',N)\),

\[\Bigg|\frac{1}{n}\sum_{i=1}^{n}a_{i}-a\Bigg| < 2 \epsilon\]

Since \(\epsilon\) was arbitrary, we are done.

Problem 2

  1. Determine the long run / limiting distribution for the Markov chain whose transition probability matrix is

    \[P = \begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \frac14 & \frac14 & \frac14 & \frac14 \\ 0 & 0 & \frac12 & \frac12 \end{pmatrix}\]

    Solution: \(\begin{equation} \begin{split} \begin{pmatrix} \pi_{0}\\ \pi_{1}\\ \pi_{2}\\ \pi_{3} \end{pmatrix} &=(\pi_{0}\,\pi_{1}\, \pi_{2}\, \pi_{3}) \begin{pmatrix} 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\\ \frac{1}{4} & \frac{1}{4} & \frac{1}{4} & \frac{1}{4}\\ 0 & 0 & \frac{1}{2} & \frac{1}{2} \end{pmatrix} \end{split} \end{equation}\)

    \(\Rightarrow \begin{pmatrix} \pi_{0}\\ \pi_{1}\\ \pi_{2}\\ \pi_{3} \end{pmatrix} =\begin{pmatrix} \frac{1}{10}\\ \frac{1}{10}\\ \frac{2}{5}\\ \frac{2}{5} \end{pmatrix}\)

  2. (4.1.11) Suppose a production process changes states according to a Markov Process whose transition probability matrix is given by

    \[P = \begin{pmatrix} 0.3 & 0.5 & 0 & 0.2 \\ 0.5 & 0.2 & 0.2 & 0.1 \\ 0.2 & 0.3 & 0.4 & 0.1 \\ 0.1 & 0.2 & 0.4 & 0.3 \end{pmatrix}\]
    1. Determine the limiting probabilities \(\pi_0\) and \(\pi_3\) given that \(\pi_1 = 119/379\) and \(\pi_2 = 81/379\)
    2. Suppose that states \(0\) and \(1\) are “in-control” while states \(2\) and \(3\) are deemed out of control. In the long run, what fraction of time is the process out of control?
    3. In the long run, what fraction of transitions are from an in-control state to an out of control state.

    Solution:

    From transition probability matrix

    \[\begin{cases} \pi_{2}=0.2\pi_{1}+0.4\pi_{2}+0.4\pi_{3}\\ \pi_{0}+\pi_{1}+\pi_{2}+\pi_{3}=1 \end{cases}\]

    $\Rightarrow \pi_{0}=\frac{117}{379}, \pi_{3}=\frac{62}{379}$

    $\pi_{2}+\pi_{3}=\frac{143}{379}$ is the fraction of time being out of control.

    \[\begin{equation} \begin{split} E&[\frac{1}{n}\sum_{k=1}^{n}1_{\{X_{k}=0, X_{k+1}=2\}}+1_{\{X_{k}=0, X_{k+1}=3\}} + 1_{\{X_{k}=1, X_{k+1}=2\}}+1_{\{X_{k}=1, X_{k+1}=3\}}]\\ =&\frac{1}{n}\sum_{k=1}^{n}\big(P\{X_{k}=0, X_{k+1}=2\}+P\{X_{k}=0, X_{k+1}=3\}+P\{X_{k}=1, X_{k+1}=2\}\\ &+P\{X_{k}=1, X_{k+1}=3\}\big) \end{split} \end{equation}\]

    Let $a_{k}=P\{X_{k}=0, X_{k+1}=2\}+P\{X_{k}=0, X_{k+1}=3\}+P\{X_{k}=1, X_{k+1}=2\}+P\{X_{k}=1, X_{k+1}=3\}$

    Then, using conditional probability, $a_{k}=p_{02}P(X_{k}=0)+p_{03}P(X_{k}=0)+p_{12}P(X_{k}=1)+p_{13}P(X_{k}=1)$

    \[\begin{equation} \underset{k\rightarrow\infty}{\lim}a_{k}=(p_{02}+p_{03})\pi_{0}+(p_{12}+p_{13})\pi_{1}=\frac{591}{3790} \end{equation}\]

    By problem 1.1, we have the answer be $\frac{591}{3790}$.

Problem 3

Consider the simple random walk with probabilities $p$ and $q = 1 - p$ of going forwards or backwards on the state space $1,2,3,4$. The states $1$ and $4$ are absorbing.

  1. What are the communication classes?
  2. What is the periodicity of each communication class?
  3. Let \(T\) be a transient class in this system. Show that \(P^{(n)}_{ij} \to 0\) for any \(ij\) in the communication class.

Solution

Classes: $\{1\}, \{2,3\}, \{4\}$.

State 1 and 4 are absorbing states. $d=1$ $\{2,3\}: d=2$.

Order the states as $1,4,2,3$ and write

\[\begin{equation} P = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ q & 0 & 0 & p \\ 0 & p & q & 0 \\ \end{pmatrix} = \begin{pmatrix} I & 0 \\ 0 & Q \\ \end{pmatrix} \end{equation}\]

where $0$ and $I$ represent the $2 \times 2$ $0$-matrix and identity matrix respectively, and

\[\begin{equation} Q= \begin{pmatrix} 0 & p\\ q & 0 \end{pmatrix} \end{equation}\]

For $n=2k$,

\[\begin{equation} Q^{(n)}= \begin{pmatrix} (pq)^{k} & 0\\ 0 & (pq)^{k} \end{pmatrix} \end{equation}\]

For $n=2k+1$,

\[\begin{equation} Q^{(n)}= \begin{pmatrix} 0 & p^{k+1}q^{k}\\ p^{k}q^{k+1} & 0 \end{pmatrix} \end{equation}\]

${2,3}$ is the transient class since $\sum_{n}P_{22}^{n}<\infty$. Take $n\rightarrow\infty$ in $Q^{(n)}$, we have the conclusion.

Problem 4

(Problem 4.3.3 from K&P)

A Markov chain on states ${0, 1, 2, 3, 4, 5}$ has transition probability matrix

(a)

\[P = \begin{pmatrix} \frac{1}{3} & 0 & \frac{2}{3} & 0 & 0 & 0 \\ 0 & \frac{1}{4} & 0 & \frac{3}{4} & 0 & 0 \\ \frac{2}{3} & 0 & \frac{1}{3} & 0 & 0 & 0 \\ 0 & \frac{1}{5} & 0 & \frac{4}{5} & 0 & 0 \\ \frac{1}{4} & \frac{1}{4} & 0 & 0 & \frac{1}{4} & \frac{1}{4} \\ \frac{1}{6} & \frac{1}{6} & \frac{1}{6} & \frac{1}{6} & \frac{1}{6} & \frac{1}{6} \end{pmatrix}\]

(b)

\[P = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & \frac{3}{4} & \frac{1}{4} & 0 & 0 & 0 \\ 0 & \frac{1}{8} & \frac{7}{8} & 0 & 0 & 0 \\ \frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{8} & \frac{3}{8} & 0 \\ \frac{1}{3} & 0 & \frac{1}{6} & \frac{1}{4} & \frac{1}{4} & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \end{pmatrix}\]

Find all communicating classes; which classes are transient and which are recurrent?

Solution

(a)

$0$ and $2$ communicate with each other and no other states so one of them is ${0, 2}$. Similarly for ${1, 3}$. States $4$ and $5$ communicate with each other as well. The communicate with other states as well but those don’t communicate back so we also get ${4, 5}$.

${0, 2}$ and ${1, 3}$ are recurrent since once you are in either class, you’ll stay there forever but ${4, 5}$ is transient since, with probability $1$, you’ll leave and never return.

(b)

${0}$ is a communicating class since once you’re there, you never leave. Similarly for ${5}$. States $1$ and $2$ communicate with each other and no other states so we have ${1, 2}$. Finally, $3$ and $4$ communicate with each other as well as other states that don’t communicate with them so we get ${3, 4}$.

This gets us ${0}$, ${1, 2}$, and ${6}$ are recurrent and ${3, 4}$ is transient.

Problem 5

Show that a finite chain that is aperiodic and irreducible is regular and recurrent. I expect a proper proof from the definitions.

Solution We need to show that there is an \(n\) such that \(P^{n}_{ij} > 0\) for all \(i,j\). Let \(S\) be our finite state space. Now for each state \(i\), we showed, since the period \(d(i) = 1\), that

\[\{1,2,3,\ldots\} \setminus \{ k \geq 1 \colon P^k_{ii} > 0 \}\]

is finite. Let \(n_{i}\) be the largest number in this finite set. Then, for \(k > n_{i}\), \(P^k_{ii} > 0\). Now do this for each state \(i\), and let \(N = \max_i n_i\). Then for \(k > N\), \(P^k_{ii} > 0\) for every \(i\). So we have that the diagonal entries of this matrix are all positive.

Fix \(i\) and \(j\). Then by irreducibility, there is an \(m_{ij}\) such that \(P^{m_{ij}}_{ij} > 0\). By the Chapman-Kolmogorov equation, for every \(k > m_{ij} + N\), we have

\[P^{k}_{ij} = \sum_{l \in S} P^{k - m_{ij}}_{il} P^{m_{ij}}_{lj} \geq P^{k - m_{ij}}_{ii} P^{m_{ij}}_{ij} > 0\]

This can be done for every pair of states \(i \neq j\), and let \(M = \max_{i \neq j} m_{ij}\). Therefore, for \(k > M + N\)

\[P^{k}_{ij} > 0 \qquad \forall i,j\]

This shows that \(P\) is regular (and some).

HW 8 due Mar 27

Problem 1

Suppose I start a chain on $N$ states with $P(X_0 = 1) = \pi_1,P(X_0 = 2) = \pi_2,\ldots$ where $\pi = (\pi_1,\ldots,\pi_N)$ is the stationary probability satisfying $\pi = \pi P$, where $P$ is a regular transition probability. What is $P(X_k = 1),P(X_k = 2),\ldots$ for fixed $k > 1$. Hint: first do the case $k=1$.

Solution We know $\pi=\pi P$.

Suppose $\forall k\leq n$,we have $\pi=\pi P^{(n)}$. Then

\[\begin{equation} \pi P^{(n+1)}=(\pi P^{(n)})P=\pi P=\pi \end{equation}\]

Thus, $\pi=\pi P^{(n)}, \forall n\in\mathbb{N}$. As initial probability is $\pi$,

\(\begin{equation} \begin{pmatrix} P(X_{k}=0)\\ P(X_{k}=1)\\ \vdots\\ P(X_{k}=N) \end{pmatrix}= \pi P^{(k)}=\pi \end{equation}\)

Problem 2

A Markov chain has transition probability

\[P = \begin{pmatrix} 0.7 & 0.2 & 0.1 \\ 0 & 0.6 & 0.4 \\ 0.5 & 0 & 0.5 \end{pmatrix}\]

Determine its limiting distribution. What proportion of time, in the long run, does it spend in each state?

Solution:

Let $\pi=(\pi_{0}, \pi_{1}, \pi_{2})$ be its limiting distribution.

\[\begin{equation} \begin{pmatrix} \pi_{0}\\ \pi_{1}\\ \pi_{2} \end{pmatrix} =(\pi_{0}, \pi_{1}, \pi_{2}) \begin{pmatrix} 0.7 & 0.2 & 0.1\\ 0 & 0.6 & 0.4\\ 0.5 & 0 & 0.5 \end{pmatrix} \end{equation}\]

\(\Rightarrow \begin{cases} \pi_{0} & = \frac{10}{21}\\ \pi_{1} & = \frac{5}{21}\\ \pi_{2} & = \frac{6}{21} \end{cases}\)

Problem 3

Consider the gambler’s ruin problem on states $0,\ldots,N$, with probability $p$ of going from state $i$ to $i+1$ and probability $q$ of going from state $i$ to $i-1$ for $i = 1,\ldots,N-1$. Fix a state $k$, where $0 < k < N$ and let $W_{ik}$ be the mean total visits to state $k$ starting from $i$ (before being absorbed into state $0$ or $N$. Formally, the definition is

\[W_{ik} = \E[ \sum_{n=0}^{T-1} 1_{X_n = k} | X_0 = i ]\]

where $1_A$ the usual indicator rv of the event $A$. Show that

\[W_{ik} = \delta_{ik} + q W_{i-1,k} + p W_{i+1,k}\]

for $i = 1,\ldots,N-1$ and $W_{0k} = W_{Nk} = 0$. $\delta_{ik}$ is $1$ if $k=i$ and $0$ otherwise.

You may try to solve the recurrence for fun!

Solution:

When $i\neq k$ and $i\neq 0$,

\[\begin{align*} W_{ik} & = \E[ \sum_{n=0}^{T-1} 1_{X_n = k} | X_0 = i ] \\ & = \E[ 1_{n_0 = k}(X_0) | X_0 = i ] + \E[ \sum_{n=1}^{T-1} 1_{X_n = k} | X_0 = i ]\\ & = \delta_{ik} + \E[ \sum_{n=1}^{T-1} 1_{X_n = k} | X_0 = i ]\\ \end{align*}\]

Using the Tower property,

\[\begin{align*} \E[ \sum_{n=1}^{T-1} 1_{X_n = k} | X_0 ] & = \E[ \E[ \sum_{n=1}^{T-1} 1_{X_n = k} | X_1,X_0 ] X_0 ] \end{align*}\] \[\begin{equation*} \begin{split} \E[ \E[ \sum_{n=1}^{T-1} 1_{X_n = k} | X_1,X_0 = i ] X_0 = i] &=\sum_{j=0}^{N}E[\sum_{n=1}^{T-1}1_{X_{n}=k}\mid X_{0}=i, X_{1}=j]P(X_{1}=j\mid X_{0}=i)\\ &=E[\sum_{n=1}^{T-1}1_{X_{n}=k}\mid X_{1}=i+1]p_{i(i+1)}+E[\sum_{n=1}^{T-1}1_{X_{n}=k}\mid X_{1}=i-1]p_{i(i-1)}\\ &=W_{(i+1)k}p+W_{(i-1)k}q \end{split} \end{equation*}\]

\(\begin{equation*} \Rightarrow W_{ik}=W_{(i+1)k}p+W_{(i-1)k}q+\delta_{ik} \end{equation*}\)

Problem 4

Determine the following limits in terms of the transition probability matrix $P$ and the limiting distribution $\pi$ of a finite-state regular (irreducible, aperiodic) Markov chain \(\{X_n\}\).

  1. \[\lim_{n \to \infty} \Prob( X_{n+1} = j | X_0 = i)\]
  2. \[\lim_{n \to \infty} \Prob( X_{n} = k, X_{n+1} = j | X_0 = i)\]
  3. \[\lim_{n \to \infty} \Prob( X_{n-1} = k, X_n = j | X_0 = i)\]

Solution

  1. \(\lim_{n \to \infty} = \lim_{n+1 \to \infty}\), so

    \[\lim_{n \to \infty} \Prob( X_{n+1} = j | X_0 = i) = \pi_j\]
  2. We have

    \[\begin{align*} \lim_{n \to \infty} \Prob( X_{n} = k, X_{n+1} = j | X_0 = i) & = \lim_{n \to \infty} \Prob( X_{n+1} = j| X_{n} = k , X_0 = i) \Prob( X_{n}=k | X_0 = i)\\ & = \lim_{n \to \infty} \Prob( X_{n+1} = j| X_{n} = k) \Prob( X_{n}=k | X_0 = i)\\ & = \lim_{n \to \infty} P_{kj} \Prob( X_{n}=k | X_0 = i)\\ & = P_{kj} \pi_k \end{align*}\]
  3. Again, making a change of variable \(t = n - 1\), we get \(\lim_{t \to \infty} \Prob( X_{t} = k, X_{t+1} = j | X_0 = i) = P_{kj} \pi_k\)

Problem 5

Consider a Markov chain with probability

\[\begin{pmatrix} p_0 & p_1 & \cdots & p_N \\ p_N & p_0 & \cdots & p_{N-1} \\ p_{N-1} & p_N & \cdots & p_{N-2} \\ \vdots & \cdots & & \vdots \\ p_{1} & p_2 & \cdots & p_{0} \\ \end{pmatrix}\]

Assume $0 < p_0 < 1$, $\sum_{i=0}^N p_i = 1$ and find the limiting distribution.

Solution

Call the Markov chain \(P\). Recall that the limiting distribution of the Markov chain (see page 92 of K&P), if it exists is

\[\lim_{n \to \infty} P^n_{ij}\]

The stationary distribution (if it exists) is the solution to

\[\pi P = \pi\]

We have seen that \(\pi\) always exists for finite Markov chains, and if the chain is aperiodic, the limiting distribution exists as well. Our chain is aperiodic since \(P_{ii} > 0\) for every \(i\). If the chain is both irreducible and aperiodic, we know

\[\lim_{n \to \infty} P^n_{ij} = \pi_j \quad \forall i,j\]

But if the chain is not irreducible, then the result has to be modified, as we shall see.

Let \(S_1, ..., S_k\) be the communicating classes. To see that we can have \(k > 1\), consider

\[P = \begin{pmatrix} 1/2 & 0 & 1/2 & 0 \\ 0 & 1/2 & 0 & 1/2 \\ 1/2 & 0 & 1/2 & 0 \\ 0 & 1/2 & 0 & 1/2 \end{pmatrix}.\]

Then, for any \(1 \leq i \neq j \leq k\), there is no path from any state in \(S_i\) to any state in \(S_j\). There is some \(m\) such that \(m = \vert S_1\vert = \vert S_2\vert = \cdots = \vert S_k\vert\). One could say it follows from “symmetry”, but it is easy to see from the structure of the matrix: if \(i\) and \(j\) communicate (\(P_{ij} = p_{j-i\mod N} > 0)\), then $i + a\mod N$ and $j + a \mod N$ also communicate for any integer $a$.

For each $i \in {1, ..,, k}$, let $P_i$ be the sub-matrix associated with the states in $S_i$. Each $P_i$ is a doubly stochastic regular matrix and, therefore, has a stationary distribution. Moreover, the stationary distribution is uniform (see section 4.1.1 of K&P) in each irreducible communication class:

\[\pi_i = \left( \frac{1}{m},\ldots,\frac{1}{m} \right)\]

Then, by the limit theorem for Markov chains, for any states \(a,b\) in the same communication class:

\[\lim_{n \to \infty} P^n_{ab} = \frac{1}{m}\]

This describes what happens to every row of the matrix:

\(\lim_{n \to \infty} P^n_{ij} = \begin{cases} \frac1m & i \leftrightarrow j \\ 0 & i \not\leftrightarrow j \\ \end{cases}\)

HW 7 due Mar 20

Problem 1

A Markov chain has the transition probability matrix

\[P = \begin{pmatrix} 0.3 & 0.2 & 0.5 \\ 0.5 & 0.1 & 0.4 \\ 0 & 0 & 1 \\ \end{pmatrix}\]

with states labeled \(\{0,1,2\}\). It starts in state \(X_0 = 0\). Eventually, the process will end up in state 2. What is the probability that the time \(T = \min\{n ≥ 0; X_n = 2\}\) is an odd number?

Solution

For $i \in {1, 2}$ let $u_i = P[T \text{ is odd } | X_o = i]$ and $v_i = P[T \text{ is even } | X_o = i]$ which mean that

\[u_i + v_i = 1 \Leftrightarrow v_i = 1 - u_i.\]

So, we can get the system of equations

\[u_0 = 0.5 + 0.3 v_0 + 0.2 v_1\] \[u_1 = 0.4 + 0.5 v_0 + 0.1 v_1.\]

Substituting in $v_i = 1 - u_i$ we get that

\[u_0 = 0.5 + 0.3 (1- u_0) + 0.2 (1 - u_1)\] \[u_1 = 0.4 + 0.5 (1- u_0) + 0.1 (1 - u_1)\]

which gives us

\[1.3 u_0 + 0.2 u_1= 1\] \[0.5u_0 + 1.1u_1 = 1\]

which we can solve to get $u_0 \approx 0.67669$ and $u_1 \approx 0.6015$ making the answer $\approx 0.67669$.

Problem 2

In a Markov chain, let \(S = \{1,\ldots,N\}\) and suppose \(\emptyset \neq A \subset S\) is the set of absorbing states. Consider \(T\) the absorption time \(T = \inf \{ k \geq 0 \colon X_k \in A \}\). Assume

\[P( T < \infty | X_0 = i) = 1 \quad \forall i \not\in A\]

We can prove this later, but we will have to make assumptions about the reachability of the absorbing states. Otherwise, we could be in a situation where from some state \(k\), it is just not possible to get absorbed and thus \(v_k = \infty\).

We are going to prove the equation we derived in class more rigorously. For all \(i \not\in A\)

\[v_i = E[ T | X_0 = i ] = 1 + \sum_{k \not\in A}v_k p_{ik}\]

where \(p_{ij} = P(X_{k+1} = j \vert X_k = i)\). In matrix form, this is the equation \(\vec{v} = \vec{1} + Q \vec{v}\).

  1. Fix \(i \not\in A\). Show

    \[\begin{equation} v_i = \sum_{j=1}^\infty j P(T = j | X_0 = i) = \sum_{j=1}^\infty \sum_{k \in S} j P(T = j | X_1 = k) p_{ik} \label{eq:hw7 p2 1} \end{equation}\]
  2. Show that for \(j = 1\), \(P(T = 1 \vert X_1 = k) = 1\) if \(k \in A\) and \(0\) otherwise.

  3. Show that for $j > 1$, if $k \not\in A$

    \[\begin{align} P(T = j | X_1 = k) & = P(X_2 \not\in A, \ldots, X_{j-1} \not\in A, X_j \in A | X_1 = k) \nonumber \\ & = P(T = j-1 | X_0 = k) \label{eq:hw7 p2 2} \end{align}\]

    This lies at the heart of the proof, and the second equality should be shown using the Markov property and time homogeneity.

  4. Substitute the result of \(\ref{eq:hw7 p2 2}\) into \(\ref{eq:hw7 p2 1}\) and show

    \[v_i = \sum_{k \not\in A} \sum_{j=1}^\infty (j+1) P(T = j | X_0 = k) p_{ik} + \sum_{k \in A} p_{ik},\]

    and use this to complete the proof.

Solution

Part 1

We get the first equality from the definition of conditional expectation and the fact that zero times anything is zero (so we can start the summation at one). For the second, we use the law of total probability to see that

\[\begin{align} P(T = j \| X_0 = i) &= \sum_{k \in S} P(T = j \| X_0 = i, X_1 = k)P(X_1 =k \| X_0 = i) \\ &= \sum_{k \in S} P(T = j \| X_1 = k) p_{ik} \end{align}\]

where, in the last line, we’ve used the Markov property. If you substitute this in, you get the desired result.

Part 2

We note that $T = j$ means that (1) $X_j \in A$ and (2) $X_i \notin A$ for all $i < j$. For $j = 1$, since we are assuming that $X_0 \notin A$ (by definition of $v_i$), the second condition is satisfied automatically for $j = 1$. This means that $T = 1 \Leftrightarrow X_1 \in A$ i.e. $P(T = 1 | X_1 = k) = 1$ for $k \in A$ and $0$ otherwise.

Part 3

Again, by definition, $T = j$ means that (1) $X_j \in A$ and (2) $X_i \notin A$ for all $i < j$. This means that

\[\begin{align} P(T = j \| X_1 = k) & = P(X_0 \notin A, X_1 \notin A, \ldots, X_{j - 1} \notin A, X_j \in A \| X_1 = k) \\ & = P(X_2 \notin A, \ldots, X_{j - 1} \notin A, X_j \in A \| X_1 = k) \\ & = P(X_1 \notin A, \ldots, X_{j - 2} \notin A, X_{j - 1} \in A \| X_0 = k) \\ & = P(T = j - 1 \| X_0 = k). \end{align}\]

In the first line we use the definition of $T = j | X_1 = k$. In the second line, we use the fact that since $A$ is the set of absorbing states, $X_1 \notin A$ means that $X_0 \notin A$ automatically. In the third line, we use time homogeneity and, in the fourth line we use the definition of $T = j - 1 | X_0 = k$.

Part 4

Plugging this in we get

\[\begin{align} v_i &= \sum_{j = 1}^{\infty} \sum_{k \in S} jP(T = j \| X_1 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{j = 2}^{\infty} \sum_{k \in S} jP(T = j \| X_1 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{j = 2}^{\infty} \sum_{k \notin A} jP(T = j \| X_1 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{k \notin A} \sum_{j = 2}^{\infty} jP(T = j \| X_1 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{k \notin A} \sum_{j = 1}^{\infty} (j + 1)P(T = j \| X_0 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{k \notin A} \sum_{j = 1}^{\infty} j P(T = j \| X_0 = k) p_{ik} + \sum_{k \notin A} \sum_{j = 1}^{\infty} P(T = j \| X_0 = k) p_{ik} \\ &= \sum_{k \in A} p_{ik} + \sum_{k \notin A} p_{ik} \sum_{j = 1}^{\infty} j P(T = j \| X_0 = k) + \sum_{k \notin A} p_{ik} P(T < \infty \| X_0 = k) \\ &= \sum_{k \in A} p_{ik} + \sum_{k \notin A} p_{ik} + \sum_{k \notin A} p_{ik} v_k \\ &= 1 + \sum_{k \notin A} p_{ik} v_k. \end{align}\]

We use the fact that \(P(T < \infty \\vert X_0 = k) = 1\) and

\[\sum_{k \in A} p_{ik} + \sum_{k \notin A} p_{ik} = 1.\]

Problem 3

An urn contains five tags, of which three are red and two are green. A tag is randomly selected from the urn and replaced with a tag of the opposite color. This continues until only tags of a single color remain in the urn. Let \(X_n\) denote the number of red tags in the urn after the nth draw, with \(X_0 = 3\). What is the probability that the game ends with the urn containing only red tags?

Solution

We count the number of red tags at each time so $X_n \in {0, 1, 2, 3, 4, 5}$. The associated matrix is

  0 1 2 3 4 5
0 1 0 0 0 0 0
1 1/5 0 4/5 0 0 0
2 0 2/5 0 3/5 0 0
3 0 0 3/5 0 2/5 0
4 0 0 0 4/5 0 1/5
5 0 0 0 0 0 1

Let $u_i = P(X_T = 5 | X_0 = i)$ for $i = 1, 2, 3, 4$ and so we have the vector

\[\vec{u} = \begin{pmatrix} u_1 \\ u_2 \\ u_3 \\ u_4\end{pmatrix} = (I - Q)^{-1}\begin{pmatrix} 0 \\ 0 \\ 0 \\ 1/5\end{pmatrix}\]

where

\[Q = \begin{pmatrix} 0 & 4/5 & 0 & 0 \\ 2/5 & 0 & 3/5 & 0 \\ 0 & 3/5 & 0 & 2/5 \\ 0 & 0 & 4/5 & 0\end{pmatrix}\]

which gets us (using a calculator)

\[\vec{u} = \begin{pmatrix} 0.375 \\ 0.46875 \\ 0.53125 \\ 0.625\end{pmatrix}\]

which makes the answer \(0.53125\).

Problem 4

  1. Consider the two state Markov chain with \(p_{01} = a\) and \(p_{10} = b\), where \(a,b \in (0,1)\). Let \(P\) be its transition matrix. Show (by induction) that

    \[P^n = \frac{1}{a+b} \begin{pmatrix} b & a \\ b & a \\ \end{pmatrix} + \frac{(1-a-b)^n}{a + b} \begin{pmatrix} a & -a \\ -b & b \\ \end{pmatrix}\]
  2. Determine \(P^n\) for \(n=2,3,4,5\) whose transition probability matrix is

    \[P = \begin{pmatrix} 0.4 & 0.6 \\ 0.7 & 0.3 \\ \end{pmatrix}\]

    Also determine \(\lim_{n \to \infty} P^n\).

Solution We have that

\[P = \begin{pmatrix} 1 - a & a \\ b & 1 - b \end{pmatrix} = \frac{1}{a + b} \begin{pmatrix} b & a \\ b & a \end{pmatrix} + \frac{1 - a - b}{a + b} \begin{pmatrix} a & -a \\ -b & b \end{pmatrix}\]

which you can check directly. This gives us the base case, $n = 1$.

Assume this is true for $n$. So we take

\[\begin{align} P^{n + 1} & = P P^n \\ &=\begin{pmatrix} 1-a & a \\ b & 1-b \end{pmatrix} \left[ \frac{1}{a+b} \begin{pmatrix} b & a \\ b & a \end{pmatrix} + \frac{(1-a-b)^n}{a+b} \begin{pmatrix} a & -a \\ -b & b \end{pmatrix} \right] \\ &= \frac{1}{a+b} \begin{pmatrix} 1-a & a \\ b & 1-b \end{pmatrix} \begin{pmatrix} b & a \\ b & a \end{pmatrix} + \frac{(1-a-b)^n}{a+b} \begin{pmatrix} 1-a & a \\ b & 1-b \end{pmatrix} \begin{pmatrix} a & -a \\ -b & b \end{pmatrix} \\ &= \frac{1}{a+b} \begin{pmatrix} b & a \\ b & a \end{pmatrix} + \frac{(1-a-b)^n}{a+b} (1-a-b) \begin{pmatrix} a & -a \\ -b & b \end{pmatrix} \\ &= \frac{1}{a+b} \begin{pmatrix} b & a \\ b & a \end{pmatrix} + \frac{(1-a-b)^{n+1}}{a+b} \begin{pmatrix} a & -a \\ -b & b \end{pmatrix}. \end{align}\]
Part 2
\[P^2 = \begin{pmatrix} 0.7 & 0.6 \\ 0.7 & 0.6 \end{pmatrix} + 0.06923077 \begin{pmatrix} 0.6 & -0.6 \\ -0.7 & 0.7 \end{pmatrix} = \begin{pmatrix} 0.74153846 & 0.55846154 \\ 0.65153846 & 0.64846154 \end{pmatrix}\] \[P^3 = \begin{pmatrix} 0.7 & 0.6 \\ 0.7 & 0.6 \end{pmatrix} - 0.02076923 \begin{pmatrix} 0.6 & -0.6 \\ -0.7 & 0.7 \end{pmatrix} = \begin{pmatrix} 0.68753846 & 0.61246154 \\ 0.71453846 & 0.58546154 \end{pmatrix}\] \[P^4 = \begin{pmatrix} 0.7 & 0.6 \\ 0.7 & 0.6 \end{pmatrix} + 0.00623077 \begin{pmatrix} 0.6 & -0.6 \\ -0.7 & 0.7 \end{pmatrix} = \begin{pmatrix} 0.70373846 & 0.59626154 \\ 0.69563846 & 0.60436154 \end{pmatrix}\] \[P^5 = \begin{pmatrix} 0.7 & 0.6 \\ 0.7 & 0.6 \end{pmatrix} - 0.00186923 \begin{pmatrix} 0.6 & -0.6 \\ -0.7 & 0.7 \end{pmatrix} = \begin{pmatrix} 0.69887846 & 0.60112154 \\ 0.70130846 & 0.59869154 \end{pmatrix}\]

The second term goes to zero (since \(\vert 1 - a - b\vert < 1\)) and so, in general, we get

\[\lim_{n \to \infty} P^n = \frac{1}{a+b} \begin{pmatrix} b & a \\ b & a \end{pmatrix}\]

which, in our case, is

\(\frac{1}{1.3} \begin{pmatrix} 0.7 & 0.6 \\ 0.7 & 0.6 \end{pmatrix}.\)

HW 6 due Mar 6

Problem 1 (Karlin and Pinsky, 4th ed, 3.1.12)

An MC has transition probability matrix

\[P = \begin{pmatrix} 0.7 & 0.2 & 0.1 \\ 0.0 & 0.6 & 0.4 \\ 0.5 & 0.0 & 0.5 \end{pmatrix}\]

Find

  1. $\Prob(X_2 = 1, X_1 = 1 | X_0 = 0)$
  2. If the initial probability vector is $(\Prob(X_0 = 0), \Prob(X_0 = 1), \Prob(X_0 = 2)) = (\frac12,\frac13,\frac16)$, find $\Prob(X_2 = 1, X_1 = 1, X_0 = 0)$
  3. Find the vector $(\Prob(X_2 = 0), \Prob(X_2 = 1), \Prob(X_2 = 2))$ using matrix multiplication (and the same initial probability vector from the previous part).

Solution

\[\begin{equation} \begin{split} P(X_{2}=1, X_{1}=1\mid X_{0}=0) &=\frac{P(X_{2}=1, X_{1}=1, X_{0}=0)}{P(X_{0}=0)}\\ &=\frac{P(X_{2}=1 \mid X_{1}=1, X_{0}=0)P(X_{1}=1, X_{0}=0)}{P(X_{0}=0)}\\ &=\frac{P(X_{2}=1 \mid X_{1}=1)P(X_{1}=1 \mid X_{0}=0)P(X_{0}=0)}{P(X_{0}=0)}\\ &=P(X_{2}=1 \mid X_{1}=1)P(X_{1}=1 \mid X_{0}=0)\\ &=\frac{3}{5}\times\frac{1}{5}\\ &=\frac{3}{25} \end{split} \end{equation}\] \[\begin{equation} \begin{split} P(X_{2}=1, X_{1}=1, X_{0}=0) &=P(X_{2}=1, X_{1}=1\mid X_{0}=0)P(X_{0}=0)\\ &=\frac{3}{25}\times \frac{1}{2}\\ &=\frac{3}{50} \end{split} \end{equation}\]

\(\begin{equation} \begin{pmatrix} P(X_{2}=0)\\ P(X_{2}=1)\\ P(X_{2}=2) \end{pmatrix} =P^{2}\times \begin{pmatrix} \frac{1}{2}\\ \frac{1}{3}\\ \frac{1}{6} \end{pmatrix} = \begin{pmatrix} \frac{131}{300}\\ \frac{4}{15}\\ \frac{89}{300} \end{pmatrix} \end{equation}\)

Problem 2

(3.1.1 from K and P) A simplified model for the spread of a disease (Covid-19) goes this way: The total population size is $N=5$, of which some are diseased (have the disease) and some are healthy. The selection is such that an encounter between any one pair of individuals is just as likely between any other pair. At any time instance, let us assume that only one pair of individuals (randomly, uniformly selected) may meet. If one of these individuals is diseased and the other is not, then the disease is transmitted from the diseased to the healthy with probability $\alpha = 0.1$. Otherwise, no disease transmission takes place. Let $X_n$ denote the number of diseased persons in the population at the end of the nth period. Specify the transition probability of this Markov chain.

Solution

At some instant in time, say there are $k$ infected individuals. There are $\binom{5}{2}$ many pairs, and one among these is uniformly selected. For there to be $k+1$ infected individuals, an infected and an uninfected individual must meet, and disease transfer must happen (probability $\alpha$). Thus the probability of going from $k$ to $k+1$ individuals is for ($k = 1,2,3,4$)

\[\begin{equation} \begin{split} &P(X_{n+1}=k+1 \mid X_{n}=k) = \frac{\binom{k}{1}\binom{5-k}{1}}{\binom{5}{2}} \alpha = \frac{k(5-k)}{10}\cdot\alpha \\ &P(X_{n+1}=k \mid X_{n}=k)=1-\frac{k(5-k)}{100} \end{split} \end{equation}\]

Transition matrix is

\(\begin{equation} \begin{pmatrix} 1&0&0&0&0&0\\ 0 & \frac{24}{25} & \frac{1}{25} & 0 & 0 & 0\\ 0 & 0 & \frac{47}{50} & \frac{3}{50} & 0 & 0 \\ 0 & 0 & 0 & \frac{47}{50} & \frac{3}{50} & 0 \\ 0 & 0 & 0 & 0 & \frac{24}{25} & \frac{1}{25} \\ 0 & 0 & 0 & 0 & 0 & 1 \end{pmatrix} \end{equation}\)

Problem 3

(3.4.4 from K and P) A coin is tossed repeatedly until two successive heads appear. Find the mean number of tosses required.

  1. Define a Markov chain (let \(X_n\) be the MC that represents the current number of successive heads that have appeared) and find its transition matrix.
  2. Condition on the first-step and compute the mean number of tosses required.

Solution The state space is 0,1,2 and the transition probability matrix is

\[P = \left[ \begin{matrix} \frac12 & \frac12 & 0 \\ \frac12 & 0 & \frac12 \\ \frac12 & \frac12 & 1 \end{matrix} \right]\]

Let $T=\inf\{n: X_{n}=2\}$ and $g_{i}=E[T \mid X_{0}=i]$

\[\begin{equation} g_{0}=1+\frac{1}{2}g_{0}+\frac{1}{2}g_{1},\qquad g_{1}=1+\frac{1}{2}g_{0} \end{equation}\]

$\Rightarrow g_{0}=6$.

Problem 4

  1. A red die is rolled a single time. A green die is rolled repeatedly. The game stops at the first roll where the sum of the two dice is either 4 or 7. What is the probability that the game stops with a sum of 4?

  2. Suppose the craps dice are shaved on faces 1-6 such that the pmf of a single die is

    \[\begin{align*} p(2) & = p(3) = p(4) = p(5) = 1/6 - \e\\ p(1) & = p(6) = 1/6 + 2\e \end{align*}\]

    where \(\e = 0.02\). Find the win probability using the method described in class (see also KP, section 2.2).

HW 5 Due Wed Feb 27

Problem 1

  1. Let \(X\) have a Poisson distribution with parameter \(λ > 0\). Suppose $λ$ itself is random, following an exponential density with parameter θ.

    1. What is the marginal distribution of X?
    2. Determine the conditional density for λ given X = k.
  2. Recall Polya’s Urn. An Urn contains a red balls and b green balls to start with. A ball is drawn at random and it is returned to the urn along with another ball of the same color. Let \(X_n\) be the fraction of red balls.

    1. Show that \(X_n\) is a martingale.
    2. Simulate \(X_n\) and draw graphs of its various realizations for different values of \(a\) and \(b\).
    3. Show, numerically, that \(X_n\) converges to some random number \(X_\infty\). Draw pictures of the distribution of \(X_\infty\) for different initial data \(a\) and \(b\).
  3. Let \(\{\xi_i\}\) be iid \(\Bernoulli(p)\) rvs for \(0 < p < 1\). Let \(X_0 = 1\) and \(X_n = p^{-n} \prod_{i=1}^n \xi_i\). Show that $X_n$ defines a martingale, and determine the limit of $X_n$ as $X_n \to \infty$.

Problem 2

  1. Suppose $X$, $Y$ and $Z$ are discrete random variables with a joint pmf \(p(u,v,w)\). Show that

    \[\E[ \E[X|Y,Z] | Z ] = \E[X | Z]\]

    Hint: Start with the definition \(\E[X|Y=y,Z=z] = \sum_x x\, p_{X|Y,Z}(x|y,z)\) where

    \[p_{X|Y,Z}(x|y,z) = \frac{p_{X,Y,Z}(x,y,z)}{p_{Y,Z}(y,z)}\]
  2. If \(X_n\) is a martingale, compute \(\E[X_n]\) in terms of \(\E[X_1]\). Hint: Start with \(n=2\)

Problem 3

  1. A Markov chain \(X_0, X_1, \ldots\) on states \(0,1,2\) has the transition probability matrix

    \[P = \begin{pmatrix} 0.1 & 0.2 & 0.7 \\ 0.9 & 0.1 & 0 \\ 0.1 & 0.8 & 0.1 \end{pmatrix}\]

    and initial distribution \(p_0 = \Pr\{X_0 = 0\} = 0.3, \quad p_1 = \Pr\{X_0 = 1\} = 0.4, \quad p_2 = \Pr\{X_0 = 2\} = 0.3.\)

    Determine \(\Pr\{X_0 = 0, X_1 = 1, X_2 = 2\}\).

  2. A Markov chain $X_0, X_1, X_2, \ldots$ has the transition probability matrix

\[P = \begin{pmatrix} 0.7 & 0.2 & 0.1 \\ 0 & 0.6 & 0.4 \\ 0.5 & 0 & 0.5 \end{pmatrix}.\]

Determine the conditional probabilities \(\Pr\{X_2 = 1, X_3 = 1 \mid X_1 = 0\} \quad \text{and} \quad \Pr\{X_1 = 1, X_2 = 1 \mid X_0 = 0\}.\)

HW 4 Due Fri Feb 20

Problem 1

  1. Suppose $N$ is a geometric random variable taking values in $0,1,\ldots$ with parameter $p$. (By inspecting the range of $N$, we see that $N$ is in fact, a shifted geometric random variable that represents the number of failures before the first success.) Let

    \[X = \sum_{i=1}^N \xi_i\]

    where ${\xi_i}$ are iid random variables independent of $N$, and $X = 0$ if $N = 0$. Find the cdf of $X$. Hint be mindful of the $N=0$ case. Assume that $\xi_i$ are iid $\Exponential(1)$. Simplify your answers as much as possible.

    Solution:

    Let $f$ be the density function of $\xi_{i}$. Then

    \[f(z)= \begin{cases} e^{-z} & z\geq 0\\ 0 & z<0 \end{cases}\]

    We know that a sum of independent exponentials produces a Gamma distribution (see page 30, section 1.4.4 in Karlin and Pinsky 4th edition). Then, the density of

    \[X_k = \sum_{i=1}^k \xi_i\]

    is

    \[f_k(z)= \begin{cases} \frac{1}{(k-1)!} z^{k-1} e^{-z} & z\geq 0\\ 0 & z<0 \end{cases}\]

    Let us find the cdf of $X$.

    \[\begin{align*} P(X \leq t) & = \sum_{k=0}^{\infty} P(X \leq t| N = k) \Prob(N = k)\\ & = \sum_{k=0}^{\infty} P\left( \sum_{i=1}^k \xi_i \leq t| N = k \right) p(1-p)^{k}\\ & = P\left( 0 \leq t | N = 0 \right) p + \sum_{k=1}^{\infty} P\left( X_k \leq t | N = k \right) p(1-p)^{k} \end{align*}\]

    Now we have to divide the cases up into $t \geq 0$ and $t < 0$ since when $N = 0$, we have $X = 0$.

    \[P\left( X \leq t | N = 0 \right) = \begin{cases} 0 & t < 0 \\ 1 & t \geq 0 \\ \end{cases}\]

    Thus, the only interesting case is when $t \geq 0$; we have

    \[\begin{align*} F_X(t) & = p + \sum_{k=1}^{\infty} \int_0^{t} \frac{1}{(k-1)!} z^{k-1} e^{-z} dz \quad p(1-p)^{k} \\ & = p + p (1-p) \int_0^{t} \sum_{k=1}^{\infty} \frac{1}{(k-1)!} (z(1-p))^{k-1} e^{-z} dz \\ & = p + p (1-p) \int_0^{t} e^{z(1-p)} e^{-z} dz \\ & = p + p (1-p) \int_0^{t} e^{-p z)} dz \\ & = p + (1-p)(1 - e^{-pt }) \\ & = 1 - (1-p) e^{-pt } \end{align*}\]

    Putting this together, we get

    \(F_X(t) = \begin{cases} 0 & t < 0 \\ 1 - (1-p) e^{-pt } & t \geq 0 \\ \end{cases}\)

  2. Suppose that three contestants on a quiz show are each given the same question and that each answers it correctly, independently of the others with probability $p$. But the difficulty of the question is itself a random variable. So suppose that $p$ is $\Uniform(0,1)$. What is the probability that exactly two of the contestants answer correctly?

    Solution:

    Let $X$ be the number of contestants answering question correctly.

    \(\begin{equation} \begin{split} P(X=2) &=\int_{0}^{1}P(X=2\mid p=u)f_p(u) du\\ &=\int_{0}^{1}\binom{3}{2}u^{2}(1-u)du\\ &=\frac{1}{4} \end{split} \end{equation}\)

  3. Let $X_0,X_1,\ldots$ be iid nonnegative random variables having a pdf. Let $N$ be the first index $k$ for which $X_k > X_0$. $N = 1$ if $X_1 > X_0$, $N=2$ if $X_1 \leq X_0, X_2 > X_0$ and so on. Find the pmf for $N$ and the mean $\E[N]$. (Interpretation: $X_0$, $X_1$ are bids on the car you are trying to sell. $N$ is the index of the first bid that is better than the initial bid.)

    Solution:

    Let $f$ and $F$ be pdf and cdf of $X_{i}$ resp.

    \[\begin{equation} \begin{split} P(N & = 1) = P(X_{i}\leq X_{0}) \\ &=\int_{0}^{\infty}dx_{i}\int_{x_{i}}^{\infty}dx_{0}f(x_{i})f(x_{0})\\ &=\int_{0}^{\infty}dx_{i}f(x_{i})(1-F(x_{i}))\\ &=1-\frac{1}{2}F(x_{i})^{2}\biggr\rvert_{0}^{\infty}\\ &=\frac{1}{2} \end{split} \end{equation}\]

    Before we tackle the general $k \geq 2$ case, we define the tail of $X_0$ as $T(t) = 1 - F(t)$, and hence $dT = T’(t)dt = -f(t)dt$.

    \[\begin{equation} \begin{split} P(N & = k) = P(X_{1}\leq X_{0}, \cdots, X_{k-1} \leq X_0, X_k > X_0) \\ &=\int_{0}^{\infty} P(X_{1}\leq t , \cdots, X_{k-1} \leq t , X_k > t|X_0 = t) f(t) dt\\ &=\int_{0}^{\infty} F^{k-1}(t) T(t) f(t) dt\\ & = \int_0^{\infty} F^{k-1} (1 - F) f dt \\ & = \int_0^{\infty} F^{k-1} f - \int_0^{\infty} F^{k} f dt \\ & := I_k - I_{k-1} \\ \end{split} \end{equation}\]

    where we have used the last line to define the integral $I_k$. Now we evaluate the integral $I_k$ for $k \geq 2$ using integration by parts (when in doubt…).

    \[\begin{align*} I_k & = \int_0^{\infty} F^{k-1} f dt \\ & = - \int_0^{\infty} F^{k-1} T'(t) dt \\ & = - F^{k-1} T(t) \big|_{0}^{\infty} + \int_0^{\infty} (k-1)F^{k-2} T dt \\ & = \int_0^{\infty} (k-1)F^{k-2} (1-F) dt \\ & = (k-1)\int_0^{\infty} F^{k-2} dt - (k-1)\int_0^{\infty} F^{k-1} dt \\ & = (k-1) I_{k-1} - (k-1)I_{k} dt \end{align*}\]

    and therefore moving the $(k-1)T_k$ to the LHS of the above equation

    \[\begin{align*} I_k & = \frac{(k-1)}{k} I_{k-1} \\ & = \frac{(k-1)}{k} \frac{k-2}{k-1} I_{k-2} \\ & = \frac{(k-1)}{k} \frac{k-2}{k-1} \cdots I_{1} \\ & = \frac{1}{k} \\ \end{align*}\]

    where we have used $I_1 = 1$. Thus

    \[\begin{align*} \Prob(N = k) & = \frac{1}{k} - \frac{1}{(k+1)}\\ & = \frac{1}{k(k+1)} \quad k \geq 2 \end{align*}\]

    Then,

    \(\begin{equation} \begin{split} E[N] &=\sum_{k=1}^{\infty}kP(N=k)\\ &= \frac12 + \sum_{k=2}^{\infty} \frac{1}{k+1} &= \infty \end{split} \end{equation}\)

Problem 2

  1. Suppose $X_1,X_2,X_3$ are discrete random variables. Show that

    \[\E[ X_1 + X_2 + X_3 | X_2, X_3 ] = X_2 + X_3 + \E[X_1 | X_2,X_3]\]

    Solution:

    \[\begin{equation} \begin{split} E[X_{1}+X_{2}+X_{3}\mid X_{2}, X_{3}] &=E[X_{1}\mid X_{2},X_{3}]+E[X_{2}\mid X_{2},X_{3}]+E[X_{3}\mid X_{2},X_{3}]\\ &=X_{2}+X_{3}+E[X_{1}\mid X_{2},X_{3}] \end{split} \end{equation}\]

    We could also do this the following way for discrete $X_1,X_2$ and $X_3$. The conditional expectation is a FUNCTION of the values of $X_2,X_3$. So

    \[\begin{align*} \E[ X_1 + X_2 + X_3 | X_2 = a_2,X_3 = a_3] & = \sum_{a_1} (a_1 + a_2 + a_3) p_{X_1|X_2,X_3}(a_1 | a_2,a_3)\\ & = \sum_{a_1} (a_1 + a_2 + a_3) \frac{p_{X_1,X_2,X_3}(a_1 , a_2,a_3)}{p_{X_2,X_3}(a_2,a_3)}\\ & = \sum_{a_1} a_1 \frac{p_{X_1,X_2,X_3}(a_1 , a_2,a_3)}{p_{X_2,X_3}(a_2,a_3)} \\ & \qquad + \sum_{a_1} (a_2 + a_3) \frac{p_{X_1,X_2,X_3}(a_1 , a_2,a_3)}{p_{X_2,X_3}(a_2,a_3)}\\ & = \E[ X_1 | X_2 = a_2,X_3 = a_3] + a_2 + a_3 \end{align*}\]

    using the law of total probability in the last equation.

Problem 3

Conditional dependence and independence.

  1. Draw \(P\) uniformly randomly from \([0,1]\) and then draw two independent samples \(X_1\) and \(X_2\) with \(\Bernoulli(P)\) distribution. Compute the (unconditional) correlation coefficient of \(X_1\) and \(X_2\).

  2. Let \(N\) have a Poisson distribution with parameter \(\lambda > 0\). Suppose that, conditioned on \(N\), we draw a random variable \(X \sim \Binomial(N,p)\). Let \(Y = N - X\). Show that \(X\) and \(Y\) have Poisson distributions with parameters \(\lambda p\) and \((1 - p) \lambda\) and that \(X\) and \(Y\) are independent.

  3. Let \(X\) and \(Y\) be jointly distributed random variables whose joint probability mass function is given in the following table:

\[\begin{array}{c|ccc} & X=-1 & X=0 & X=1 \\ \hline Y=-1 & \dfrac{1}{9} & \dfrac{2}{9} & 0 \\[6pt] Y=0 & 0 & \dfrac{1}{9} & \dfrac{2}{9} \\[6pt] Y=1 & \dfrac{2}{9} & 0 & \dfrac{1}{9} \end{array}\]

Show that the covariance between \(X\) and \(Y\) is zero even though \(X\) and \(Y\) are not independent.

HW 3 Due Fri Feb 13

Problem 1: Conditional probability redux.

Let $A_0, A_1, \ldots, A_n$ be events of non-zero probability.

Show that \(\Prob\left(\bigcap_{i=0}^n A_i \right) = \Prob(A_0) \Prob(A_1 | A_0) \cdots \Prob(A_n | A_{n-1} \ldots A_0 )\)

Solution: Equation is true when $n=0$. Suppose equation is true for $n\leq m$. Then as $n=m+1$

\[\begin{equation} \begin{split} P\big(\cap_{i=0}^{m+1}A_{i}\big) &=P\big(\cap_{i=0}^{m}A_{i}\cap A_{m+1}\big)\\ &=P\big(A_{m+1}\mid\cap_{i=0}^{m}A_{i}\big)\times P\big(\cap_{i=0}^{m}A_{i}\big)\\ &=P\big(A_{m+1}\mid\cap_{i=0}^{m}A_{i}\big)\times\dots\times P(A_{0}) \end{split} \end{equation}\]

Problem 2

  1. Suppose $U$ has uniform distribution in $[0,1]$. Derive the density function for the random variables

    1. $Y = \log(1-U)$
    2. $W_n = U^n$ for $n \geq 1$

    Refer to section 1.2.6 in your textbook.

    Solution: 1. As $U\sim \Uniform[0,1]$, range of $Y$ is [-$\infty$,0]. Given $t\leq 0$,

    \[\begin{equation} \begin{split} F_{Y}(t) &=P(Y\leq t)=P(\log(1-U)\leq t)\\ &=P(1-U\leq e^{t})=P(1-e^{t}\leq U)\\ &=e^{t} \end{split} \end{equation}\]

    So $f_{Y}(t)=e^{t}$ for $t\in[-\infty,0]$ and zero elsewhere.

    2. Range of $W_{n}$ is $[0,1]$. Given $t\in[0,1]$, \begin{equation} \begin{split} P(W_{n}\leq t) &=P(U^{n}\leq t)
    &=P(U\leq t^{1/n})
    &=t^{\frac{1}{n}} \end{split} \end{equation} So $f_{W_{n}}(t)=\frac{1}{n}t^{\frac{1}{n}-1}$ for $t\in[0,1]$ and zero elsewhere.

  2. If $X \sim \Exponential(2)$ and $Y \sim \Exponential(3)$ are independent, find $\Prob(X < Y)$.

    Solution: \(\begin{equation} \begin{split} P(X<Y) &=\int_{0}^{\infty}\int_{x}^{\infty}2e^{-2x}3e^{-3y}dydx &=\int_{0}^{\infty}2e^{-2x}\int_{x}^{\infty}3e^{-3y}dydx &=\frac{2}{5} \end{split} \end{equation}\)

Problem 3

  1. A quarter is tossed repeatedly until a head appears. Let $N$ be the trial number when this head appears. Then, a dollar is tossed $N$ times. Let $X$ count the number of times the dollar comes up tails. Determine $P(X = 0)$, $P(X = 1)$ and $\E[X]$.

    Solution:

    \[\begin{equation} \begin{split} P(X=0) &=\sum_{n=1}^{\infty}P(N=n, \text{no tails}) \\ &=\sum_{n=1}^{\infty}\big(\frac{1}{2}\big)^{n}\binom{n}{0}\big(\frac{1}{2}\big)^{n} \\ &= \frac{1}{4} \sum_{n=0}^{\infty}\big(\frac{1}{4}\big)^{n} \\ &= \frac{1}{4} \frac{1}{1-1/4} \end{split} \end{equation}\] \[\begin{equation} \begin{split} P(X=1) &=\sum_{n=1}^{\infty}P(N=n, \text{one tail})\\ &=\sum_{n=1}^{\infty}\big(\frac{1}{2}\big)^{n}\binom{n}{1}\big(\frac{1}{2}\big)^{n}\\ &=\sum_{n=0}^{\infty}\frac{n}{4^{n}} \end{split} \end{equation}\]

    Let $S=P(X=1)$, then

    \[\begin{equation} S-\frac{1}{4}S=\sum_{n=0}^{\infty}\big(\frac{1}{4}\big)^{n}=\frac{1}{3} \end{equation}\]

    So $S=P(X=1)=\frac{4}{9}$. The way to see this in general is by defining

    \[\begin{align} S(p) & = \sum_{n=0}^{\infty} p^n = \frac{1}{1-p} \\ S'(p) & = \sum_{n=0}^{\infty} n p^{n-1} = \frac{1}{(1-p)^2}\\ p S'(p) & = \sum_{n=0}^{\infty} n p^n = \frac{p}{(1-p)^2} \end{align}\]

    and then substituting $p=1/4$.

    \[\begin{equation} \begin{split} E[X] &=\sum_{k=0}^{\infty}kP(X=k)=\sum_{k=0}^{\infty}\sum_{n=1}^{\infty}P(X=k\mid N=n)P(N=n)\\ &=\sum_{n=1}^{\infty}\sum_{k=0}^{\infty}k\binom{n}{k}\big(\frac{1}{2}\big)^{n}P(N=n)\\ &=\sum_{n=1}^{\infty}P(N=n)\sum_{k=0}^{\infty}k\binom{n}{k}\big(\frac{1}{2}\big)^{n}\\ &=\sum_{n=1}^{\infty}\frac{n}{2}P(X=n)=\frac{1}{2}\sum_{n=1}^{\infty}nP(N=n)\\ &= \frac12 E[N] = 1 \end{split} \end{equation}\]

    since $N$ is geometric taking values in ${1,\ldots,}$ and wikipedia says $E[N] = 1/p$.

    In the above we used that if $Z \sim \Binomial(n,p)$ then

    \[\E[Z] = \sum_{k=0}^n k \binom{n}{k} p^{n-k} (1-p)^k = n p\]

    with $p = 1/2$.

  2. Let $N$ have Poisson distribution with parameters $\lambda = 1$. Conditioned on $N = n$, let $X$ have a uniform distribution over the integers $0,1,\ldots,n+1$. What is the marginal distribution for $X$?

    Solution

    \[\begin{equation} \begin{split} P(X=t) &=\sum_{n=0}^{\infty}P(X=t\mid N=n)P(N=n)\\ &=e^{-1}\sum_{n=0}^{\infty}\frac{1}{n+2}\frac{1}{n!}=e^{-1} \sum_{n=t-1}^{\infty}\frac{n+1}{(n+2)!}\\ &=e^{-1}\sum_{n=t+1}^{\infty}\frac{n-1}{n}=e^{-1}\sum_{n=t+1}^{\infty}\frac{n-1}{n!}\\ &=e^{-1}\sum_{n=t+1}^{\infty}\frac{1}{(n-1)!}-e^{-1}\sum_{n=t+1}^{\infty}\frac{1}{n!}\\ &=\frac{e^{-1}}{t!} \end{split} \end{equation}\]

Problem 4

Do men have more sisters than women have? In a certain society, all married couples use the following strategy to determine the number of children that they will have: If the first child is a girl, they have no more children. If the first child is a boy, they have a second child. If the second child is a girl, they have no more children. If the second child is a boy, they have exactly one additional child. (We ignore twins, assume sexes are equally likely, and the sex of distinct children are independent random variables, etc.)

  1. What is the probability distribution for the number of children in a family?
  2. What is the probability distribution for the number of girl children in a family?
  3. A male child is chosen at random from all of the male children in the population. What is the probability distribution for the number of sisters of this child?
  4. What is the probability distribution for the number of brothers of the previously chosen male child?

Solution

The probabilities for families are (1) \(P(G) = 1/2\), (2) \(P(BG) = 1/4\), (3) \(P(BBG) = 1/8\), and (4) \(P(BBB) = 1/8\). We can use this to answer all the questions.

  1. Let \(N\) be the number of kids.

    \[P(N = k) = \begin{cases} 1/2 & k = 1 \\ 1/4 & k = 2 \\ 1/4 & k = 3 \\ 0 & \text{otherwise} \end{cases}\]
  2. Let $G$ be the number of girls

    \[P(G = k) = \begin{cases} 7/8 & k = 1 \\ 1/8 & k = 0 \\ 0 & \text{otherwise} \end{cases}\]
  3. In the total population, type 2 families contribute 1 boy, type 3 contribute 2 and type 3 contribute 3. So if you choose a male child at random, the probability that he is from a type 1, type 2 and type 3 family are respectively

    \[P( X \text{ is type } i) = \begin{cases} \frac{1/4}{1/4 + 2/8 + 3/8} = \frac{2}{7} & i=2 \\ \frac{2/8}{1/4 + 2/8 + 3/8} = \frac{2}{7} & i=3 \\ \frac{3/8}{1/4 + 2/8 + 3/8} = \frac{3}{7} & i=4 \\ \end{cases}\]

    where we have weighted each family by the number of boys they have produced.

    Maybe this doesn’t convince the more rigorously minded (as it shouldn’t). Think of the next generation being as determined by \(M\) families that are currently reproducing. Each child they produce is labeled with their gender and their type. Let \(X_{i,j}\) be the number of individuals of type \(j\) being produced by family \(i\). By the law of large numbers

    \[\lim_{M \to \infty} \frac{1}{M} \sum_{i=1}^M X_{i,j} = E[ X_{i,j} ] = \begin{cases} \frac{1}{4} & j = 2 \\ \frac{2}{8} & j = 3 \\ \frac{3}{8} & j = 4 \end{cases}\]

    If \(B_i\) is the number of boys being produced by family $i$, then

    \[B_i = X_{i,2} + X_{i,3} + X_{i,4}\]

    The fraction of boys in the population satisfies

    \[\lim_{M \to \infty} \frac{1}{M} \sum_{i=1}^M B_i = E[ B_1 ] = \frac{7}{8}\]

    Then, for example, if you choose a boy at random, the probability that the boy comes from a type 2 family is

    \[\frac{\text{# of type 2 boys}}{\text{# of boys}} \approx \frac{M 1/4}{M 7/8} \to \frac{2}{7}\]

    as we obtained above.

    Let \(S\) be the number of sisters, and clearly \(S \in \{0,1\}\). Then

    \[P(S = 0) = P(X \text{ is type } 4) = \frac{3}{7}\]

    and

    \[P(S = 1) = P(X \text{ is type 2 or 3} ) = \frac{4}{7}\]
  4. Let \(R\) be the number of brothers so \(R \in \{0, 1, 2\}\) depending on if it’s a type (2), (3), or (4) family. Similar to what we did for part 3,

    \[P(R = k) = \begin{cases} 2/7 & k = 0 \\ 2/7 & k = 1 \\ 3/7 & k = 2 \\ 0 & \text{otherwise} \end{cases}.\]
  5. As a bonus question, choose a random individual from the population. What is the probability that they are male?

    Let \(X\) be the random child selected from the population. We want to find the probability that this child is a boy. There are a few ways to understand it.

    a. In each family, we’ve assumed that both sexes are equally likely. \(P(G) = P(B) = 1/2\). So each time a child is added to the population, there is an equal chance it is a boy or a girl. So the proportion of the number of boys or the number of girls must be half, and hence \(P(X \text{ is a boy}) = 1/2\).

    b. Think of the next generation being as determined by $M$ families that are currently reproducing. Let $B_i$ be the number of boys family $i$ produces and let $G_i$ be the number of girls. Then $B_i + G_i$ has the same distribution as $N$ listed above. The total number of boys produced by the $M$ families satisfies

    \[\lim_{M \to \infty} \sum_{i=1}^M B_i = E[ B_1 ] = \frac{7}{8}\]

    And similarly,

    \[\lim_{M \to \infty} \sum_{i=1}^M G_i = E[ G_1 ] = \frac{1}{2} + \frac{1}{4} + \frac{1}{8} = \frac{7}{8}.\]

    Therefore, the proportion of boys, as \(M \to \infty\) is

    \[\frac{7/8}{7/8 + 7/8} = \frac{1}{2}\]

    Interesting, huh?

HW 2 Due Fri Feb 6

  1. Let $N$ cards carry the distinct numbers $x_1,\ldots,x_N$. If two cards are drawn at random without replacement, show that the correlation coefficient $\rho$ between the numbers appearing on the two cards in $-1/(N-1)$.

    Solution

    Let $X,Y$ be the number on the first and second cards respectively.

    \[\begin{equation} \begin{split} P(X=x_{n}) &=\frac{1}{N}\\ P(Y=x_{n}) &=P(X=x_{n}, Y=x_{n})+P(X\neq x_{n}, Y=x_{n})=P(X\neq x_{n}, Y=x_{n})\\ & =P(Y=x_{n}\mid X\neq x_{n})\times P(X\neq x_{n}) =\frac{1}{N-1}\times \frac{N-1}{N}\\ &=\frac{1}{N} \end{split} \end{equation}\]

    So we know $E[X]=E[Y]$ and $E[X^{2}]=E[Y^{2}]$. Let

    \[\begin{equation} T=\sum_{n=1}^{N}x_{n} \quad \text{ and } \quad S=\sum_{n=1}^{N}x_{n}^{2} \end{equation}\]

    Then

    \[\begin{equation} \begin{split} E[X]&=E[Y]=\sum_{n=1}^{N}x_{n}P(X=x_{n})=\frac{T}{N}\\ E[X^{2}]&=E[Y^{2}]=\sum_{n=1}^{N}x_{n}^{2}P(X=x_{n})=\frac{S}{N} \end{split} \end{equation}\]

    We know $\rho$ is the correlation coefficient of $X,Y$, the formula of $\rho$ is

    \[\begin{equation} \rho=\frac{\Cov(X,Y)}{\sigma_{X}\sigma_{Y}} =\frac{\E[XY]-\E[X]\E[Y]}{\sigma_{X}\sigma_{Y}} \end{equation}\]

    Also we know

    \[\begin{equation} \sigma_{X}=(\E[X^{2}]-(\E[X])^{2})^{\frac{1}{2}}=(\frac{S}{N}-\frac{T^{2}}{N^{2}})^{\frac{1}{2}}=\sigma_{Y} \end{equation}\]

    There is only $\E[XY]$ left to compute.

    \[\begin{equation} \begin{split} \E[XY] &=\sum_{n=1}^{N}x_{n}\sum_{m\neq n}x_{m}P(X=x_{n}, Y=x_{m})\\ &=\sum_{n=1}^{N}x_{n}(T-x_{n})\frac{1}{N-1}\frac{1}{N}\\ &=\frac{T^{2}}{N(N-1)}-\frac{S}{N(N-1)} \end{split} \end{equation}\]

    Bring those formulas back to $\rho$, we have

    \(\begin{equation} \rho=-\frac{1}{N-1} \end{equation}\)

  2. Let $X$ and $Y$ be independent random variables having distribution $F_x$ and $F_y$ respectively.

    • Let $Z = \max(X,Y)$. Express $F_Z(t)$ in terms of $F_X(s)$ and $F_Y(u)$.
    • Let $W = \min(X,Y)$. Express $F_W(t)$ in terms of $F_X(s)$ and $F_Y(u)$.

    Solution

    Since $X,Y$ are independent,

    \[\begin{equation} \begin{split} F_{Z}(t) &=P(Z\leq t)\\ &=P(\max(X,Y)\leq t)\\ &=P(X\leq t, Y\leq t)\\ &=P(X\leq t)P(Y\leq t)\\ &=F_{X}(t)F_{Y}(t)\\ \end{split} \end{equation}\]

    since if $\max(X,Y) \leq t$ then both $X \leq t$ and $Y \leq t$.

    \(\begin{equation} \begin{split} F_{W}(t)&=P(W\leq t)\\ &=1-P(W>t)\\ &=1-P(\min(X,Y)>t)\\ &=1-P(X>t, Y>t)\\ &=1-P(X>t)P(Y>t)\\ &=1-(1-P(X\leq t))(1-P(Y\leq t))\\ &=1-(1-F_{X}(t))(1-F_{Y}(t))\\ &=F_{X}(t)+F_{Y}(t)-F_{X}(t)F_{Y}(t) \end{split} \end{equation}\)

  3. Let $U$ be Poisson distributed with parameter $\lambda$ and let $V = 1/(1+U)$. Find the expected value of $V$.

    Solution

    \[U\sim\Poisson(\lambda), \qquad P(U=k)=\frac{\lambda^{k}e^{-\lambda}}{k!}\]

    \(\begin{equation} \begin{split} \E[V] &=\sum_{k=0}^{\infty}\frac{1}{1+k} P(U=k) \\ &=\sum_{k=0}^{\infty}\frac{1}{1+k}\frac{\lambda^{k}e^{-\lambda}}{k!}\\ &=e^{-\lambda}\sum_{k=0}^{\infty}\frac{1}{1+k}\frac{\lambda^{k}}{k!}\\ &=e^{-\lambda}\sum_{k=0}^{\infty}\frac{\lambda^{k}}{(k+1)!}\\ &=\frac{e^{-\lambda}}{\lambda}\sum_{k=0}^{\infty}\frac{\lambda^{k+1}}{(k+1)!}\\ &=\frac{e^{-\lambda}}{\lambda}\sum_{n=1}^{\infty}\frac{\lambda^{k}}{k!}\\ &=\frac{e^{-\lambda}}{\lambda}(e^{\lambda}-1)\\ &=\frac{1-e^{-\lambda}}{\lambda} \end{split} \end{equation}\)

  4. Let $U,V,W$ be independent random variables with equal variances $\sigma^2$. Let $X = U + V$ and let $Y = V - W$. Find the covariance of $X$ and $Y$.

    Solution

    As $U,V,W$ are independent,

    \[\begin{equation} \begin{split} \Cov(X,Y) &=\E[XY]-\E[X]\E[Y]\\ &=\E[(U+V)(V-W)]-\E[U+V]\E[V-W]\\ &=\E[UV+V^{2}-UW-VW]-(\E[U]\E[V]+(\E[V])^{2}-\E[U]\E[W]-\E[V]\E[W])\\ &=\E[V^{2}]-(\E[V])^{2}\\ &=\Var(V)\\ &=\sigma^{2} \end{split} \end{equation}\]

    Another way to do this is to write

    \(\begin{align} \Cov(X,Y) & = \Cov(U,V) - \Cov(U,W) + \Cov(V,V) \\ & \qquad + \Cov(U,V) - \Cov(U,W) + \Cov(V,V) + \Cov(V,W) \\ & = 0 - 0 + \Var(V) + 0 \\ & = \sigma^2 \end{align}\)

HW 1 Due Fri Jan 30

Homework will be a little long this week, since it is mostly review.

  1. Which topics about stochastic processes most interest you? (E.g. Brownian motion, stock market modeling, statistical physics, etc.)

  2. Given that you end up working as hard as you think you can work this semester, what grade do think you can achieve in this class? How important is the letter grade to you?

  3. Would you prefer a challenging class at a good pace so you can learn a lot, or do you prefer an easy-paced class so you can learn the material well?

  4. Of the three general principles for modeling probabilities stated in K&P chapter 1, in your opinion, which one applies best to the modeling of share prices in the stock market?

  5. Plot the distribution function

    \[F(x) = \begin{cases} 0 & x \leq 0\\ x^3 & 0 < x < 1\\ 1 & x \geq 1 \end{cases}\]
    • Determine the corresponding density function $f(x)$ in the three regions.
    • What is the mean of the distribution?
    • If $X$ is a random variable with distribution $F$, then evaluate $\mathbb{P}(1/4 \leq X \leq 3/4)$.

    Solution: The density function is

    \[f(x)= \begin{cases} 3x^{2} & 0<x<1 \\ 0 & \text{otherwise} \end{cases}\] \[\begin{equation*} E(X)=\int_{0}^{1}xf(x)dx=\frac{3}{4} \end{equation*}\]

    \(\begin{equation*} P(\frac{1}{4}\leq X \leq \frac{3}{4})=F(\frac{3}{4})-F(\frac{1}{4})=\frac{13}{32} \end{equation*}\)

  6. Determine the distribution function, mean and variance corresponding to the triangular density

    \(f(x) = \begin{cases} x & 0 \leq x \leq 1,\\ 2 - x & 1 \leq x \leq 2 \\ 0 & \text{otherwise} \end{cases}\)

    Solution

    \[F(x)= \begin{cases} 0 & x<0 \\ \frac{1}{2}x^{2} & 0\leq x \leq1 \\ -\frac{1}{2}x^{2}+2x-1 & 1<x\leq 2 \\ 1 & x>2 \end{cases}\] \[\begin{equation*} E[X]=1 \end{equation*}\]

    \(\begin{equation*} \text{Var}(X)=\frac{1}{6} \end{equation*}\)

  7. Let $1_{A}$ be the indicator random variable associated with an event $A$, defined to be one if $A$ occurs, and zero otherwise. Show

    • $1_{A^c} = 1 - 1_{A}$
    • $1_{A \cap B} = 1_{A} 1_{B} = \min( 1_{A}, 1_{B} )$
    • $1_{A \cup B} = \max( 1_{A}, 1_{B} )$.

    Solution:

    If $\omega \in A^{c}$, then

    \[\begin{equation*} 1_{A^{c}}(\omega)=1=1-1_{A}(\omega) \end{equation*}\]

    If $\omega \in A$, then

    \[\begin{equation*} 1_{A}(\omega)=1=1-1_{A^{c}}(\omega) \end{equation*}\]

    So $1_{A^{c}}=1-1_{A}$

    If $\omega\in A\cap B$, then

    \[\begin{equation*} 1_{A\cap B}(\omega)=1=1_{A}1_{B}(\omega) \end{equation*}\]

    If $\omega \notin A\cap B$, then $\omega$ is either in $X-(A\cup B)$, $A-B$ or $B-A$, we have

    \[\begin{equation*} 1_{A\cap B}(\omega)=0=1_{A}1_{B}(\omega) \end{equation*}\]

    So

    \[1\_{A\cap B}=1_{A}1_{B}\]

    Note that $\min(1_{A},1_{B})$ has only two possible values ${1,0}$.

    \[\begin{equation*} \min(1_{A},1_{B})(\omega)=1 \Longleftrightarrow 1_{A}(\omega)=1=1_{B}(\omega) \Longleftrightarrow \omega\in A\cap B \end{equation*}\]

    So

    \[\begin{equation*} 1_{A\cap B}=1_{A}1_{B}=\min(1_{A},1_{B}) \end{equation*}\]

    Note that $\max(1_{A},1_{B})$ has only two possible values ${1,0}$.

    \(\begin{equation*} \omega\in A\cup B\Longleftrightarrow 1_{A}(\omega)=1\text{ or }1_{B}(\omega)=1 \Longleftrightarrow \max(1_{A},1_{B})(\omega)=1 \end{equation*}\)

  8. A pair of dice is tossed. If the two outcomes are equal, the dice are tossed again, and the process is repeated. If the dice is unequal, their sum is recorded. Determine the probability mass function for the sum.

    Solution:

    There are only 30 possible outcomes. Among 30 outcomes, there are 2 outcomes of having 3, 4, 10 and 11 as their sum. 4 outcomes of having 5,6,8 and 9 as sum. And 6 outcomes of having 7 as sum.
    Define $X$= sum of two dice. Then sample space is ${3,4,5,6,7,8,9,10,11}$ And we have the following probability

    \(\begin{equation*} \begin{split} P(X=3) &=P(X=4)=P(X=10)=P(X=11)=\frac{1}{15}\\ P(X=5) &=P(X=6)=P(X=8)=P(X=9)=\frac{2}{15}\\ P(X=7) &=\frac{3}{15} \end{split} \end{equation*}\)