Exercise 11, page 414 - 415

Assume that a man’s profession can be classified as professional, skilled laborer, or unskilled laborer.

Assume that each man has at least one son and form a Markov chain by following the profession of a randomly chosen son of a given family through several generations

  1. Set up the matrix of transition probabilities

  2. Find the probability that a randomly chosen grandson of an unskilled laborer becomes a professional

Setting up the Markov chain by creating a matrix of transition probabilities

sons <- matrix(c(.8, .1, .1,
                 .2, .6, .2, 
                 .25, .25, .5), nrow = 3, ncol = 3, byrow = T)

colnames(sons) <-  c("Professional", "Skilled_laborer", "Unskilled_laborer")
rownames(sons) <-  c("Professional", "Skilled_laborer", "Unskilled_laborer")

sons
##                   Professional Skilled_laborer Unskilled_laborer
## Professional              0.80            0.10               0.1
## Skilled_laborer           0.20            0.60               0.2
## Unskilled_laborer         0.25            0.25               0.5

To find the probability that randomly chosen grandson of an unskilled laborer becomes a professional we have to find \(P^2\).

sons %*% sons
##                   Professional Skilled_laborer Unskilled_laborer
## Professional             0.685           0.165             0.150
## Skilled_laborer          0.330           0.430             0.240
## Unskilled_laborer        0.375           0.300             0.325

Therefore the probability that the grandson of an unskilled laborer will become a professional is equal to 0.375 \(P^2_{31}\)

Exercise 4, page 422

Find the fundamental Matrix N for example 11.10

genes <- matrix(c(1, 0, 0,
                 .5, .5, 0, 
                 0, 1, 0), nrow = 3, ncol = 3, byrow = T)

colnames(genes) <- c("GG","Gg","gg")
rownames(genes) <- c("GG","Gg","gg")
genes
##     GG  Gg gg
## GG 1.0 0.0  0
## Gg 0.5 0.5  0
## gg 0.0 1.0  0

To find the fundamental matrix we can re order the rows by placing the transient first and absorption states last. We have 2 transient states and 1 absorption state.

genes <- matrix(c(.5, 0, .5,
                 1, 0, 0, 
                 0, 0, 1), nrow = 3, ncol = 3, byrow = T)

colnames(genes) <- c("Gg","gg","GG")
rownames(genes) <- c("Gg","gg","GG")

genes
##     Gg gg  GG
## Gg 0.5  0 0.5
## gg 1.0  0 0.0
## GG 0.0  0 1.0

The fundamental matrix is \(N = (I - Q)^{-1}\)

Q <- genes[1:2,1:2]

I <- I <- matrix(c(1, 0,
              0, 1), nrow = 2, ncol = 2, byrow = T)

N <- solve(I - Q)

# The fundamental matrix N

N
##    Gg gg
## Gg  2  0
## gg  2  1