"Flights without incidents do not provide any information\n",
"Flights without incidents do not provide any information\n",
"on the influence of temperature or pressure on malfunction.\n",
"on the influence of temperature or pressure on malfunction.\n",
"We thus focus on the experiments in which at least one O-ring\n",
"We thus focus on the experiments in which at least one O-ring\n",
"was defective."
"was defective.\n",
"\n",
"### =====\n",
"They filtered out all flights with zero malfunctions, which is a problem because now the data only shows cases where something went wrong. This makes it impossible to see how temperature actually affects failures across all flights.\n",
"\n",
"--> Keep all flights, including those without malfunctions, so the model can learn the real failure probability"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 2,
"execution_count": 8,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -351,6 +356,14 @@
...
@@ -351,6 +356,14 @@
" </thead>\n",
" </thead>\n",
" <tbody>\n",
" <tbody>\n",
" <tr>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>4/12/81</td>\n",
" <td>6</td>\n",
" <td>66</td>\n",
" <td>50</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <th>1</th>\n",
" <td>11/12/81</td>\n",
" <td>11/12/81</td>\n",
" <td>6</td>\n",
" <td>6</td>\n",
...
@@ -359,6 +372,54 @@
...
@@ -359,6 +372,54 @@
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3/22/82</td>\n",
" <td>6</td>\n",
" <td>69</td>\n",
" <td>50</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>11/11/82</td>\n",
" <td>6</td>\n",
" <td>68</td>\n",
" <td>50</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>4/04/83</td>\n",
" <td>6</td>\n",
" <td>67</td>\n",
" <td>50</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>6/18/82</td>\n",
" <td>6</td>\n",
" <td>72</td>\n",
" <td>50</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>8/30/83</td>\n",
" <td>6</td>\n",
" <td>73</td>\n",
" <td>100</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>11/28/83</td>\n",
" <td>6</td>\n",
" <td>70</td>\n",
" <td>100</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <th>8</th>\n",
" <td>2/03/84</td>\n",
" <td>2/03/84</td>\n",
" <td>6</td>\n",
" <td>6</td>\n",
...
@@ -383,6 +444,22 @@
...
@@ -383,6 +444,22 @@
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>10/05/84</td>\n",
" <td>6</td>\n",
" <td>78</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>11/08/84</td>\n",
" <td>6</td>\n",
" <td>67</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <th>13</th>\n",
" <td>1/24/85</td>\n",
" <td>1/24/85</td>\n",
" <td>6</td>\n",
" <td>6</td>\n",
...
@@ -391,6 +468,54 @@
...
@@ -391,6 +468,54 @@
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>4/12/85</td>\n",
" <td>6</td>\n",
" <td>67</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>4/29/85</td>\n",
" <td>6</td>\n",
" <td>75</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>6/17/85</td>\n",
" <td>6</td>\n",
" <td>70</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>7/29/85</td>\n",
" <td>6</td>\n",
" <td>81</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>8/27/85</td>\n",
" <td>6</td>\n",
" <td>76</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>10/03/85</td>\n",
" <td>6</td>\n",
" <td>79</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <th>20</th>\n",
" <td>10/30/85</td>\n",
" <td>10/30/85</td>\n",
" <td>6</td>\n",
" <td>6</td>\n",
...
@@ -399,6 +524,14 @@
...
@@ -399,6 +524,14 @@
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>11/26/85</td>\n",
" <td>6</td>\n",
" <td>76</td>\n",
" <td>200</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <th>22</th>\n",
" <td>1/12/86</td>\n",
" <td>1/12/86</td>\n",
" <td>6</td>\n",
" <td>6</td>\n",
...
@@ -412,22 +545,38 @@
...
@@ -412,22 +545,38 @@
],
],
"text/plain": [
"text/plain": [
" Date Count Temperature Pressure Malfunction\n",
" Date Count Temperature Pressure Malfunction\n",
"0 4/12/81 6 66 50 0\n",
"1 11/12/81 6 70 50 1\n",
"1 11/12/81 6 70 50 1\n",
"2 3/22/82 6 69 50 0\n",
"3 11/11/82 6 68 50 0\n",
"4 4/04/83 6 67 50 0\n",
"5 6/18/82 6 72 50 0\n",
"6 8/30/83 6 73 100 0\n",
"7 11/28/83 6 70 100 0\n",
"8 2/03/84 6 57 200 1\n",
"8 2/03/84 6 57 200 1\n",
"9 4/06/84 6 63 200 1\n",
"9 4/06/84 6 63 200 1\n",
"10 8/30/84 6 70 200 1\n",
"10 8/30/84 6 70 200 1\n",
"11 10/05/84 6 78 200 0\n",
"12 11/08/84 6 67 200 0\n",
"13 1/24/85 6 53 200 2\n",
"13 1/24/85 6 53 200 2\n",
"14 4/12/85 6 67 200 0\n",
"15 4/29/85 6 75 200 0\n",
"16 6/17/85 6 70 200 0\n",
"17 7/29/85 6 81 200 0\n",
"18 8/27/85 6 76 200 0\n",
"19 10/03/85 6 79 200 0\n",
"20 10/30/85 6 75 200 2\n",
"20 10/30/85 6 75 200 2\n",
"21 11/26/85 6 76 200 0\n",
"22 1/12/86 6 58 200 1"
"22 1/12/86 6 58 200 1"
]
]
},
},
"execution_count": 2,
"execution_count": 8,
"metadata": {},
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result"
}
}
],
],
"source": [
"source": [
"data = data[data.Malfunction>0]\n",
"# data = data[data.Malfunction>0] --> no filter\n",
"data"
"data"
]
]
},
},
...
@@ -435,21 +584,23 @@
...
@@ -435,21 +584,23 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"We have a high temperature variability but\n",
"<!-- We have a high temperature variability but\n",
"the pressure is almost always 200, which should\n",
"the pressure is almost always 200, which should\n",
"simplify the analysis.\n",
"simplify the analysis. -->\n",
"\n",
"First, let's simplify the analysis with pressure is 200\n",
"\n",
"\n",
"How does the frequency of failure vary with temperature?"
"How does the frequency of failure vary with temperature?"
"The most likely estimator of the temperature parameter is 0.0014\n",
"The estimated coefficient for Temperature is -0.116 with a standard error of 0.115, which means we cannot confidently say that Temperature has a significant effect on O-ring failure. These estimates should be interpreted with caution."
"and the standard error of this estimator is 0.122, in other words we\n",
"cannot distinguish any particular impact and we must take our\n",
"estimates with caution."
]
]
},
},
{
{
...
@@ -596,17 +744,21 @@
...
@@ -596,17 +744,21 @@
"\n",
"\n",
"The expected temperature on the take-off day is 31°F. Let's try to\n",
"The expected temperature on the take-off day is 31°F. Let's try to\n",
"estimate the probability of O-ring malfunction at\n",
"estimate the probability of O-ring malfunction at\n",
"this temperature from the model we just built:"
"this temperature from the model we just built:\n",
"\n",
"\n",
"### ==================\n",
"A problem I find very confusing is that they said, \"These estimates should be interpreted with caution\" (even in the original analysis), but then they still relied on the model’s predictions and used those results to justify their reasoning. ????!"
"Using the updated analysis, the predicted probability of O-ring failure clearly decreases as temperature increases, forming a curve across the observed range. This shows that at low temperatures like 31°F, the risk is much higher than the simple average would suggest, highlighting the danger under extreme conditions."
"temperature has no significant impact on the probability of failure of the\n",
"O-rings. It will be about 0.2, as in the tests\n",
"where we had a failure of at least one joint. Let's get back\n",
"to the initial dataset to estimate the probability of failure:"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 6,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"# The code below is disregarded because the risk of O-ring failure strongly depends on temperature.\n",
"print(\"Predicted probability of O-ring failure at 31°F:\", p_challenger)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Prob for both joints: 0.6687549795701869\n",
"Prob for any one of launchers: 0.963654715320592\n"
]
}
],
"source": [
"print(\"Prob of failure for both joints: \", p_challenger**2)\n",
"print(\"Prob of failure for any one of launchers: \", 1-(1-p_challenger**2)**3)"
]
]
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"This probability is thus about $p=0.065$. Knowing that there is\n",
"This probability is thus about p ≈ $0.818$. Knowing that there is a primary and a secondary O-ring on each of the three parts of the launcher, the probability of failure of both joints of a launcher is $p^2 \\approx 0.669$. The probability of failure of any one of the launchers is $1-(1-p^2)^3 \\approx 96.4\\%$. This is drastically higher than the old average-based estimate of p ≈ 0.065, which underestimated the risk because it ignored the extreme temperature on the launch day."
"a primary and a secondary O-ring on each of the three parts of the\n",
"launcher, the probability of failure of both joints of a launcher\n",
"is $p^2 \\approx 0.00425$. The probability of failure of any one of the\n",
"launchers is $1-(1-p^2)^3 \\approx 1.2%$. That would really be\n",
"bad luck.... Everything is under control, so the takeoff can happen\n",
"tomorrow as planned.\n",
"\n",
"But the next day, the Challenger shuttle exploded and took away\n",
"with her the seven crew members. The public was shocked and in\n",
"the subsequent investigation, the reliability of the\n",
"O-rings was questioned. Beyond the internal communication problems\n",
"of NASA, which have a lot to do with this fiasco, the previous analysis\n",
"includes (at least) a small problem.... Can you find it?\n",
"You are free to modify this analysis and to look at this dataset\n",
"from all angles in order to to explain what's wrong."