Markov Chains
1. **Markov Chain Problem 1: Two Products A and B**
Problem: Given initial proportions and switching probabilities, find:
a) Transition matrix
b) Proportions after two months
c) Long-run proportions
Formula: Transition matrix $P$ with entries $p_{ij}$ where $p_{ij}$ is probability of moving from state $i$ to $j$.
Rules: Rows sum to 1.
Step 1: Define states: A and B.
Step 2: Given:
- 30% of A switch to B, so $P_{A\to B} = 0.3$, $P_{A\to A} = 0.7$
- Of B users, 25% stay, so $P_{B\to B} = 0.25$, and 75% switch to A, $P_{B\to A} = 0.75$
Transition matrix:
$$P = \begin{bmatrix}0.7 & 0.3 \\ 0.75 & 0.25\end{bmatrix}$$
Step 3: Initial distribution vector:
$$\pi_0 = \begin{bmatrix}0.4 & 0.6\end{bmatrix}$$
Step 4: After one month:
$$\pi_1 = \pi_0 P = \begin{bmatrix}0.4 & 0.6\end{bmatrix} \begin{bmatrix}0.7 & 0.3 \\ 0.75 & 0.25\end{bmatrix} = \begin{bmatrix}0.4\times0.7 + 0.6\times0.75 & 0.4\times0.3 + 0.6\times0.25\end{bmatrix} = \begin{bmatrix}0.28 + 0.45 & 0.12 + 0.15\end{bmatrix} = \begin{bmatrix}0.73 & 0.27\end{bmatrix}$$
Step 5: After two months:
$$\pi_2 = \pi_1 P = \begin{bmatrix}0.73 & 0.27\end{bmatrix} \begin{bmatrix}0.7 & 0.3 \\ 0.75 & 0.25\end{bmatrix} = \begin{bmatrix}0.73\times0.7 + 0.27\times0.75 & 0.73\times0.3 + 0.27\times0.25\end{bmatrix} = \begin{bmatrix}0.511 + 0.2025 & 0.219 + 0.0675\end{bmatrix} = \begin{bmatrix}0.7135 & 0.2865\end{bmatrix}$$
Step 6: Long-run distribution $\pi$ satisfies $\pi P = \pi$ and $\pi_1 + \pi_2 = 1$.
Solve:
$$\pi = [x, 1-x], \quad [x, 1-x] \begin{bmatrix}0.7 & 0.3 \\ 0.75 & 0.25\end{bmatrix} = [x, 1-x]$$
Equations:
$$0.7x + 0.75(1-x) = x$$
$$0.3x + 0.25(1-x) = 1 - x$$
From first:
$$0.7x + 0.75 - 0.75x = x \Rightarrow 0.75 - 0.05x = x \Rightarrow 0.75 = 1.05x \Rightarrow x = \frac{0.75}{1.05} = \frac{5}{7} \approx 0.7143$$
So long-run distribution:
$$\pi = \begin{bmatrix}0.7143 & 0.2857\end{bmatrix}$$
---
2. **Markov Chain Problem 2: Customer Categories L, A, C**
States: Loyal (L), At-Risk (A), Churned (C)
Transition matrix $P$:
$$P = \begin{bmatrix}0.8 & 0.15 & 0.05 \\ 0.3 & 0.6 & 0.1 \\ 0 & 0 & 1\end{bmatrix}$$
Step 1: Probability At-Risk customer eventually churns is absorption probability into state C starting from A.
Step 2: Partition states into transient $T = \{L,A\}$ and absorbing $C$.
Step 3: Submatrix $Q$ for transient states:
$$Q = \begin{bmatrix}0.8 & 0.15 \\ 0.3 & 0.6\end{bmatrix}$$
Step 4: Submatrix $R$ for transitions to absorbing state:
$$R = \begin{bmatrix}0.05 \\ 0.1\end{bmatrix}$$
Step 5: Fundamental matrix:
$$N = (I - Q)^{-1}$$
Calculate:
$$I - Q = \begin{bmatrix}0.2 & -0.15 \\ -0.3 & 0.4\end{bmatrix}$$
Determinant:
$$0.2 \times 0.4 - (-0.15) \times (-0.3) = 0.08 - 0.045 = 0.035$$
Inverse:
$$N = \frac{1}{0.035} \begin{bmatrix}0.4 & 0.15 \\ 0.3 & 0.2\end{bmatrix} = \begin{bmatrix}11.43 & 4.29 \\ 8.57 & 5.71\end{bmatrix}$$
Step 6: Absorption probabilities:
$$B = N R = \begin{bmatrix}11.43 & 4.29 \\ 8.57 & 5.71\end{bmatrix} \begin{bmatrix}0.05 \\ 0.1\end{bmatrix} = \begin{bmatrix}11.43\times0.05 + 4.29\times0.1 \\ 8.57\times0.05 + 5.71\times0.1\end{bmatrix} = \begin{bmatrix}0.5715 + 0.429 \\ 0.4285 + 0.571\end{bmatrix} = \begin{bmatrix}1.0005 \\ 0.9995\end{bmatrix}$$
Probability At-Risk customer eventually churns is approximately $1$.
Step 7: Steady-state distribution $\pi$ satisfies $\pi P = \pi$ and $\sum \pi_i = 1$.
Solve:
$$\pi = [\pi_L, \pi_A, \pi_C]$$
Equations:
$$\pi_L = 0.8\pi_L + 0.3\pi_A$$
$$\pi_A = 0.15\pi_L + 0.6\pi_A$$
$$\pi_C = 0.05\pi_L + 0.1\pi_A + \pi_C$$
From last:
$$\pi_C = 0.05\pi_L + 0.1\pi_A + \pi_C \Rightarrow 0 = 0.05\pi_L + 0.1\pi_A$$
So $\pi_L = \pi_A = 0$ and $\pi_C = 1$.
Long-run all customers churn.
---
3. **Markov Chain Problem 3: Economy States B, N, R**
Transition matrix:
$$P = \begin{bmatrix}0.7 & 0.2 & 0.1 \\ 0.3 & 0.6 & 0.1 \\ 0.1 & 0.4 & 0.5\end{bmatrix}$$
Step 1: Probability economy in Normal (N) will be in Boom (B) after two years:
Initial vector:
$$\pi_0 = [0,1,0]$$
Step 2: After one year:
$$\pi_1 = \pi_0 P = [0,1,0] \begin{bmatrix}0.7 & 0.2 & 0.1 \\ 0.3 & 0.6 & 0.1 \\ 0.1 & 0.4 & 0.5\end{bmatrix} = [0.3, 0.6, 0.1]$$
Step 3: After two years:
$$\pi_2 = \pi_1 P = [0.3, 0.6, 0.1] P$$
Calculate:
$$\pi_2 = [0.3\times0.7 + 0.6\times0.3 + 0.1\times0.1, 0.3\times0.2 + 0.6\times0.6 + 0.1\times0.4, 0.3\times0.1 + 0.6\times0.1 + 0.1\times0.5]$$
$$= [0.21 + 0.18 + 0.01, 0.06 + 0.36 + 0.04, 0.03 + 0.06 + 0.05] = [0.4, 0.46, 0.14]$$
Probability economy in Normal will be in Boom after two years is $0.4$.
---
4. **Markov Chain Problem 4: Employee Levels J, M, S**
Transition matrix:
$$P = \begin{bmatrix}0.7 & 0.2 & 0.1 \\ 0 & 0.5 & 0.4 \\ 0 & 0 & 0.8\end{bmatrix}$$
Note: Leaving or retiring is absorbing outside states, so rows sum to less than 1.
Step 1: Probability Junior employee eventually reaches Senior level.
Transient states: J, M
Absorbing: Left or retired (not in matrix)
Step 2: Submatrix for transient states:
$$Q = \begin{bmatrix}0.7 & 0.2 \\ 0 & 0.5\end{bmatrix}$$
Step 3: Transition to Senior (absorbing for this question):
$$R = \begin{bmatrix}0.1 \\ 0.4\end{bmatrix}$$
Step 4: Fundamental matrix:
$$N = (I - Q)^{-1} = \begin{bmatrix}1-0.7 & -0.2 \\ 0 & 1-0.5\end{bmatrix}^{-1} = \begin{bmatrix}0.3 & -0.2 \\ 0 & 0.5\end{bmatrix}^{-1}$$
Determinant:
$$0.3 \times 0.5 - 0 = 0.15$$
Inverse:
$$N = \frac{1}{0.15} \begin{bmatrix}0.5 & 0.2 \\ 0 & 0.3\end{bmatrix} = \begin{bmatrix}3.33 & 1.33 \\ 0 & 2\end{bmatrix}$$
Step 5: Probability of eventually reaching Senior from Junior:
$$B = N R = \begin{bmatrix}3.33 & 1.33 \\ 0 & 2\end{bmatrix} \begin{bmatrix}0.1 \\ 0.4\end{bmatrix} = \begin{bmatrix}3.33\times0.1 + 1.33\times0.4 \\ 0 + 2\times0.4\end{bmatrix} = \begin{bmatrix}0.333 + 0.533 \\ 0.8\end{bmatrix} = \begin{bmatrix}0.866 \\ 0.8\end{bmatrix}$$
Probability Junior employee eventually reaches Senior is approximately $0.866$.
---
5. **Markov Chain Problem 5: Warehouse Inventory Levels H, M, L**
Transition matrix:
$$P = \begin{bmatrix}0.6 & 0.3 & 0.1 \\ 0.2 & 0.5 & 0.3 \\ 0.1 & 0.5 & 0.4\end{bmatrix}$$
Step 1: Starting at Medium stock:
$$\pi_0 = [0,1,0]$$
Step 2: After one month:
$$\pi_1 = \pi_0 P = [0,1,0] \begin{bmatrix}0.6 & 0.3 & 0.1 \\ 0.2 & 0.5 & 0.3 \\ 0.1 & 0.5 & 0.4\end{bmatrix} = [0.2, 0.5, 0.3]$$
Step 3: After two months:
$$\pi_2 = \pi_1 P = [0.2, 0.5, 0.3] P$$
Calculate:
$$\pi_2 = [0.2\times0.6 + 0.5\times0.2 + 0.3\times0.1, 0.2\times0.3 + 0.5\times0.5 + 0.3\times0.5, 0.2\times0.1 + 0.5\times0.3 + 0.3\times0.4]$$
$$= [0.12 + 0.1 + 0.03, 0.06 + 0.25 + 0.15, 0.02 + 0.15 + 0.12] = [0.25, 0.46, 0.29]$$
Probability of Low stock after two months is $0.29$.
---
6. **Input-Output Analysis Problem 6: Manufacturing and Agriculture**
Given:
$$Z = \begin{bmatrix}500 & 800 \\ 700 & 1000\end{bmatrix}, \quad D = \begin{bmatrix}350 \\ 200\end{bmatrix}$$
Step 1: Technological coefficient matrix $A$:
$$A_{ij} = \frac{Z_{ij}}{x_j}$$
Assuming gross output vector $x = \begin{bmatrix}x_M \\ x_A\end{bmatrix}$ unknown.
Step 2: Leontief matrix:
$$L = (I - A)^{-1}$$
Step 3: Given final demand changes:
$$D' = \begin{bmatrix}600 \\ 200 \times 1.2 = 240\end{bmatrix} = \begin{bmatrix}600 \\ 240\end{bmatrix}$$
Step 4: Calculate $A$ using original outputs:
Total output $x$ satisfies:
$$x = Z e + D$$
where $e$ is vector of ones.
Calculate original $x$:
$$x_M = 500 + 800 + 350 = 1650$$
$$x_A = 700 + 1000 + 200 = 1900$$
Step 5: Calculate $A$:
$$A = \begin{bmatrix}500/1650 & 800/1900 \\ 700/1650 & 1000/1900\end{bmatrix} = \begin{bmatrix}0.3030 & 0.4211 \\ 0.4242 & 0.5263\end{bmatrix}$$
Step 6: Calculate $I - A$:
$$I - A = \begin{bmatrix}1-0.3030 & -0.4211 \\ -0.4242 & 1-0.5263\end{bmatrix} = \begin{bmatrix}0.6970 & -0.4211 \\ -0.4242 & 0.4737\end{bmatrix}$$
Step 7: Calculate determinant:
$$det = 0.6970 \times 0.4737 - (-0.4211) \times (-0.4242) = 0.3301 - 0.1787 = 0.1514$$
Step 8: Calculate $L = (I - A)^{-1}$:
$$L = \frac{1}{0.1514} \begin{bmatrix}0.4737 & 0.4211 \\ 0.4242 & 0.6970\end{bmatrix} = \begin{bmatrix}3.13 & 2.78 \\ 2.80 & 4.60\end{bmatrix}$$
Step 9: Calculate new gross output:
$$x' = L D' = \begin{bmatrix}3.13 & 2.78 \\ 2.80 & 4.60\end{bmatrix} \begin{bmatrix}600 \\ 240\end{bmatrix} = \begin{bmatrix}3.13\times600 + 2.78\times240 \\ 2.80\times600 + 4.60\times240\end{bmatrix} = \begin{bmatrix}1878 + 667.2 \\ 1680 + 1104\end{bmatrix} = \begin{bmatrix}2545.2 \\ 2784\end{bmatrix}$$
---
Final answers summarized:
1a) $P = \begin{bmatrix}0.7 & 0.3 \\ 0.75 & 0.25\end{bmatrix}$
1b) After two months: $[0.7135, 0.2865]$
1c) Long-run: $[0.7143, 0.2857]$
2a) $P = \begin{bmatrix}0.8 & 0.15 & 0.05 \\ 0.3 & 0.6 & 0.1 \\ 0 & 0 & 1\end{bmatrix}$
2b) Probability At-Risk eventually churns $\approx 1$
2c) Steady-state: all churned $[0,0,1]$
3i) $P = \begin{bmatrix}0.7 & 0.2 & 0.1 \\ 0.3 & 0.6 & 0.1 \\ 0.1 & 0.4 & 0.5\end{bmatrix}$
3ii) Probability Normal to Boom after 2 years: $0.4$
4I) $P = \begin{bmatrix}0.7 & 0.2 & 0.1 \\ 0 & 0.5 & 0.4 \\ 0 & 0 & 0.8\end{bmatrix}$
Probability Junior eventually reaches Senior: $0.866$
5I) $P = \begin{bmatrix}0.6 & 0.3 & 0.1 \\ 0.2 & 0.5 & 0.3 \\ 0.1 & 0.5 & 0.4\end{bmatrix}$
Probability Low stock after 2 months starting Medium: $0.29$
6a) $A = \begin{bmatrix}0.3030 & 0.4211 \\ 0.4242 & 0.5263\end{bmatrix}$
6b) $L = \begin{bmatrix}3.13 & 2.78 \\ 2.80 & 4.60\end{bmatrix}$
6c) New gross output:
$$x' = \begin{bmatrix}2545.2 \\ 2784\end{bmatrix}$$