Exercise

Deferred mortality probabilities

In this exercise, you will help Cynthia to better understand the concept of a \(k\)-year deferred mortality probability for an 18-year-old. This is the probability that one first survives \(k\) years, reaches age \(18+k\) and then dies in the next year:

$$ \begin{aligned} {}_{k|}q_{18} &= {}_kp_{18} \cdot q_{18+k}. \end{aligned} $$ These probabilities with \(k = 0, 1, 2, \ldots\) determine a discrete probability distribution. They run over all possible ages at death for the 18-year-old and express the corresponding probability to die at each of these ages.

The mortality rates \(q_x\) and the one-year survival probabilities \(p_x\) have been preloaded as qx and px.

Instructions

100 XP
  • Define kpx as the survival probabilities \({}_kp_{18}\) of an 18-year-old for \(k = 0, 1, 2, \ldots\)
  • Assign the deferred mortality probabilities \({}_{k|}q_{18}\) to the variable kqx by multiplying kpx with the mortality rates qx from 18 + 1 until length(px).
  • Compute the sum() of kqx to verify that it equals one.
  • Visualize the kqx against 0:(length(kqx) - 1).