Samjhake
Introduction to Probability
Notesโ€บIntroduction to Probabilityโ€บHomework 5: Probability and its Application (MTH432/532)

MTH-PROB ยท Page 10 of 10

Homework 5: Probability and its Application (MTH432/532)

Question 1 โ€” Conditional Second Moment

Problem

Question in English

The joint density of \(X\) and \(Y\) is

\[ f_{X,Y}(x,y)=\frac{e^{-y}}{y},qquad 0<x<y,\quad 0<y<\infty. \]

Compute \(E[X^2\mid Y=y]\).

Hinglish Question

\(X\) aur \(Y\) ki joint density upar di gayi hai. Jab \(Y=y\) fixed ho, tab \(X^2\) ka conditional expected value, yani \(E[X^2\mid Y=y]\), calculate karo.

English solution

Step 1 โ€” Find the marginal density of \(Y\)

For a fixed \(y>0\), the support gives \(0<x<y\). Therefore

\[ \begin{aligned} f_Y(y) &=\int_0^y f_{X,Y}(x,y)\,dx\\ &=\int_0^y\frac{e^{-y}}{y}\,dx\\ &=\frac{e^{-y}}{y}\cdot y=e^{-y},\qquad y>0. \end{aligned} \]

Step 2 โ€” Find the conditional density of \(X\mid Y=y\)

By the conditional density formula,

\[ f_{X\mid Y}(x\mid y) =\frac{f_{X,Y}(x,y)}{f_Y(y)} =\frac{e^{-y}/y}{e^{-y}} =\frac1y,qquad 0<x<y. \]

Thus, conditionally on \(Y=y\),

\[X\mid(Y=y)\sim U(0,y).\]

Step 3 โ€” Calculate the conditional second moment

\[ \begin{aligned} E[X^2\mid Y=y] &=\int_0^y x^2 f_{X\mid Y}(x\mid y)\,dx\\ &=\int_0^y x^2\frac1y\,dx\\ &=\frac1y\left[\frac{x^3}{3}\right]_0^y\\ &=\boxed{\frac{y^2}{3}}. \end{aligned} \]

Quick check

For a \(U(0,y)\) random variable, \(E[X^2]=y^2/3\), so the result agrees with the standard uniform-distribution formula.

Hinglish explanation

Pehle \(Y\) ki marginal density

Conditional density nikalne ke liye denominator mein \(f_Y(y)\) chahiye. Fixed \(y\) par \(x\), 0 se \(y\) tak ja sakta hai. Joint density ko \(x\) ke respect mein integrate karne par \(f_Y(y)=e^{-y}\) milta hai.

Conditional distribution ko pehchano

Joint density ko marginal density se divide karne par \(f_{X\mid Y}(x\mid y)=1/y\), \(0<x<y\), aata hai. Ye exactly Uniform\((0,y)\) ki density hai.

Second moment

Ab \(E[X^2\mid Y=y]=\int_0^y x^2(1/y)dx\). Integration se \(y^2/3\) milta hai. Dhyan rahe: question conditional mean \(E[X\mid Y=y]\) nahi, conditional second moment \(E[X^2\mid Y=y]\) pooch raha hai.

Question 2 โ€” Gamma-Poisson Conditional Distribution

Problem

Question in English

Let \(Y\) have a Gamma distribution with parameters \((\lambda,\alpha)\), written in shape-rate form as

\[ f_Y(y)=Ce^{-\alpha y}y^{\lambda-1},\qquad y>0, \]

where \(C\) does not depend on \(y\). Given \(Y=y\), suppose \(X\) is Poisson with mean \(y\):

\[ P(X=i\mid Y=y)=e^{-y}\frac{y^i}{i!},qquad i=0,1,2,\ldots. \]

Show that \(Y\mid(X=i)\) is Gamma with parameters \((\lambda+i,\alpha+1)\).

Hinglish Question

\(Y\) ek Gamma random variable hai jiska shape \(\lambda\) aur rate \(\alpha\) hai. Agar \(Y=y\) diya ho, to \(X\) Poisson distribution follow karta hai jiska mean \(y\) hai. Prove karo ki jab \(X=i\) observe hota hai, tab \(Y\) ki conditional distribution Gamma ho jati hai jiska shape \(\lambda+i\) aur rate \(\alpha+1\) hai.

English solution

Step 1 โ€” Apply Bayes' formula

For fixed \(i\), the conditional density of \(Y\mid X=i\) is

\[ f_{Y\mid X}(y\mid i) =\frac{P(X=i\mid Y=y)f_Y(y)}{P(X=i)}. \]

The denominator depends on \(i\), but not on \(y\). Hence, as a function of \(y\),

\[ \begin{aligned} f_{Y\mid X}(y\mid i) &\propto \left(e^{-y}\frac{y^i}{i!}\right) \left(Ce^{-\alpha y}y^{\lambda-1}\right)\\ &\propto e^{-(\alpha+1)y}y^{\lambda+i-1},qquad y>0. \end{aligned} \]

Step 2 โ€” Identify and normalize the Gamma kernel

A Gamma density with shape \(a\) and rate \(b\) is

\[ \frac{b^a}{\Gamma(a)}y^{a-1}e^{-by},\qquad y>0. \]

Comparing exponents gives

\[a=\lambda+i,\qquad b=\alpha+1.\]

Therefore the normalized posterior density is

\[ \boxed{ f_{Y\mid X}(y\mid i) =\frac{(\alpha+1)^{\lambda+i}}{\Gamma(\lambda+i)} y^{\lambda+i-1}e^{-(\alpha+1)y},\qquad y>0 }. \]

Hence

\[ \boxed{Y\mid(X=i)\sim\operatorname{Gamma}(\lambda+i,\alpha+1)}. \]

Interpretation

The Gamma family is conjugate to the Poisson likelihood. Observing count \(i\) adds \(i\) to the shape, while one Poisson observation adds \(1\) to the rate.

Hinglish explanation

Bayes ka use

Posterior density proportional hoti hai likelihood ร— prior ke. Yahan likelihood \(e^{-y}y^i/i!\) hai aur prior \(Ce^{-\alpha y}y^{\lambda-1}\) hai.

Powers aur exponent combine karo

Exponential terms multiply hone par \(e^{-y}e^{-\alpha y}=e^{-(\alpha+1)y}\). Powers multiply hone par \(y^iy^{\lambda-1}=y^{\lambda+i-1}\). Jo constants \(y\) par depend nahi karte, unko proportionality mein ignore kar sakte hain.

Gamma form identify karo

Final kernel \(e^{-(\alpha+1)y}y^{\lambda+i-1}\) hai. Gamma density se compare karne par new shape \(\lambda+i\) aur new rate \(\alpha+1\) milta hai. Normalizing constant \((\alpha+1)^{\lambda+i}/\Gamma(\lambda+i)\) hoga.

Easy memory rule

Poisson-Gamma model mein observed count shape mein add hota hai, aur number of Poisson observations rate mein add hota hai. Yahan ek observation hai, isliye rate mein 1 add hua.

Question 3 โ€” Randomly Selected Coin

Problem

Question in English

Three coins have head probabilities \(1/4,1/2,3/4\), respectively. One coin is chosen uniformly at random and then repeatedly flipped.

  1. Find the expected number of flips until the first head.
  2. Find the mean number of heads in the first 8 flips.

Hinglish Question

Teen coins hain jinke head aane ke chances respectively \(1/4,1/2,3/4\) hain. Inmein se ek coin equal probability se randomly choose kiya jata hai, aur phir usi chosen coin ko baar-baar flip kiya jata hai.

  1. Pehla head aane tak expected kitne flips lagenge?
  2. Pehle 8 flips mein heads ki expected sankhya kitni hogi?

English solution

Let \(C\) denote the chosen coin

Each coin is chosen with probability \(1/3\). Conditional on a coin having head probability \(p\), all subsequent flips use that same \(p\).

(a) Expected flips until the first head

Conditional on a coin with head probability \(p\), the waiting time \(T\) is geometric on \(1,2,\ldots\), so

\[E[T\mid p]=\frac1p.\]

Using the law of total expectation,

\[ \begin{aligned} E[T] &=\frac13\left(\frac1{1/4}+\frac1{1/2}+\frac1{3/4}\right)\\ &=\frac13\left(4+2+\frac43\right)\\ &=\boxed{\frac{22}{9}}. \end{aligned} \]

(b) Expected heads in the first 8 flips

Let \(H\) be the number of heads in 8 flips. Given a coin with head probability \(p\),

\[H\mid p\sim\operatorname{Binomial}(8,p),\qquad E[H\mid p]=8p.\]

Again using total expectation,

\[ \begin{aligned} E[H] &=\frac13\left(8\cdot\frac14+8\cdot\frac12+8\cdot\frac34\right)\\ &=\frac13(2+4+6)\\ &=\boxed{4}. \end{aligned} \]

Important distinction

The coin is selected once and then kept. Therefore the unconditional flips are not independent: observing earlier flips gives information about which coin was selected. Nevertheless, total expectation gives both requested means directly.

Hinglish explanation

(a) First head tak waiting time

Agar selected coin ka head probability \(p\) hai, to first head tak flips geometric distribution follow karte hain aur mean \(1/p\) hota hai. Teen possible means 4, 2 aur \(4/3\) hain. Coins equally likely hain, isliye inka average \(22/9\) hoga.

(b) Pehle 8 flips mein heads

Fixed coin ke liye expected heads \(8p\) hain. Teen coins ke liye ye values 2, 4 aur 6 hain. Inka equal-weight average 4 hai.

Common mistake

Part (a) mein average head probability \(1/2\) lekar answer 2 nahi karna. Correct value \(E[1/p]\) chahiye, jo generally \(1/E[p]\) ke equal nahi hota. Yahan \(E[1/p]=22/9\), jabki \(1/E[p]=2\).

Question 4 โ€” Urn-Swap Markov Chain

Problem

Question in English

Three white and three black balls are distributed between two urns, with three balls in each urn. The system is in state \(i\in\{0,1,2,3\}\) if the first urn contains \(i\) white balls. At every step, one ball is selected from each urn and the two selected balls are exchanged. Let \(X_n\) be the state after the \(n\)-th step. Explain why \(\{X_n\}\) is a Markov chain and find its transition matrix.

Hinglish Question

Total 3 white aur 3 black balls ko do urns mein is tarah rakha gaya hai ki har urn mein 3 balls hain. State \(i\) ka matlab hai ki first urn mein \(i\) white balls hain. Har step par dono urns se ek-ek ball randomly nikalkar aapas mein exchange ki jati hain. \(X_n\), \(n\)-th exchange ke baad first urn mein white balls ki sankhya hai. Explain karo ki ye Markov chain kyun hai aur iska transition probability matrix calculate karo.

English solution

Composition in state \(i\)

If urn 1 has \(i\) white balls, then it has \(3-i\) black balls. Since there are three white and three black balls in total, urn 2 has \(3-i\) white balls and \(i\) black balls.

Why the process is Markov

Once the current state \(i\) is known, the colour composition of both urns is completely determined. Therefore the distribution of the next state depends only on \(X_n=i\), not on any earlier states:

\[ P(X_{n+1}=j\mid X_n=i,X_{n-1},\ldots,X_0) =P(X_{n+1}=j\mid X_n=i). \]

Transition probabilities from state \(i\)

The state increases from \(i\) to \(i+1\) when a black ball is drawn from urn 1 and a white ball from urn 2:

\[ p_{i,i+1}=\frac{3-i}{3}\cdot\frac{3-i}{3}=\frac{(3-i)^2}{9}. \]

The state decreases from \(i\) to \(i-1\) when a white ball is drawn from urn 1 and a black ball from urn 2:

\[ p_{i,i-1}=\frac{i}{3}\cdot\frac{i}{3}=\frac{i^2}{9}. \]

The state stays at \(i\) when the two selected balls have the same colour:

\[ p_{i,i}=2\left(\frac{i}{3}\right)\left(\frac{3-i}{3}\right) =\frac{2i(3-i)}9. \]

Transition matrix

Using state order \((0,1,2,3)\),

\[ \boxed{ P= \begin{pmatrix} 0 & 1 & 0 & 0\\ \frac19 & \frac49 & \frac49 & 0\\ 0 & \frac49 & \frac49 & \frac19\\ 0 & 0 & 1 & 0 \end{pmatrix}} \]

Every entry is non-negative and each row sums to 1, as required.

Hinglish explanation

Current state se sab kuch pata hai

Agar state \(i\) hai, to urn 1 mein \(i\) white aur \(3-i\) black balls hain. Automatically urn 2 mein \(3-i\) white aur \(i\) black balls honge. Isliye next step ke chances calculate karne ke liye past history ki zaroorat nahi; current state enough hai. Yahi Markov property hai.

State kab badhega?

First urn se black aur second urn se white aaya to exchange ke baad first urn mein ek extra white aa jayega. Probability \(((3-i)/3)^2\) hai.

State kab ghatega?

First urn se white aur second se black aaya to first urn ka white count ek kam hoga. Probability \((i/3)^2\) hai.

State same kab rahega?

Dono selected balls same colour ke honโ€”dono white ya dono blackโ€”tab exchange se composition change nahi hogi. Dono cases add karne par \(2i(3-i)/9\) milta hai.

Boundary states

State 0 par first urn mein saare black aur second mein saare white hain, so next state surely 1 hai. State 3 par exactly reverse hai, so next state surely 2 hai. Isi wajah se matrix ki first aur last rows simple hain.

Question 5 โ€” Expected State After Three Steps

Problem

Question in English

A Markov chain on states \(\{0,1,2\}\) has transition matrix

\[ P= \begin{pmatrix} \frac12 & \frac13 & \frac16\\ 0 & \frac13 & \frac23\\ \frac12 & 0 & \frac12 \end{pmatrix}. \]

If \(P(X_0=0)=P(X_0=1)=1/4\), find \(E[X_3]\).

Hinglish Question

States \(0,1,2\) wali Markov chain ka transition matrix diya gaya hai. Starting time par state 0 aur state 1 ki probability dono \(1/4\) hain. Remaining probability state 2 ki hogi. Teen transitions ke baad \(X_3\) ka expected value calculate karo.

English solution

Step 1 โ€” Initial distribution

The given probabilities imply

\[ P(X_0=2)=1-\frac14-\frac14=\frac12. \]

Thus the initial row vector is

\[\pi_0=\left(\frac14,\frac14,\frac12\right).\]

Step 2 โ€” Move the distribution forward

For a row-vector convention, \(\pi_{n+1}=\pi_nP\). After one step,

\[ \pi_1=\pi_0P =\left(\frac38,\frac16,\frac{11}{24}\right). \]

After two steps,

\[ \pi_2=\pi_1P =\left(\frac5{12},\frac{13}{72},\frac{29}{72}\right). \]

After three steps,

\[ \pi_3=\pi_2P =\left(\frac{59}{144},\frac{43}{216},\frac{169}{432}\right). \]

The entries sum to 1:

\[ \frac{177}{432}+\frac{86}{432}+\frac{169}{432}=1. \]

Step 3 โ€” Calculate the expectation

\[ \begin{aligned} E[X_3] &=0\cdot P(X_3=0)+1\cdot P(X_3=1)+2\cdot P(X_3=2)\\ &=\frac{43}{216}+2\left(\frac{169}{432}\right)\\ &=\frac{43}{216}+\frac{169}{216}\\ &=\boxed{\frac{53}{54}}. \end{aligned} \]

Hinglish explanation

Initial vector complete karo

State 0 aur 1 ki probability \(1/4\), \(1/4\) hai. Total 1 hona chahiye, isliye state 2 ki probability \(1/2\). Initial distribution \((1/4,1/4,1/2)\) hai.

Three steps ka rule

Row-vector convention mein next distribution = current distribution ร— transition matrix. Isliye teen baar multiply karo: \(\pi_1=\pi_0P\), \(\pi_2=\pi_1P\), \(\pi_3=\pi_2P\). Directly \(\pi_3=\pi_0P^3\) bhi kar sakte ho.

Expected state

Final distribution milne ke baad state ร— probability add karo. State 0 ka contribution zero hai, state 1 ka \(43/216\), aur state 2 ka \(2(169/432)\). Total \(53/54\) milta hai.

Common mistake

Initial probabilities ko column vector maan kar wrong side se multiply mat karna. Yahan hum row vector use kar rahe hain, so distribution ko left side par rakhkar \(\pi P\) karte hain.

Question 6 โ€” Replacement Urn Process

Problem

Question in English

An urn initially contains one red and one blue ball. At each stage, a ball is selected uniformly. If it is red, it is replaced by red with probability \(0.7\) or blue with probability \(0.3\). If it is blue, it is replaced by red or blue with equal probabilities.

  1. Let \(X_n=1\) if the \(n\)-th selected ball is red and \(X_n=0\) otherwise. Is \(\{X_n\}\) a Markov chain? If yes, give its transition matrix.
  2. Let \(Y_n\) be the number of red balls immediately before the \(n\)-th selection. Is \(\{Y_n\}\) a Markov chain? If yes, give its transition matrix.
  3. Find the probability that the second selected ball is red.
  4. Find the probability that the fourth selected ball is red.

Hinglish Question

Urn mein initially ek red aur ek blue ball hai. Har stage par randomly ek ball select hoti hai. Agar selected ball red hai, to uski jagah probability \(0.7\) se red aur \(0.3\) se blue ball rakhi jati hai. Agar selected ball blue hai, to replacement red ya blue equal probability \(0.5\) se hota hai.

  1. \(X_n=1\) ka matlab \(n\)-th selected ball red hai, aur \(X_n=0\) ka matlab blue hai. Kya selected colours ka process Markov chain hai?
  2. \(Y_n\), \(n\)-th selection se immediately pehle urn mein red balls ki sankhya hai. Kya ye Markov chain hai? Agar haan, transition matrix nikalo.
  3. Second selected ball ke red hone ki probability nikalo.
  4. Fourth selected ball ke red hone ki probability nikalo.

English solution

(a) Is \(\{X_n\}\) a Markov chain?

No. The last selected colour does not determine the current composition of the urn. Earlier selected colours give additional information about that hidden composition and therefore affect the next-selection probability.

A concrete counterexample

If the first two selected balls are both red, then after the first red selection the urn must still contain one red ball; otherwise the second selected ball could not be red. After replacing the second selected red ball,

\[ P(X_3=1\mid X_2=1,X_1=1)=0.7\left(\frac12\right)+0.3(0)=\frac7{20}. \]

On the other hand, conditional on \(X_1=0,X_2=1\), Bayes' rule gives probability \(2/3\) that the urn contained two red balls before the second selection and probability \(1/3\) that it contained one red ball. Therefore

\[ \begin{aligned} P(X_3=1\mid X_2=1,X_1=0) &=\frac23\left(0.7\cdot1+0.3\cdot\frac12\right) +\frac13\left(0.7\cdot\frac12+0.3\cdot0\right)\\ &=\frac23\left(\frac{17}{20}\right)+\frac13\left(\frac7{20}\right)\\ &=\frac{41}{60}. \end{aligned} \]

Since \(7/20\ne41/60\), knowledge of \(X_1\) changes the distribution of \(X_3\) even after \(X_2\) is known. Hence \(\{X_n\}\) is not Markov.

(b) The process \(\{Y_n\}\)

Yes. The state space is \(\{0,1,2\}\). Given \(Y_n=y\), the urn has \(y\) red and \(2-y\) blue balls, which completely determines the distribution of \(Y_{n+1}\).

The red count decreases by 1 if a red ball is selected and replaced by blue:

\[ p_{y,y-1}=\frac y2(0.3). \]

It increases by 1 if a blue ball is selected and replaced by red:

\[ p_{y,y+1}=\frac{2-y}{2}(0.5). \]

Otherwise it remains unchanged. In state order \((0,1,2)\),

\[ \boxed{ P_Y= \begin{pmatrix} \frac12 & \frac12 & 0\\ \frac3{20} & \frac35 & \frac14\\ 0 & \frac3{10} & \frac7{10} \end{pmatrix}} \]

(c) Probability that the second selected ball is red

Initially \(Y_1=1\). After the first selection and replacement,

\[ P(Y_2=0)=\frac3{20},\qquad P(Y_2=1)=\frac35,\qquad P(Y_2=2)=\frac14. \]

Given \(Y_2=y\), the second draw is red with probability \(y/2\). Hence

\[ \begin{aligned} P(X_2=1) &=0\left(\frac3{20}\right) +\frac12\left(\frac35\right) +1\left(\frac14\right)\\ &=\boxed{\frac{11}{20}}. \end{aligned} \]

(d) Probability that the fourth selected ball is red

Let \(m_n=E[Y_n]\). Given \(Y_n=y\),

\[ \begin{aligned} E[Y_{n+1}\mid Y_n=y] &=y+P(\text{increase})-P(\text{decrease})\\ &=y+\frac{2-y}{4}-\frac{3y}{20}\\ &=\frac12+\frac35y. \end{aligned} \]

Taking expectations gives the recurrence

\[m_{n+1}=\frac12+\frac35m_n,\qquad m_1=1.\]

Therefore

\[ m_2=\frac{11}{10},\qquad m_3=\frac{29}{25},\qquad m_4=\frac{299}{250}. \]

Given \(Y_4\), the fourth selected ball is red with probability \(Y_4/2\). Thus

\[ \boxed{P(X_4=1)=E\left[\frac{Y_4}{2}\right] =\frac{m_4}{2}=\frac{299}{500}}. \]

Final answers

  • (a) \(\{X_n\}\) is not a Markov chain.
  • (b) \(\{Y_n\}\) is a Markov chain with the matrix shown above.
  • (c) \(P(\text{second selected ball is red})=11/20\).
  • (d) \(P(\text{fourth selected ball is red})=299/500\).

Hinglish explanation

(a) Selected colour process Markov kyun nahi?

Sirf last selected ball ka colour jaanne se urn ke andar ab kitne red balls hain, ye uniquely pata nahi chalta. Purane selected colours hidden composition ke baare mein extra information dete hain. Isliye next draw ki probability sirf current \(X_n\) par depend nahi karti.

Counterexample mein current value dono cases mein \(X_2=1\) hai, lekin \(X_1=1\) hone par next red probability \(7/20\), aur \(X_1=0\) hone par \(41/60\) hai. Dono unequal hain, so Markov property fail hoti hai.

(b) Red-count process Markov kyun hai?

\(Y_n=y\) pata ho to current urn composition exactly pata hai: \(y\) red aur \(2-y\) blue. Ab next red count ke chances nikalne ke liye aur koi past information nahi chahiye. Isliye \(Y_n\) Markov chain hai.

Transition probabilities

Red select hokar blue se replace hua to count ek ghatta hai. Blue select hokar red se replace hua to count ek badhta hai. Same colour replacement hua to count same rahta hai. Inhi three cases se matrix banti hai.

(c) Second red

Initially red count 1 hai. Ek transition ke baad \(Y_2\) ki distribution matrix ki state-1 row \((3/20,3/5,1/4)\) hai. State \(y\) mein red draw ka chance \(y/2\) hai. Weighted average se \(11/20\) milta hai.

(d) Fourth red

Puri distribution ko three times multiply kar sakte ho, lekin sirf red-draw probability ke liye expected red count enough hai. Recurrence \(m_{n+1}=1/2+(3/5)m_n\) use karke \(m_4=299/250\). Fourth draw red hone ka chance expected red fraction \(E[Y_4/2]=299/500\) hai.

Homework 5 โ€” Quick Revision

English recap

  • Q1: \(X\mid Y=y\sim U(0,y)\), so \(E[X^2\mid Y=y]=y^2/3\).
  • Q2: Gamma prior ร— Poisson likelihood gives Gamma posterior with shape \(\lambda+i\) and rate \(\alpha+1\).
  • Q3: use total expectation; answers are \(22/9\) flips and 4 heads.
  • Q4: the current white count determines both urn compositions, giving a four-state Markov chain.
  • Q5: \(\pi_3=\pi_0P^3\), then take the state-weighted average; \(E[X_3]=53/54\).
  • Q6: selected colours are not Markov, but red-ball counts are Markov; second-red probability \(11/20\), fourth-red probability \(299/500\).

Hinglish recap

  • Conditional density = joint density รท marginal density.
  • Bayes mein posterior proportional to likelihood ร— prior hota hai.
  • Random model choose ho to law of total expectation use karo.
  • Markov property mein current state future ke liye enough hona chahiye.
  • Distribution ko aage le jane ke liye row vector ko \(P\) se multiply karo.
  • Hidden composition ki wajah se observed-colour sequence Markov na bhi ho sakti hai.