Exercises — Stochastic processes — Markov chains, steady-state, random walks
4.10.27 · D4· Maths › Advanced Topics (Elite Level) › Stochastic processes — Markov chains, steady-state, random w
Throughout, remember the three chants from the parent: "Row times P, In equals There, Spread is √n."
Level 1 — Recognition
Goal: objects ko padho. Koi bhaari computation nahi — bas "yeh cheez kya hai aur kya yeh rules follow karti hai?"
Exercise 1.1. Kya neeche diya gaya ek valid transition matrix hai ek Markov chain ka?
Woh ek rule batao jo tumhe check karna hai, aur check karo.
Recall Solution 1.1
Kaunsa rule? Ek transition matrix row-stochastic hona chahiye: har row ek list hai probabilities ki kahi bhi jaane ki, isliye har row ka sum hona chahiye (parent note, §1). Entries bhi honi chahiyein.
Row by row check karo:
- Row 1 (state 1 se): ✔
- Row 2 (state 2 se): ✔
- Sabhi entries ✔
Answer: Haan, yeh ek valid transition matrix hai.
Exercise 1.2. Ek chain ki current distribution hai — matlab state 1 mein hone ka chance aur state 2 mein hone ka chance. Exercise 1.1 wale ka use karke, kaun sa product ek step baad ki distribution deta hai: ya ? Phir use compute karo.
Recall Solution 1.2
Kaun sa product? Update rule hai — ek row vector times the matrix (parent, §1, "Row times P"). Hum current state par sum karte hain, jo ka row index hai, aur woh summation exactly ek row-vector–matrix product hai. Toh correct product hai .
Compute karo (row vector rule: naya -th entry ): Answer: . (Sanity: yeh mein sum hota hai. Achha — probability conserved hai.)
Level 2 — Application
Goal: process follow karo. Defining equations sahi se solve karo.
Exercise 2.1. Is matrix ka stationary distribution nikalo:
Recall Solution 2.1
Hum kya chahte hain: woh row vector jo ek step baad bhi unchanged rahe, yaani with (parent, §2). "In equals There."
ko component by component likhte hain:
Pehli equation use karo (dono equations chain ke liye hamesha redundant hoti hain; isliye hume normalisation bhi chahiye):
Normalise karo se:
Answer: .
Exercise 2.2. Parent note ke weather chain ke liye,
do din baad ki distribution compute karo.
Recall Solution 2.2
Plan: "Row times P" do baar apply karo: , phir . (Equivalently .)
Day 1: So .
Day 2:
Answer: . Notice karo yeh already stationary ki taraf creep kar raha hai jo parent note mein hai — convergence in action.
Level 3 — Analysis
Goal: structure dekho — kyun ek answer woh form leta hai jo leta hai.
Exercise 3.1. Ek symmetric random walk () se start hoti hai aur steps leti hai size ke. Simulate kiye bina, batao (a) expected position , (b) variance , aur (c) origin se typical distance. Explain karo kyun mean aur typical distance mein antar hai.
Recall Solution 3.1
Let each step be and (parent, §3).
(a) Mean. . Means ka sum: .
(b) Variance. , toh . Steps independent hain, aur independent cheezein ki variances add hoti hain: .
(c) Typical distance standard deviation .
Kyun antar hai: Mean ek signed average hai — leftward aur rightward wanderings cancel ho jaati hain, giving . Lekin spread sign ki parwah nahi karta; har step variance mein contribute karta hai chahe woh left gaya ho ya right. Toh possible positions ka cloud ki tarah wider hota jaata hai, bhale hi uska center par hi atka raha ho. Figure dekho — center (amber line) flat hai jabki envelope (cyan) fan out ho raha hai.

Exercise 3.2. par fair gambler's ruin mein, first-step analysis deta hai Sirf is equation se dikhao ki , mein ek straight line hona chahiye, aur isliye .
Recall Solution 3.2
Recurrence ko rearrange karo shape expose karne ke liye:
Ise zor se padho: consecutive values ke beech ka gap, , satisfy karta hai . Toh har gap ek same constant hai. Constant steps wali sequence ek arithmetic progression hai — yaani ek straight line: .
Constant pin karo doosri boundary use karke:
Geometry: constant gaps = se tak ek ramp. Neeche straight amber line dekho.

Level 4 — Synthesis
Goal: tools combine karo — chain structure + eigenvalues + conditions for convergence.
Exercise 4.1. Periodic 2-state chain consider karo:
(a) Uska stationary distribution nikalo. (b) Dikhao ki se start karke distribution kabhi converge nahi hoti us par. (c) Parent note se kaun si convergence condition fail hoti hai, aur kyun?
Recall Solution 4.1
(a) Stationary , , solve : Set karo . se: . Ek stationary distribution exist karti hai.
(b) se iterate karo: Yeh oscillate karta rehta hai forever, kabhi ke paas nahi aata. Toh .
(c) Kaun si condition fail hoti hai? Aperiodicity. Is chain ki period 2 hai: state 1 se tum state 1 par sirf even number of steps () ke baad wapas aa sakte ho. Forced cycle length hai, toh chain periodic hai. Irreducibility holds (har state doosre tak pahunch sakti hai), lekin Perron–Frobenius convergence guarantee (Perron–Frobenius Theorem) ko dono irreducible aur aperiodic chahiye. Aperiodicity missing hone par ⇒ ek jo exist karti hai lekin kabhi reach nahi hoti.
(Eigenvalue view: ke eigenvalues aur hain. eigenvalue ki magnitude hai, isliye uska contribution kabhi decay nahi karta — woh har step sign flip karta hai, eternal oscillation produce karta hai. Aperiodicity exactly woh condition hai ki hi only eigenvalue ho magnitude wala. Dekho Linear Algebra — Eigenvalues and Eigenvectors.)
Exercise 4.2. Ek frog 3 lily pads par hop karta hai jahan
(a) Verify karo ki yeh row-stochastic hai. (b) Balance equations + normalisation use karke stationary distribution nikalo. (c) Kya yeh aperiodic hai?
Recall Solution 4.2
(a) Row sums: har row mein ek single aur do hain → sum . ✔ Row-stochastic.
(b) Stationary , solve . compute karo (row vector rule, column by column):
- ka Column 1 hai : .
- Column 2 hai : .
- Column 3 hai : .
Toh . Setting : Normalise . Symmetry se frog har pad par equal time spend karta hai.
(c) Aperiodic? Nahi. Frog forced hai ; woh kisi bhi pad par sirf steps ke multiples ke baad wapas aata hai. Period 3 hai jo hai ⇒ periodic. Toh exist karti hai aur unique hai (chain irreducible hai), lekin converge hone ki jagah cycle karta hai.
Level 5 — Mastery
Goal: method khud banao — scratch se ek first-step analysis set up karo aur wider map se connect karo.
Exercise 5.1 (expected hitting time). par fair random walk ke liye absorbing ends ke saath, maano expected number of steps ho absorption tak (hitting ya ), position se start karke. (a) First-step analysis se ke liye recurrence derive karo. (b) Use solve karo. (c) Fair game ki expected duration evaluate karo jo \3$0$10$ par hon.
Recall Solution 5.1
(a) First-step analysis set up karo. Position se (interior, ) tum ek step lete ho (isliye ek appear hota hai), phir ya par land karte ho har ek probability se, aur Markov property se process restart hoti hai jahan bhi tum land karo. Us first step par condition karte hue (law of total expectation, cousin of Law of Total Probability): (Woh = woh step jo tum ne abhi spend kiya; boundaries hain kyunki absorb hone ke baad, aur koi steps nahi chahiye.)
(b) Solve karo. Rearrange karo: Toh gaps har step se decrease hote hain: — ek arithmetic progression. se tak gaps sum karte hain: Yeh mein ek quadratic hai; ansatz try karo (ek downward parabola jo sensibly vanish hoti hai). impose karo: Phir . Check karo ✔, ✔, aur yeh recurrence satisfy karta hai: ✔.
(c) ke saath: steps expected. Ek fair $3-vs-$10 game, on average, 21 rounds chalta hai — surprisingly long, kyunki walk linger karti hai kisi bhi barrier ke pakadne se pehle.
Parent note ke absorption probability se compare karo: "kaun sa end" ke liye ek linear answer, lekin "kitna time" ke liye ek quadratic answer. Same first-step trick, different inhomogeneous term (woh ).
Exercise 5.2 (conceptual synthesis). Is chapter ki language mein explain karo ki Google ka Google PageRank "web par ek random walk ka stationary distribution" kyun hai, aur woh single technical ingredient name karo jo Google add karta hai taaki yeh guarantee ho ki stationary distribution unique ho aur reach ho sake.
Recall Solution 5.2
Web as a Markov chain. Har web page ko ek state maano. Ek "random surfer" ek page par us page ke outgoing links mein se ek uniformly at random click karta hai — yeh ek row-stochastic transition matrix define karta hai (har row = "is page se ek click kahan ja sakta hai"). Surfer memoryless hai: next click sirf current page par depend karta hai. Toh surfer ek giant graph par random walk hai.
PageRank = stationary distribution. Ek page ki importance = fraction of time jo random surfer us par spend karta hai long run mein = stationary vector ki entry jo solve karta hai (eigenvalue ke liye left eigenvector, parent §2). "In equals There": ek page important hai agar usme bahut saari importance flow in hoti hai.
Woh ingredient jo Google add karta hai — teleportation (damping). Raw web-link reducible ho sakta hai (dead-end pages, disconnected clusters) aur periodic, toh Exercises 4.1–4.2 se ek unique, reachable guaranteed nahi hai. Google ek small probability (roughly ) mix karta hai uniformly random page par jump karne ki, link follow karne ki jagah: Ab har page har doosre page tak ek step mein pahunch sakta hai (irreducible) aur koi forced cycles nahi hain (aperiodic). Perron–Frobenius Theorem se, ka ek unique stationary hai jis par power iteration converge hoti hai kisi bhi start se — exactly woh guarantee jo Exercises 4.1–4.2 ne dikhaya tha ki uske bina missing thi.
Connections
- Linear Algebra — Eigenvalues and Eigenvectors — har steady-state eigenvalue ke liye ek left eigenvector hai; ki story oscillation explain karti hai (Ex. 4.1).
- Perron–Frobenius Theorem — uniqueness & convergence guarantee jo L4 mein test ki gayi aur L5 mein use ki gayi.
- Law of Total Probability — har first-step analysis ke peeche woh conditioning (Ex. 3.2, 5.1).
- Central Limit Theorem — kyun random-walk spread ek Gaussian bell ban jaata hai (Ex. 3.1).
- Diffusion and Brownian Motion — in walks ka continuum limit.
- Google PageRank — flagship application (Ex. 5.2).