For example, how many times ($N$) do I need to flip a coin ($p=0.5$) to have a $P=90\%$ probability of having observed $20$ heads. I empirically found that I need $N=20+28=48$. Is it correct?
Is there an explicit formula for the Negative binomial inverse cumulative function?