Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kr-stn/a11d913e782818367db6482b46455f1c to your computer and use it in GitHub Desktop.
Save kr-stn/a11d913e782818367db6482b46455f1c to your computer and use it in GitHub Desktop.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Likelyhood of being hit on the head by a falling rocket on new years eve\n",
"\n",
"*based on a true story*\n",
"\n",
"This new years eve a friend of mine was hit on the head by the debris of a rocket and had to spend the evening in the hospital. Being hit on the head seemed very unlikely to me, but how unlikely exactly? As a fan of the [TheyDidTheMath subreddit](https://www.reddit.com/r/theydidthemath/) I calculated how unlikely her new years eve was.\n",
"\n",
"tl;dr: It is pretty unlikely at circa 0.07 percent."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rockets sold in Germany\n",
"\n",
"As a starting point we take the number of rockets sold in Germany and expect all of them to be fired on new years eve. The expected sale of fireworks this year was 137,000,000 € of which 20% are rockets. Assuming an average price of 0.60€ per rocket this gives us:\n",
"\n",
"$rockets_{Germany} = 137000000 * 0.2 * 0.6 = 16440000$\n",
"\n",
"Source: [VPI - Verband der Pyrotechnischen Industrie (Association of the pyrotechnical industry)](http://www.feuerwerk-vpi.de/fileadmin/Dokumente-VPI/H%C3%A4ufig_gestellte_Fragen/FAQ_2017_final1.pdf)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"rockets_germany = 137000000 * 0.2 * 0.6"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rockets in Berlin-Kreuzberg\n",
"\n",
"My friend was hit on the head on a balcony in Berlin-Kreuzberg. Assuming the rockets are distributed evenly according to the population we can calculate the number of rockets in Kreuzberg as\n",
"\n",
"$rockets_{Kreuzberg} = \\frac{rockets_{Germany}}{\\frac{population_{Germany}}{population_{Kreuzberg}}}$\n",
"\n",
"Filling in the [current population numbers](https://de.wikipedia.org/wiki/Berlin-Kreuzberg) we get the number of rockets fired in Berlin-Kreuzberg on new years eve 2018.\n",
"\n",
"$rockets_{Kreuzberg} = \\frac{16440000}{\\frac{82670000}{153887}} = 30602$"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"population_germany = 82670000\n",
"population_kreuzberg = 153887\n",
"rockets_kreuzberg = rockets_germany / (population_germany / population_kreuzberg)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Likelyhood of being hit on the head\n",
"\n",
"We assume all debris from the rockets fired in Kreuzberg will also come back down on Kreuzberg. This should be reasonably close to the reality as most central Berlin districts have comparable population densities.\n",
"\n",
"We assume an average hit area ($area_{hit}$) of $0.25 m^2$. Due to the tumbling fall of the wooden sticks this should give a reasonable overlap with the head area viewd from above to ensure a hit.\n",
"\n",
"Furthermore I expect my friend to have stayed outside until all rockets have been fired (pretty unlikely but estimating a firing frequency in dependency of the time is a can of worms I won't open)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We take the basic formula for estimating the likelihood of a hit on the head from the excellent source [What is the mathematical probability of getting pooped on by a pigeon in NYC?](http://www.hopesandfears.com/hopes/now/math/215059-pigeon-poop-probability-nyc)\n",
"\n",
"$1-(1-\\frac{a}{A})^N$\n",
"\n",
"and include our values\n",
"\n",
"$1-(1-\\frac{area_{hit}}{area_{Kreuzberg}})^{rockets_{Kreuzberg}}$\n",
"\n",
"which gives us\n",
"\n",
"$1-(1-\\frac{0.25}{10380000})^{30602} = 0.000737$"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.0007367810200494818\n"
]
}
],
"source": [
"area_hit = 0.25\n",
"area_kreuzberg = 10.38 * 1000**2\n",
"probability = 1 - (1 - (area_hit / area_kreuzberg)) ** rockets_kreuzberg\n",
"print(probability)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The probability of being hit on the head be a falling rocket in Berlin-Kreuzberg is 0.000737 or circa 0.07 percent."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:s1_rice]",
"language": "python",
"name": "conda-env-s1_rice-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment