News for hackers. Stuff that matters.
Re:NASA advisers say SpaceX rocket technology could put live... by ebbv on Sunday May 06, 2018 @02:15PM (#17007516)
Oh my lord you guys that is not how probabilities work. You can’t look at what actually happened and then say “Well that was the chance.” If I flip a coin 20 times and happen to end up with a 15:5 split that doesn’t mean the chance of heads is 3:1.

Also the context of that 1 in 12 in the quote is important. They’re saying that was the chance on the first flight in retrospect. The shuttle and it’s supporting facilities and processes didn’t stay static, they improved over time.

Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Sunday May 06, 2018 @02:33PM (#17007616)
>Oh my lord you guys that is not how probabilities work. You can’t look at what actually happened and then say “Well that was the chance.” If I flip a coin 20 times and happen to end up with a 15:5 split that doesn’t mean the chance of heads is 3:1.

Erm, over a large sample size, yes this is exactly how things work. Sure 15/5 may be too small, but 150/50 isn't. That's well after the point where its reasonable to believe that your coin is rigged.

As the other user mentioned, if you don't have the prior that the coin is fair, a 15/5 outcome may (and does) indeed imply that heads are more likely than tails. In fact, 15/5 would imply a less than 1% chance of a fair coin, given uniform priors. (Beta[15, 5] -> 1st percentile is 50.175)

Re:NASA advisers say SpaceX rocket technology could put live... by pps43 on Sunday May 06, 2018 @02:43PM (#17007667)
But in this case the samples are small. If you flip a coin once and got tails, what is the probability of heads?
Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Sunday May 06, 2018 @02:58PM (#17007769)
That's not quite the same question as what I'm answering. I'm saying "given you flip a coin once and it comes up heads, what is the probability that its a fair coin" (or previously, given you flipped a coin 20 times, and it came up 15/5, what is the likelyhood it is a fair coin). And with a single flip, you can't actually answer that question (BetaDist[1, 0] is undefined).

Now, once you've answered that question, you can integrate to get a probability that the next coin is heads, but with a single flip you can't even answer the first question. You need to have gotten heads and tails each at least once.

Re:NASA advisers say SpaceX rocket technology could put live... by isostatic on Sunday May 06, 2018 @04:19PM (#17008277)
Flip a coin 50 times and get 50 heads, it's almost impossible it's a fair coin. Does your BetaDist function work in that case?
Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Sunday May 06, 2018 @04:35PM (#17008366)
No, the beta distribution BetaDist[a, b] is only defined for a, b strictly > 0.

When a or b is very large and the other is zero, you can treat it as 1 and get a decent approximation, but it'll be a an estimate that biases towards the center.

Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Monday May 07, 2018 @03:34PM (#17015751)
I should also mention that if you're willing to make assumptions like a uniform prior, this totally works, but it can lead to some surprising results for small a, b. Notably a uniform prior is Beta[1, 1]. Beta[2,1] implies something like a 75% chance of the true mean being above .5, which seems a tad overzealous.
Re:NASA advisers say SpaceX rocket technology could put live... by pps43 on Sunday May 06, 2018 @04:40PM (#17008395)
Exactly, that's not the question you're answering, but it is the question that is being asked in this context: what is the probability of rapid unplanned disassembly of SpaceX rockets.
Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Monday May 07, 2018 @12:04AM (#17010322)
Hence the "but you can integrate to answer that".

If your rocket has a 50% chance of being explosion proof and a 50% chance of blowing up half the time (you could imagine this as any number of situations, like two otherwise identical rockets which you use), any given launch has a 25% chance of rapid unplanned disassembly.

You can do the same thing over a continuous random variable.

Re:NASA advisers say SpaceX rocket technology could put live... by pps43 on Monday May 07, 2018 @04:31PM (#17016241)
But you know neither the chance of the new rocket being explosion proof, nor the chance of the rocket blowing up half the time.

You built the rocket, launched it once, and it did not blow up. What should be integrated to get the probability of rapid unplanned disassembly?

Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Monday May 07, 2018 @05:15PM (#17016548)
Enter the Beta(variate) distribution.

The beta distribution[1] is a cool statistical distribution defined by BetaDist{a,b} (or alpha, beta, but that's too much work), where a is the number of successes and b is the number of failures you've sampled.

It has a number of cool properties, chief among them that given X = BetaDist{a,b}, then cdf(X, x) = the probability that the mean of the distribution you are approximating is less than x. It has a bunch of other nice properties too (like E[X] = a / (a + b), which should be obvious), but those aren't as relevant here.

So let's say that you assume a uniform prior. This is defined as BetaDist{1,1} [2]. this is probably the wrong prior. So you might have a better idea. If, for example, you believe there is a 10% chance of your rocket exploding based on some calculations you've done, you might use a differently tuned beta distribution, like BetaDist{9,1} or BetaDist{4.5,.5} if you were feeling uncertain (but in general it would likely be better to use {8,2} in that situation iirc). But let's assume {1,1} for now.

So you launch your rocket. Everything goes great. You update your distribution. Its a success. So you get BetaDist{2,1} [3]. So what is the chance your rocket explodes? Well the cdf of your beta distribution is the probability that the mean is less than x. So the pdf of the beta distribution is the probability that the mean is exactly x. So then

The integral from 0 -> 1 of `(1 - x) * pdf(X, x) dx` is the estimated probability that your rocket explodes on its next launch, since that's "for every value x, the likelyhood of the distribution being that one multiplied by the chance your rocket explodes given that distribution". For the one rocket case, this happens to be equal to E[X] = a / (a + b), so it's 1/3.

For the two rocket case, you apply reinforcement learning/k-armed bandit strategies like UBC1[4] or Thompson Sampling[5]. These are algorithms that will result in you picking the best rocket with as few unnecessary explosions as possible, provably.

You can see some related discussion I've had on HN about these algorithms [6].

[1]: https://en.wikipedia.org/wiki/Beta_distribution

[2]: http://www.wolframalpha.com/input/?i=beta+distribution+(1,1)

[3]: http://www.wolframalpha.com/input/?i=beta+distribution+(2,+1...

[4]: http://banditalgs.com/2016/09/18/the-upper-confidence-bound-...

[5]: https://en.wikipedia.org/wiki/Thompson_sampling

[6]: https://news.ycombinator.com/item?id=17014232

Re:NASA advisers say SpaceX rocket technology could put live... by pps43 on Monday May 07, 2018 @07:50PM (#17017488)
Wouldn't it be easier to just add one success and one failure and calculate (events+1)/(trials+2) instead of events/trials?
Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Tuesday May 08, 2018 @12:16PM (#17022064)
I'm not sure what you mean.
Re:NASA advisers say SpaceX rocket technology could put live... by pps43 on Tuesday May 08, 2018 @01:13PM (#17022614)
I'm talking about pseudocounts (add one success and one failure) [1] or maybe Agresti-Coull estimator (add two successes and two failures) [2].

[1] https://en.wikipedia.org/wiki/Rule_of_succession

[2] http://users.stat.ufl.edu/~aa/articles/agresti_coull_1998.pd...

Re:NASA advisers say SpaceX rocket technology could put live... by ebbv on Sunday May 06, 2018 @03:15PM (#17007876)
Yes if you actually run an experiment with real sample sizes you can begin to form hypothesis around and unknown probability.

But my point was you cannot look at a historical event and say "Well this happened, so that was the chance." That's the basis for the silly internet joke "The chance is 50/50, either it happens or it doesn't."

Which is what the people I replied to were doing.

Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Sunday May 06, 2018 @03:38PM (#17008022)
>But my point was you cannot look at a historical event and say "Well this happened, so that was the chance."

If the event happens repeatedly, you absolutely can! If someone attempts something 20 times, and it works 10 of them, you can conclude that there's an approximately 50% chance of success. You have a sample size! The exact same thing is true for a statement like "the chance of an astronaut dying is approximately 1 in 25". We have the sample size to show that.

>That's the basis for the silly internet joke "The chance is 50/50, either it happens or it doesn't."

No, that's totally different. That's a misunderstanding of priors. What you're doing is more like forgetting that the law of large numbers is a thing.

Re:NASA advisers say SpaceX rocket technology could put live... by ebbv on Sunday May 06, 2018 @03:44PM (#17008066)
I’m not forgetting anything. The actual shuttle missions were not a statistical experiment or a consistent action where you can say “well this is what happened so that was the chance of death on an individual shuttle flight.”

It only means that’s your chance if you have the technology from quantum leap (the tv show) and you randomly land in the body of one of the participants.

as I said already the shuttle and everything around it evolved. The crews changed. Trying to say “the actual chance of death was this based on how many people died.” is silly.

Re:NASA advisers say SpaceX rocket technology could put live... by joshuamorton on Sunday May 06, 2018 @03:53PM (#17008134)
>It only means that’s your chance if you have the technology from quantum leap (the tv show) and you randomly land in the body of one of the participants

No, then the event already happened, so you know the outcome with certainty.

> The actual shuttle missions were not a statistical experiment or a consistent action where you can say “well this is what happened so that was the chance of death on an individual shuttle flight.”

Indeed there are confounding factors that make the error nontrivial. This doesn't invalidate the entire experiment.

>Trying to say “the actual chance of death was this based on how many people died.” is silly.

Its exactly as silly as saying "the actual chance of getting heads is based on how many heads you get". The problem with your argument is that that isn't silly. To calculate how likely getting heads is, you flip the coin a bunch of times, see how many heads you get, and then you have your answer (and a confidence level). Its the opposite of silly.

In other words, there's no big difference between "We'll flip a bunch of coins to see how likely we are to pull heads" and "we'll launch a bunch of people into space to see how likely they are to end up dead". The second isn't as rigorously controlled as the first, but that's fine as long as you account for it.

Re:NASA advisers say SpaceX rocket technology could put live... by Spooky23 on Sunday May 06, 2018 @08:21PM (#17009511)
I think the difference is the scope of the problem. A coin flip is a deterministic, known event with two possible answers in most situations.

A rocket or space shuttle launch is like a thousand coin flips, where any one result, sequence of results or other combination of events results in death. As an added bonus, any number of unknown external events, from Ambient temperature, to bird strike, to sabotage can render the model useless and kill you in some unforeseen way.

Re:NASA advisers say SpaceX rocket technology could put live... by TeMPOraL on Monday May 07, 2018 @06:08AM (#17011549)
The scope is different, but the principle is the same.

Say you launch your rocket 50 times, out of which 3 times it explodes - first time because of a bird, second time because of the legendary ULA Sniper, third time because of internal problems. That 3/50 is still closer to the truth than just assuming "I really don't know" (1/2) or refusing to answer the question - it has huge error bars, but implicitly captures some of the phenomena that make launches go wrong.

Re:NASA advisers say SpaceX rocket technology could put live... by Spooky23 on Monday May 07, 2018 @02:26PM (#17015108)
That's a great point.

My perspective was probably a little impacted from spending the first truly beautiful day of the summer dealing with a failed "high availability" system. :)

Re:NASA advisers say SpaceX rocket technology could put live... by whatshisface on Sunday May 06, 2018 @02:30PM (#17007606)
If statistics didn't converge to probabilities in the high-n limit then science would be impossible. In the 15:5 coin example, the conclusion is skewed by a massive prior that coins are fair. When we're talking about things like space shuttle launches, it's not reasonable to expect our understanding of the system to be so good that we can boldly forge through with estimates that disagree with results.
Re:NASA advisers say SpaceX rocket technology could put live... by grondilu on Sunday May 06, 2018 @02:35PM (#17007625)
> If I flip a coin 20 times and happen to end up with a 15:5 split that doesn’t mean the chance of heads is 3:1.

Isn't it the best you can say, though? 20 is a small number but when it's all you have, there's nothing you can do about it. Of course we know the "real" probability is a 1/2 because we know how coin tosses work, but if we didn't know it and coin tosses were black boxes, we'd have to go with this 3:1 chance.

Re:NASA advisers say SpaceX rocket technology could put live... by hikarudo on Sunday May 06, 2018 @07:48PM (#17009339)
The chance of heads being 3:1 is the maximum likelihood estimate, which indeed is the best we can do if we don't know anything else. But usually we do have an idea of reasonable values.
Re:NASA advisers say SpaceX rocket technology could put live... by craftyguy on Sunday May 06, 2018 @02:27PM (#17007585)
I didn't say it was a probability. Quite literally, if you look at how many people flew and how many of those died, 1 in 25 died. There was a 100% 'chance' of 1 in 25 dying on the shuttle because that's what actually happened. There's no probability there.
Re:NASA advisers say SpaceX rocket technology could put live... by quickben on Sunday May 06, 2018 @02:43PM (#17007674)
I believe he is right though. You are considering future probability chance, and are right, but he is considering past average. In this case his factual outcome trumps your potential forecast.
Re:NASA advisers say SpaceX rocket technology could put live... by drb91 on Sunday May 06, 2018 @02:30PM (#17007599)
Wait, so a ratio by itself is meaningless without showing how the ratio was derived? If only we could verify the 1/12!