how long does it take to get 6 confirmations with confidence of 99% 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?
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.