Exercise

# Multiplication rules!

Cynthia is fascinated by the multiplication rule applicable to survival probabilities. She wants to verify her earlier calculated probabilities using this rule. But let's start slowly. What is the probability that she (an 18-year-old) will be alive when she is supposed to graduate from her \(3 + 2\) year bachelor and master program?

Next, you will calculate \(_kp_x\) for \(x\) an 18-year-old female and \(k=1,2,3, \ldots\) What is the probability for an 18-year-old to reach the magic number of 100?

The column `qx`

extracted from `life_table`

has been preloaded. The one-year survival probabilities `px`

have been defined as one minus the mortality rates `qx`

.

Instructions

**100 XP**

- Compute the probability of an 18-year-old to turn 23 using
`prod()`

. - Define
`kpx`

as the multi-year survival probabilities of an 18-year-old until the age of 100 using`cumprod()`

. - Print the probability of an 18-year-old to reach the magic number of 100.
- Visualize the multi-year survival probabilities by plotting
`kpx`

against a vector from 1 until the`length()`

of`kpx`

.