Chapter 11 q8, PG223

In Example 11.13 (Drunkard’s Walk) of this section, assume that the probability of a step to the right is 2/3, and a step to the left is 1/3. Find N, Nc, and NR.

First, we need to put the problem into a transition matrix in canonical form:

(P <- matrix(c(0, 1/3, 0, 0, 0, 2/3, 0, 1/3, 0, 0, 0, 2/3, 0, 0, 0, 1/3, 0, 0, 1, 0, 0, 0, 2/3, 0, 1), nrow=5))
##           [,1]      [,2]      [,3]      [,4]      [,5]
## [1,] 0.0000000 0.6666667 0.0000000 0.3333333 0.0000000
## [2,] 0.3333333 0.0000000 0.6666667 0.0000000 0.0000000
## [3,] 0.0000000 0.3333333 0.0000000 0.0000000 0.6666667
## [4,] 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
## [5,] 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000

Determining N:

The original Q looked like this:

\[Q=\begin{pmatrix} 0 & 1/2 & 0 \\ 1/2 & 0 & 1/2 \\ 0 & 1/2 & 0 \end{pmatrix}\] However, the new matrix will look like this (we assume because while drinking he hurt his left foot and favors his right side)

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

(Q <- matrix(c(0, 1/3, 0, 2/3, 0, 1/3, 0, 2/3, 0), nrow=3))
##           [,1]      [,2]      [,3]
## [1,] 0.0000000 0.6666667 0.0000000
## [2,] 0.3333333 0.0000000 0.6666667
## [3,] 0.0000000 0.3333333 0.0000000

Creating IQ

I <- diag(3)
(IQ <- I-Q)
##            [,1]       [,2]       [,3]
## [1,]  1.0000000 -0.6666667  0.0000000
## [2,] -0.3333333  1.0000000 -0.6666667
## [3,]  0.0000000 -0.3333333  1.0000000

Creating N by inverting IQ

(N <- inv(IQ))
##      [,1] [,2] [,3]
## [1,]  1.4  1.2  0.8
## [2,]  0.6  1.8  1.2
## [3,]  0.2  0.6  1.4

Determining NR:

The original R matrix looked like this: \[R=\begin{pmatrix} 1/2 & 0 \\ 0 & 0 \\ 0 & 1/2 \end{pmatrix}\] However, as we have defined he has a hurt left foot and is favoring his right side, the new one looks like: \[R=\begin{pmatrix} 1/3 & 0 \\ 0 & 0 \\ 0 & 2/3 \end{pmatrix}\]

R <- matrix(c(1/3, 0, 0, 0, 0, 2/3), nrow=3)

If we multiply our N Matrix by this new R matrix, we get the NR Value.

(NR <-round(N %*% R, 4))
##        [,1]   [,2]
## [1,] 0.4667 0.5333
## [2,] 0.2000 0.8000
## [3,] 0.0667 0.9333

Determining NC:

C <-matrix(c(1, 1, 1), nrow=3)
(NC <- N %*% C)
##      [,1]
## [1,]  3.4
## [2,]  3.6
## [3,]  2.2