Transition matrix & Expectation

373 Views Asked by At

I have a problem that need to calculate the average.

10 cities are arranged in a line. 2 cities are connected to two bridges, one is a good bridge, one a bad bridge. Passing the bad bridge will collapse and back again. So what is the average of number of good bridges which we need to pass to go through from $1^{st}$ city to $10^{th}$ city.

I see that transition matrix to bridge changing has style

\begin{pmatrix} \frac{1}{2}& \frac{1}{2} &0 & 0 & 0 & 0 & 0 & 0 & 0 &0 \\ \frac{1}{2}& 0 &\frac{1}{2} & 0 & 0 & 0 & 0 & 0 & 0 &0 \\ \frac{1}{2} &0 & 0 & \frac{1}{2} & 0 & 0 & 0 & 0 & 0 &0 \\ \frac{1}{2} &0 & 0 & 0& \frac{1}{2} & 0 & 0 & 0 & 0 &0 \\ \frac{1}{2} &0 & 0 & 0 & 0 & \frac{1}{2} & 0 & 0 & 0 &0 \\ \frac{1}{2} &0 & 0 & 0 & 0 & 0 & \frac{1}{2} & 0 & 0 &0 \\ \frac{1}{2} &0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{2} & 0 &0 \\ \frac{1}{2} &0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{2} &0 \\ \frac{1}{2} &0 & 0 & 0 & 0 & 0 & 0 & 0 &0 & \frac{1}{2}\\ 0 & 0 &0 & 0 & 0 & 0 & 0 & 0 & 0 &1 \end{pmatrix}

But I don't know how to calculate the average of number of good bridges to move from $1^{st}$ country to $10^{th}$ country.

Please help me solve this problem.

Thank in advance

1

There are 1 best solutions below

2
On

Let us interpret the problem as follows: If a bridge collapses while you are on it, then you start over from the first city. If you succeed in taking a bridge once, you take that bridge every other time you can.

How many good bridges do you have to drive over? We note that we can determine our path at the end of the trip just by seeing which bridges have collapsed. For example, if the only bridge to collapse was between 3 and 4, then we drove to 3 (giving 2 good bridge crossings), started over, then drove to 10 (giving 9). More generally, if the bridge from $i$ to $i+1$ collapsed, it will add an additional $(i-1)$ good bridge crossings to our list.

Because each bad bridge has a $1/2$ chance of collapsing during the trip, the expected number of good bridge crossings is $9+(1/2)(0+1+\ldots+8)=9+\frac{8*9}{4}=27$.

More formally, let $B_i$ be the event that you drive on the bad bridge leaving city $i$ the first time you try to leave city $i$, and let $X_i$ be the random variable that is $(i-1)$ if $B_i$ happens, and $0$ otherwise. Then the number of good bridge crossings is given by the random variable $9+\sum X_i$, and by linearity of expectation, $$E(9+\sum X_i)=9+\sum E(X_i)=9+\sum E((i-1) 1_{B_i}),$$ where $1_{B_i}$ is the indicator function for the event $B_i$. This is then equal to $$9+\sum (i-1)E(1_{B_i})=9+\sum (i-1)P(B_i).$$

However, each particular bad bridge has a $1/2$ chance of being driven over, because it will only be driven over the first time you visit the corresponding city, and your choice of the good or bad bridge is equally likely at this point.