A morbid Python script

Comics #493 and #893 involve actuarial tables, which are tables for calculating the probability that someone of a given age will die within a given amount of time.

One evening, when I was feeling morbid, I wrote a Python script to calculate death probabilities for any collection of people: actuary.py (.txt). It takes a list of ages and genders and produces various statistics. Here’s the report for the nine living people who have walked on the moon:

~$ python actuary.py 81m 82m 80m 81m 80m 81m 76m 78m 77m
There is a 5% chance of someone dying within 0.08 years (by 2012).
There is a 50% chance of someone dying within 1.1 years (by 2013).
There is a 95% chance of someone dying within 4.08 years (by 2016).

There is a 5% chance of everyone dying within 10.78 years (by 2023).
There is a 50% chance of everyone dying within 16.12 years (by 2028).
There is a 95% chance of everyone dying within 22.57 years (by 2035).

Probability of all dying in 1.0 year: <0.001%
Probability of a death within 1.0 year: 46.32%

And here’s the table for four of the main stars of the original Star Wars (Harrison Ford, Carrie Fisher, Mark Hammill, James Earl Jones):

~$ python actuary.py 69m 55f 60m 81m 10
There is a 5%  chance of someone dying within 0.42 years (by 2012).
There is a 50% chance of someone dying within 4.74 years (by 2017).
There is a 95% chance of someone dying within 12.83 years (by 2025).

There is a 5%  chance of everyone dying within 18.17 years (by 2030).
There is a 50% chance of everyone dying within 31.28 years (by 2043).
There is a 95% chance of everyone dying within 42.62 years (by 2055).

Probability of all dying in 10.0 years:   0.272%
Probability of a death within 10.0 years: 85.94%

Of course, these are based on average death rates based only on age and gender. Adding more specific information about the people in question will refine the calculation. For example, I’d guess former astronauts are more likely to be in good health—and have longer life expectancies—than the rest of us.

Groundhog Day correction

A number of people have mentioned an issue with today’s comic—in the movie Groundhog Day, it’s actually implied that Phil, Bill Murray’s character, didn’t have sex with Rita. He took her home to his room, but they woke up in the same clothes they fell asleep in. I haven’t seen the movie in a number of years, but I think they’re right—and bit of Googling suggests that I’m not the only one who was confused on that point.

Groundhog Day is, like Office Space, a comedy containing a gimmick that really sticks with you, even as the rest of the story fades. Or, at least, it did with me—I’ve probably seen the movie a couple of times, but I think I’ve spent a lot more time dwelling on the time loop scenario it describes. Now that people have raised the question, I’m not even sure that I interpreted the scene this way when I was watching it.

From a sci-fi point of view, the whole idea that the time loop was broken by emotional/personal development seemed kind of cheesy, but I just chalked that up to one of those things movies do because that’s how we like stories to work. Nobody wants a movie where the climax consists of an hour of excitedly inferring and testing revisions to the standard model of physics. (Or, at least, there aren’t enough of us to support a big-budget movie.) So while drawing my comic, I remembered that the time loop ended after he took Rita back to his room, and I filled in the typical romanticized Sleeping Beauty idea that I assumed had gone with it.

I appreciate the corrections—in addition to being a reminder to double-check pop culture references, it’s driven home for me what a neat, original movie Groundhog Day really is.

And now I wonder what kind of misconceptions I have about Ghostbusters.