Example 11.7 Modify Example 11.6 by assuming that the son of a Harvard man always went to Harvard. The transition matrix is now

library(expm)
## Warning: package 'expm' was built under R version 3.6.3
## Loading required package: Matrix
## 
## Attaching package: 'expm'
## The following object is masked from 'package:Matrix':
## 
##     expm
P = matrix(c(1, 0, 0,
             .3, .4, .3,
             .2, .1, .7),
           nrow = 3, byrow = T
)

colnames(P) = c("H", "Y", "D")
rownames(P) = c("H", "Y", "D")

5 In Example 11.7, find the probability that the grandson of a man from Harvard went to Harvard.

P %^% 2
##      H    Y    D
## H 1.00 0.00 0.00
## Y 0.48 0.19 0.33
## D 0.37 0.11 0.52

probability = 1