A mortality table gives the probability that a member of a population dies within a year at each age. In retirement modeling, it converts a fixed planning horizon into a lifespan-dependent horizon and makes longevity risk measurable. section 5.10
A practical implementation uses the publicly available RP-2014 table. Its pension-plan data may understate mortality because annuity purchasers can have longer life expectancies than workers choosing lump sums; Social Security tables may differ. section 5.10
Embedding mortality in a retirement simulation
For each simulated year, look up mortality_prob for the retiree's age and draw a uniform random number p. If p is below a 2% mortality probability, end that path at the year's end. Otherwise continue spending and wealth updates until death or bankruptcy. A 10,000-path example reports a 0.3686 probability of running out of money.
Replacing a fixed 30-year loop with a while loop allows each simulated retiree to die or exhaust wealth at a different age, producing a distribution of bankruptcy ages rather than one fixed endpoint. section 5.10
