Session Ready
Exercise

Temporary life insurance

Ethan wonders how the EPV of a life insurance changes in case the coverage is restricted in time, as shown in the figure below.

He first calculates the EPV of a whole life insurance for a 20-year-old at an interest rate \(i = 2\%\) and using the preloaded life_table for females in Belgium in 1999.

Starting from the function whole_life_insurance() created in the previous exercise, can you assist Cynthia in writing a function for a temporary life insurance?

Instructions
100 XP
  • Define the function temporary_life_insurance() which computes the EPV for a temporary life insurance. Besides the recurring arguments age, i and life_table, the function now takes an additional argument n indicating the number of years the life insurance coverage holds.
  • Use your newly defined temporary_life_insurance() function to calculate how the EPV of the life insurance of (20) at rate 2% changes when the coverage is restricted to a period of 45 years.