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. Fantástico post me gusta el documento apreciar el método que usted describió las cosas, lo hace una gran carrera la mayoría de los otros que usted a través de ese tipo de útiles sitios de información actual de la conciencia para ser capaces de personas vinculadas a muchos puntos. Yo estudio algunos otros sitios web interesantes fuera de sus sitios web, además de mi negocio es mucho dedica la utilización de su capacidad de blogs, mi esposo y yo también empezó a escribir blogs sitios que tipo de hecho guían a todo el mundo.

    Like

  2. Bobby didn’t simply shun the questions when asked about the Report, rather than seeming to give it even an ounce of credibility. My wife used hers in Paris on a bus one day when a pickpocket had his hand in my pocket and I didn’t notice. (error may be flashing) The paper light should be on or flashing. http://www.hundehaftpflichtberater.com

    Like

  3. The is one of Christian’s most popular products that helps men not only find and attract amazing women, but ultimately turn them into loving, loyal, and long-lasting girlfriends… amway opinie

    Like

  4. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time amway polska

    Like

  5. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. słoiczki gerber

    Like

  6. This is a nice content with lots of information. It’s a very excellent idea for raising money for charity. I think honest review is more important for authors. I like your whole discussion. Keep it up.
    Keep blogging.ur site is good.and finelly ur site going to in high position

    Like

  7. Este artículo tiene todo! Estoy construyendo un nuevo proyecto con algunos de mis colegas y yo en serio necesitaba algo de información que podría tener el proyecto en marcha. Gracias a ti he descubierto que la información

    Like

  8. So many blog comments are bit droppings. Thanks for xkcd, it touches people. Some people tag their lives with xkcd numbers, and their friends understand (I have to consult the source). Many thanks. When I think if something clever enough for xkcd, i’ll send it to you.

    Like

  9. Looks cool, I never knew you could post about it, good to know thanks! You show very latest and important things. This is very nice post! I will bookmark this blog hemorrhoid no more

    Like

  10. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more … good luck my thoughts

    Like

  11. This is a really good post this. Truly, a magnificent art is making an article. And you are quite a master at that art. I would tell you to keep on continuing this awesome work of yours 60 second panic solution

    Like

  12. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. my review

    Like

  13. Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well i really get amazed to read this. Its really good cosplay

    Like

  14. Your fabulous machine contains a stunning content and intensely necessary knowledge that provide tree State new issue to explore in my project. I found what i truly demanded. storage units Menifee CA

    Like

  15. 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. htc one m8 covers

    Like

  16. I am very happy to read this. This is the kind of manual that needs to be given and not the random misinformation t hat’s at the other blogs. Appreciate your sharing this best posting. http://www.ge.tt/

    Like

  17. I experience bad for children known as Something Jr, or Something II/III. Give children their own names. chin

    Like

  18. Great publish i have to admit and thanks for the tips. Education is certainly a sticky subject. However, continues to be one of the leading subjects in our time. I thank you for publish and anticipate more. how to attract your ex back

    Like

  19. What other contractor can say they were involved in the design process of an all-electric service vehicle? Not many! Robichaud is a great example of a contractor on the cutting-edge of technology. Expensive Handbags

    Like

  20. Is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. Marreena

    Like

  21. My recommendation, if you have this printer, is to research all the tricks to fool the printer into using the toner that is left in the cartridge, and to have an extra brand new cartridge waiting for the “emergency” when it quits using what’s left. next story

    Like

  22. Ahaa, its pleasant discussion concerning this paragraph here at this website,
    I have read all that, soo at this time me also commenting at this place. address

    Like

  23. It involved a grainy picture of a deliver in a Japanese individuals harbour plowing through an unimpressive-looking range of breakers. Rae Hoffman

    Like

  24. Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. next story

    Like

  25. If there is one thing that we’re really good, it’s helping people get the attention they want on social media. next story

    Like

  26. Again, a kid with a Happy Meal is getting up useful cafe property. You and your partner fit a two-top. You and your partner and your Happy Meal-toting kid take up a four-top. my response

    Like

Comments are closed.

%d bloggers like this: