1. u_i = i(g-i). Problem incorrectly stated mu_i. 2. varTimeToAbsorb <- function(g) { iVals <- 1:(g-2) rates <- iVals * (g - iVals) vars <- 1 / rates^2 sum(vars) } print(varTimeToAbsorb(10)) 3. # A buses arrive at the rate 1/10 = 0.10, and B buses arrive at the rate # of 1/20 = 0.05. So buses, collectively of both lines, arrive at the # rate of 0.15, with a mean time between buses of 1/0.15, a little less # than 7 minutes. By the Markov property, that is also the mean time I # will wait until some bus arrives. And again, since "time starts over" # when I arrive, our theorem about the min of 2 independent expons applies nextBus <- function() { rateA <- 1/10 rateB <- 1/20 rateBoth <- rateA + rateB meanTimeBetweenBuses <- 1/rateBoth meanTimetoNextBus <- meanTimeBetweenBuses probBusA <- rateA / rateBoth c(probBusA,meanTimetoNextBus) } print(nextBus()) 4. In Eqns. (11.10)-(11.12), the original rates in and out were: state rate out rate in 0 pi0 (1/8+1/8) pi1 (1/20) 1 pi1 (1/20+1/8) pi0 (1/8+1/8) + pi2 (1/25+1/25) 2 pi2 (1/25+1/25) pi1 (1/8) But now, with just one repairperson, each instance of 1/8+1/8 becomes 1/8. So our new rates in and out are. state rate out rate in 0 pi0 (1/8) pi1 (1/20) 1 pi1 (1/20+1/8) pi0 (1/8) + pi2 (1/25+1/25) 2 pi2 (1/25+1/25) pi1 (1/8) findQ <- function() { q <- matrix(0,nrow=3,ncol=3) q[1,1] <- -0.125 q[1,2] <- 0.05 q[2,1] <- 0.125 q[2,2] <- -0.175 q[2,3] <- 0.08 q[3,2] <- 0.125 q[3,3] <- -0.08 q } print(findQ()) > print(findQ()) [,1] [,2] [,3] [1,] -0.125 0.050 0.00 [2,] 0.125 -0.175 0.08 [3,] 0.000 0.125 -0.08 5. # EX = c/2 # can use the integrate() function if you wish # EY = integral(0,c) t f_Y(t) dt # = integral(0,c) t t (1/c) / EX dt # = (c^3/3) (1/c) (2/c) # = 2/3 c # # EY / EX = 2/3 c / (c/2) = 4/3 print(4/3)