Page 423 #8 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. Compare these with the results of Example 11.15.
Example 11.13
Q<-matrix(c(0,.5,0,.5,0,.5,0,.5,0),3,3, byrow =TRUE)
I<-matrix(c(1,0,0,0,1,0,0,0,1),3,3,byrow=TRUE)
R<-matrix(c(.5,0,0,0,0,.5),3,2,byrow=TRUE)
N<-solve(I-Q)
c<-matrix(c(1,1,1),3,1, byrow=TRUE)
Nc<-N%*%c
NR<-N%*%R
N
## [,1] [,2] [,3]
## [1,] 1.5 1 0.5
## [2,] 1.0 2 1.0
## [3,] 0.5 1 1.5
Nc
## [,1]
## [1,] 3
## [2,] 4
## [3,] 3
NR
## [,1] [,2]
## [1,] 0.75 0.25
## [2,] 0.50 0.50
## [3,] 0.25 0.75
Example 11.15
Q<-matrix(c(0,.33,0,.67,0,.33,0,.67,0),3,3, byrow =TRUE)
I<-matrix(c(1,0,0,0,1,0,0,0,1),3,3,byrow=TRUE)
R<-matrix(c(.33,0,0,0,0,.67),3,2,byrow=TRUE)
N<-solve(I-Q)
c<-matrix(c(1,1,1),3,1, byrow=TRUE)
Nc<-N%*%c
NR<-N%*%R
N is:
## [,1] [,2] [,3]
## [1,] 1.4 0.59 0.20
## [2,] 1.2 1.79 0.59
## [3,] 0.8 1.20 1.40
Nc is:
## [,1]
## [1,] 2.18
## [2,] 3.59
## [3,] 3.40
NR is:
## [,1] [,2]
## [1,] 0.46 0.13
## [2,] 0.40 0.40
## [3,] 0.27 0.94