Purpose
Chapter 9 Problem 11

> Q <- matrix(data = NA, nrow = 4, ncol = 4)
> Q[1, ] <- c(0, 1/4, 1/4, 1/4)
> Q[2, ] <- c(0, 0, 1/3, 1/3)
> Q[3, ] <- c(0, 0, 0, 1/2)
> Q[4, ] <- c(0, 0, 0, 0)
> N <- solve(diag(4) - Q)
> C <- c(1, 1, 1, 1)
> R <- matrix(data = NA, nrow = 4, ncol = 1)
> R[, 1] <- c(1/4, 1/3, 1/2, 1)
> N1 <- N
> NC1 <- N %*% C
> NR1 <- N %*% R
> N1
     [,1] [,2]      [,3] [,4]
[1,]    1 0.25 0.3333333  0.5
[2,]    0 1.00 0.3333333  0.5
[3,]    0 0.00 1.0000000  0.5
[4,]    0 0.00 0.0000000  1.0
> NC1
         [,1]
[1,] 2.083333
[2,] 1.833333
[3,] 1.500000
[4,] 1.000000
> NR1
     [,1]
[1,]    1
[2,]    1
[3,]    1
[4,]    1

It is no surprise that probability of reaching the absorbtion state is 1 irrespective of where you start from

Also the expected number of steps decreases as you go near the absorbtion status