user48101: I had this question in an exam but I was not very sure how to solve it:
Suppose Bob the merchant wants to have a policy that orders will ship within x minutes after receipt of payment. What value of x should Bob choose so that with 99% confidence 6 blocks will be found within x minutes
Do you have in idea about the formula that we have to use to find the answer?

user23060: The following holds for a generalized case on the required time for having m blocks with a confidence of p 100\%. The time X between consecutive blocks is exponential distributed, i.e. X~Exp[k] with k=1/10.
The sum of m independent and identical exponential random variables follows the Erlang distribution, that means for X_i~Exp[k],  X_1+X_2+...+X_m~Erlang[m,k]. The required time for having m blocks with a confidence of p 100% is given by the p-quantile of the Erlang[m,k] distribution. In your case m=6 and p=0.99. The quantile Q_Erlang[m,k](p) does not have a closed form expression. However, it is given in terms of the inverse regularized gamma function which can be evaluated numerically.
Plugging in the values leads to Q_Erlang[6,1/10](0.99)=131.085, which means that in 99% of all cases 6 blocks will be mined in less than 131 minutes.


48101: <p>I had this question in an exam but I was not very sure how to solve it:</p>

<p>Suppose Bob the merchant wants to have a policy that orders will ship within x minutes after receipt of payment. What value of x should Bob choose so that with 99% confidence 6 blocks will be found within x minutes</p>

<p>Do you have in idea about the formula that we have to use to find the answer?</p>
 23060: <p>The following holds for a generalized case on the required time for having <code>m</code> blocks with a confidence of <code>p 100\%</code>. The time <code>X</code> between consecutive blocks is exponential distributed, i.e. <code>X~Exp[k]</code> with <code>k=1/10</code>.
The sum of <code>m</code> independent and identical exponential random variables follows the Erlang distribution, that means for <code>X_i~Exp[k]</code>,  <code>X_1+X_2+...+X_m~Erlang[m,k]</code>. The required time for having <code>m</code> blocks with a confidence of <code>p 100%</code> is given by the <code>p</code>-quantile of the <code>Erlang[m,k]</code> distribution. In your case <code>m=6</code> and <code>p=0.99</code>. The quantile <code>Q_Erlang[m,k](p)</code> does not have a closed form expression. However, it is given in terms of the inverse regularized gamma function which can be evaluated numerically.</p>

<p>Plugging in the values leads to <code>Q_Erlang[6,1/10](0.99)=131.085</code>, which means that in <code>99%</code> of all cases <code>6</code> blocks will be mined in less than <code>131</code> minutes.</p>

<p><a href="https://i.stack.imgur.com/qJ05t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qJ05t.png" alt="enter image description here"></a></p>
