# 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 thoughts on “A morbid Python script”

1. Very interesting, how did anyone even think of that?

Like

2. My physics teacher elektrikçi used your comic 435 “physicist character” in a slide today in class; Awesome!

Like

3. The message of Groundhog Day is that Bill’s character can progress in time when he finally learns to kombi su eksiltmesi love unselfishly. Implication is that God has put him in the time loop.

Like

4. information about the people in question will refine the calculation. For example, I’d guess former astronauts are ben bu yazıya anlama veremedın nedıyor ?

Like

5. interesting fact

Like

6. ppareOn second thought, they’ve ears antly been here for 2 yalrea

Like

7. Kings room’s thanks you yes o tead’s

Like

8. interesting fact

Like

9. Very interesting, how did anyone

Like

10. para América Latina y director de

Like

11. I LOVE Morbid Python! Those guys are so funny! Morbid Python’s Flying Saucer is one of my favorite shows. Oh man, you write scripts for that show? Cool!

Like

12. online medikal ürünmler ve sais

Like

13. The fact that astronauts have passed through the radiation zones/areas with little protection from Earth’s magnetosphere practically guarantee them having cataracts within their lifespan. For all we know, they might not be expected to live longer than the average human being due to factors like that outweighing their time at peak physical fitness.

Like

14. Well, Niel Armstrong did die within a month of this post!

Like

15. Exposure to direct cosmic rays is improving life expectancy! Good.

Like

16. Good and interesting blog, thanks.

Like

17. Thank you nice blog.

Like

18. Looking at most of the comments on this page I’m half expecting a Viking choir… Also, captcha is telling me it’s andtAgar time.

Like

19. Kako ono rece sinoc u “spektru” Ante Nobilo:Zalosno je sta HDZ Bosne i Hercegovine uopce nije promjenio politiku i namjere u svezi odcjepljenja…….Pretpostavljam da taj dragan covic radi za UDBU,jer do 1991. se je pisao jugoslavenom i potpisivao cirilicom.Hocu reci nije vjerovati ovim sta stalno isticu svoje hrvatstvo,jer mi to jako smrdi na spijune,kukavice,provokatore i placenike stranih obavjestajnih sluzbi.Hm,mozda grijesim,ali uvijek su tu sa svojim komentarima i udaraju u iste bubnjeve….hm

Like

20. tebi izgleda jos nije jasno da clanovi hdz-a popunjavaju, mozemo slobodno reci polovicu stranke, partije, kako hoces.. jugoslaveni, ostatak su hrvati i nesto ostalih mish-mash. slicno igranje brojki desava se u sdp-u, s time da su hrvati silom prilika prebaceni u mish-mash lonac dok su srbi ostatak! zdravo sumnjicavi

Like

21. Situated just opposite Elias Mall and within close proximity to Downtown East, White Sands Shopping Centre, IKEA Tampines, Courts Megastore and Giant, future residents a vibrant variety of retail and dining options within walking distance from their home

Like

22. Keppel Bay is a true Ocean Front living, the very best in urban and waterfront lifestyles. Just five minutes’ drive away from the Central Business District, yet nestled in one of Singapore’s best-loved nature and recreation enclaves.

Like

23. Become A Total Badass At Meeting And Attracting Women. This site is a leading resource for information about the Joshua Pellicer Tao Of Badass PDF book and attraction system that helps average, everyday men find and attract amazing women. Includes a collection of PDF reviews, download

Like

24. Competition has also knocked the doors of Internet market. There is no such website which is not under the impact of this competition. So, in this situation every website owner needs to adopt some different and unique strategies.

Like

25. On the other hand, it is also true that search engine algorithms are never constant. They keep on updating themselves to keep everything genuine and original. To make your website SEO friendly, one needs to hire a professional or SEO expert.

Like

26. When it comes to SEO London service, one can say that the professionals there offer white hat SEO services at affordable price range. These services are offered to improve the visibility of any website running on the internet.

Like

27. Once the visibility is improved, you will get more traffic and customers which ultimately leads to high sales. Now-a-days even Software Developer UK are optimizing SEO techniques in development of the sites. So, hire an expert carefully and get benefited.

Like

28. Belgravia Villas is located in a central location where there are plenty of amenities in the vicinity within a short driving distance to Ang Mo Kio Hub, NEX, Compass Point, Orchard and Bugis area. Dining, shopping and recreation options for you and your loved ones are just a stone’s throw away

Like

29. Your code sure was a nightmare of style errors, but I finally brought it in line with the PEP8 Python style guide. Just in case you didn’t know: always surround = == > < with spaces, there's no need for brackets in while statements, and no line may be more than 79 characters long. http://www38.zippyshare.com/v/23165197/file.html

Like

30. I’m trying deploy a Python application on Windows as a folder that includes a full python 2.6 folder. I don’t need/want a fancy solution like py2exe, I’m just trying to automate deployment of a web application.

Like

31. I know this web site offers quality dependent articles
or reviews and other material, is there any other website which provides such information in quality?

Like

32. Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.
Hi, I am 14 year old and quit high school to get to Bronze IV. I left house to play league of legends everyday but i crie evrytiem. Plz surry for my englando. Plz no capi pasterino.

Like

33. Now-a-days even Software Developer UK are optimizing SEO techniques in development of the sites.

Like

34. Could you add a license with your python script (and a date and a statement of authorship)? It would clarify a bit what you mean. Or put it in the public domain if that’s really what you mean.

If you mean to share code, putting it on github would be excellent.

Like

35. Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. The language provides constructs intended to enable clear programs on both a small and large scale.

Like

36. How much would these percentages change if you also calculated the chance that there is a serial killer that hates star wars?

Like