Consider the game of tennis when deuce is reached. If a player wins the next point, he has advantage. On the following point, he either wins the game or the game returns to deuce. Assume that for any point, player A has probability .6 of winning the point and player B has probability .4 of winning the point. (a) Set this up as a Markov chain with state 1: A wins; 2: B wins; 3: advantage A; 4: deuce; 5: advantage B. (b) Find the absorption probabilities. (c) At deuce, find the expected duration of the game and the probability that B will win.

Solution

The formula for finding the transition matrix is given as: \[ B = (I - Q)^{-1} \times R \] Where \(B\) is the absorption matrix, \(Q\) is the submatrix of the transition matrix that represents the transient states, and \(R\) is the submatrix of the transition matrix that represents the absorbing states.

tennis_mat <- matrix(c(0, 0, 0, 0, 1,
                       0, 0, 0, 0, 1,
                       0.6, 0, 0, 0.4, 0,
                       0, 0, 0.6, 0, 0.4,
                       0, 0.4, 0, 0.6, 0), byrow=TRUE, nrow=5)


# Define Q and R
Q <- tennis_mat[3:5, 3:5]
R <- tennis_mat[3:5, 1:2]

# Calculate B
B <- solve(diag(3) - Q) %*% R

# Print the absorption probabilities
print(B)
##           [,1]      [,2]
## [1,] 0.8769231 0.1230769
## [2,] 0.6923077 0.3076923
## [3,] 0.4153846 0.5846154

The expected duration is the sum of the probabilities of reaching each absorbing state multiplied by the number of steps to reach that state

# Calculate the expected duration of the game when starting at deuce
expected_duration <- sum(B) + 2 * B[2] + 1 * B[1]
print(paste("The expected duration of the game is", expected_duration))
## [1] "The expected duration of the game is 5.26153846153846"
# Calculate the probability that B will win
prob_B_wins <- B[2]
print(paste("The probability that B will win is", prob_B_wins))
## [1] "The probability that B will win is 0.692307692307692"