A stationary Markov chain has the following transition matrix.

Interest is a constant 5%. Find the APV of the following contracts based on this chain, both issued when the process is in state 0.
(a) An temporary annuity provides 100 per year, beginning when the process enters state 1 and stopping when the process leaves state 1. Payments do not resume upon re-entry to state 1. The last possible payment is at the end of 4 years.
(b) A 7-year term insurance pays 100 at the end of the year of the first transfer from state 0 to state 2, provided that that prior to this time there was a transfer from state 1 to state 0. If a transfer from state 0 to state 2 occurs before a transfer from state 1 to state 0, then nothing is paid.