# 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.

## 382 replies on “A morbid Python script”

1. sultankhan1212 says:

My spouse and I absolutely love your blog and find almost all of your post’s to be just what I’m looking for. can you offer guest writers to write content for you? I wouldn’t mind producing a post or elaborating on a number of the subjects you write concerning here. video at leaks fix

Like

2. junrameha1985 says:

Conceivably alternatively of doing an injunction also letting a person’s customers drive around with vulnerable software, farrahnewsextape.com should partner with the capability additionally update all their customers vehicles.

Like

3. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents.

Like

4. Thanks for your personal marvelous posting! I truly enjoyed reading it, you may be a great author.I will ensure
that I bookmark your blog and definitely will come back in the future.

I want to encourage you to definitely continue your great writing, have
a nice holiday weekend!

Like

5. tumecouket1985 says:

Here was also nominated for best loved dramatic movie.

Like

6. Good to become visiting your weblog again, it has been months for me. Nicely this article that I’ve been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share. blinds company manchester

Like

7. diaminsdeta1981 says:

Leightonrevealed.com, a few months after bringing a person’s lawsuit, his attorneys doubted that it are likely to breakdown any where although a award at trial.

Like

8. hoysewalddream1986 says:

No such luck ray j one of my schools, my accommodation am downright frigid.

Like

9. conslinlorigh1978 says:

She stole a bottle of hoopzunmasked.xom additionally drank it along with then accomplished a automatic art on a hotel roof.

Like

10. tusslenaring1975 says:

My first black bunkmate ended up stealing my car to go buy a swisher at like 7Teen Mom.

Like

11. RoseLChambers says:

There may be details in the activities that you don’t would like to locate your son or little girl to, and the only method you’ll know is by experiencing for the little while very first. he has a good point

Like

12. This blog is a great source of information which is very useful for me.

Like

13. williama says:

Though even residence loss can be pretty frustrating and frustrating, you should know that most flame broken houses can be renewed to their old self. additional reading

Like

14. Best School says:

Best School University.net and Best School University.com provide coaching of ‘pick up from home and work’ to adults afraid or nervous in producing. The latter school even provides such coaching free. http://smartdrivinglesson.yolasite.com/

Like

15. Realmente impresionado después de leer esto porque de algún trabajo de calidad y pensamientos informativos.

Like

16. There is nothing says:

Some people are very fond of reading books will be able to distinguish the best book as a guide and a book that is not good. It all depends with your reading experience.

Like

17. There is nothing says:

Nussbaum said fundraising efforts are underway to create a similar program next year for 25 farms in the Snoqualmie, Skagit and other watersheds. this link

Like