Assume that a man’s profession can be classified as professional, skilled laborer, or unskilled laborer. Assume that, of the sons of professional men, 80 percent are professional, 10 percent are skilled laborers, and 10 percent are unskilled laborers. In the case of sons of skilled laborers, 60 percent are skilled laborers, 20 percent are professional, and 20 percent are unskilled. Finally, in the case of unskilled laborers, 50 percent of the sons are unskilled laborers, and 25 percent each are in the other two categories. Assume that every 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. Find the probability that a randomly chosen grandson of an unskilled laborer is a professional man.
Christian’s Response:
First we create our transition matrix using the information provided above.
profession_matrix <- matrix(c(0.80, 0.10, 0.10, 0.20, 0.60, 0.20, 0.25, 0.25, 0.50), nrow = 3, ncol = 3, byrow= TRUE, dimnames = list(c("P","S","U"), c("P","S","U")))
profession_matrix
## P S U
## P 0.80 0.10 0.1
## S 0.20 0.60 0.2
## U 0.25 0.25 0.5
Once the matrix is created, we can create a vector with the
probability that the son of an unskilled laborer becomes a professional
man, skilled laborer and unskilled laborer - this will represent the
first generation. We will then perform matrix multiplication between
both first_gen and profession_matrix to get
the probability that a randomly chosen grandson of an unskilled laborer
is a professional man.
# prob of son of unskilled worker
first_gen <- c(0.25, 0.25, 0.5)
# matrix multiplication to get second generation probability
second_gen_prob <- first_gen %*% profession_matrix
second_gen_prob
## P S U
## [1,] 0.375 0.3 0.325
cat("The probability that a grandson of an unskilled laborer is a professional man is", second_gen_prob[1])
## The probability that a grandson of an unskilled laborer is a professional man is 0.375