# The Final Frontier

Randall of xkcd (which if you don’t read, you should really give it a try) posted yesterday about a somewhat morbid interest in actuarial tables which led to him writing a Python script one evening to calculate death probabilities for collections of people.

The script is included in the post, and he also demonstrated with sample output of both the remaining nine people who have walked on the moon as well as some of the key Star Wars actors.

I figured I would show Star Trek some love by running his script against the cast of both the original series and The Next Generation.

Let’s start with TNG, as it is slightly less depressing. I have included a few variations depending on who you would like to consider main cast:

TNG Cast: Patrick Stewart, Jonathan Frakes, LeVar Burton, Michael Dorn, Gates McFadden, Marina Sirtis, Brent Spiner

```
~$ python actuary.py 71m 59m 55m 59m 63f 57f 63m
There is a 5% chance of someone dying within 0.56 years (by 2013).
There is a 50% chance of someone dying within 6.06 years (by 2018).
There is a 95% chance of someone dying within 15.7 years (by 2028).
There is a 5% chance of everyone dying within 25.94 years (by 2038).
There is a 50% chance of everyone dying within 34.28 years (by 2046).
There is a 95% chance of everyone dying within 42.54 years (by 2055).
Probability of all dying in 1.0 year: <0.001%
Probability of a death within 1.0 year: 8.689%
```

Cast including Wil Wheaton (who left midway through the show’s run in season 4, with guest appearances thereafter):

```
~$ python actuary.py 71m 59m 55m 59m 63f 57f 63m 39m
There is a 5% chance of someone dying within 0.55 years (by 2013).
There is a 50% chance of someone dying within 5.94 years (by 2018).
There is a 95% chance of someone dying within 15.51 years (by 2028).
There is a 5% chance of everyone dying within 30.21 years (by 2042).
There is a 50% chance of everyone dying within 41.59 years (by 2054).
There is a 95% chance of everyone dying within 55.39 years (by 2067).
Probability of all dying in 1.0 year: <0.001%
Probability of a death within 1.0 year: 8.890%
```

Cast including Denise Crosby and Diana Muldaur (both of whom were main cast for one season):

```
~$ python actuary.py 71m 59m 55m 59m 63f 57f 63m 54f 73f
There is a 5% chance of someone dying within 0.42 years (by 2012).
There is a 50% chance of someone dying within 4.77 years (by 2017).
There is a 95% chance of someone dying within 13.22 years (by 2025).
There is a 5% chance of everyone dying within 31.98 years (by 2044).
There is a 50% chance of everyone dying within 42.43 years (by 2054).
There is a 95% chance of everyone dying within 55.4 years (by 2067).
Probability of all dying in 1.0 year: <0.001%
Probability of a death within 1.0 year: 11.48%
```

And then we have TOS: William Shatner, Leonard Nimoy, Nichelle Nichols, George Takei, Walter Koenig (as sadly DeForest Kelley and James Doohan have passed):

```
~$ python actuary.py 81m 81m 79f 75m 75m
There is a 5% chance of someone dying within 0.17 years (by 2012).
There is a 50% chance of someone dying within 2.24 years (by 2014).
There is a 95% chance of someone dying within 7.32 years (by 2019).
There is a 5% chance of everyone dying within 9.23 years (by 2021).
There is a 50% chance of everyone dying within 15.94 years (by 2028).
There is a 95% chance of everyone dying within 23.39 years (by 2035).
Probability of all dying in 1.0 year: <0.001%
Probability of a death within 1.0 year: 25.03%
```

And there we have it. As I said above, you should check out xkcd.

## Comments