The average number of rolls is approximately 5.294 for the specific case in the question. The probability distribution for the specific case is: $$ p(1) = \frac{1}{20} $$ for \$n=1\$, and $$ p(n) = \frac{n}{20} \prod_{i=1}^{n-1} \left( \frac{20-i}{20} \right) $$ for \$n>1\$, and \$p(n)\$ indicates the probability that the success occurs on the n'th roll. The general structure is $$ p(n) = q_n \prod_{i=0}^{n-1} (1-q_i) $$ where \$0 \le q_i \le 1\$ is the probability of success on the i'th roll, with the convention \$q_0=0\$ (you can't have succeeded before your first roll) You can think of the process in terms of this sort of tree: <pre> (1-q_0)=1 / \ q_1 (1-q_1) # first roll / \ q_2 (1-q_2) # second roll / \ q_3 (1-q_3) # third roll ... </pre> Where the branches to the left indicate success on that particular roll, and the branches to the right indicate failure on this particular roll. Evaluating the probability of success on a given roll is just taking the product of the factors along the path to the "success" branch on that level. For the specific case called out in the question: <pre> start=1 / \ 1/20 19/20 # first roll / \ 2/20 18/20 # second roll / \ 3/20 17/20 # third roll ... </pre> From here we can tabulate the probabilities for the specific case: | n | p(n)| \$n p(n)\$| |----|-----|---| | 1 | 0.05 | 0.05| | 2 | 0.095 | 0.19| | 3 | 0.12825 | 0.38475 | | 4 | 0.14535 | 0.5814 | | 5 | 0.14535 | 0.72675 | | 6 | 0.130815| 0.78489 | | 7 | 0.106832|0.747824 | 8 | 0.0793611| 0.6348888 | | 9 | 0.0535687| 0.4821183 | | 10 | 0.0327364| 0.327364 | | 11 | 0.0180050| 0.198055 | | 12 | 0.00883884 | 0.10606608 | | 13 | 0.00383016| 0.04979208 | | 14 | 0.00144368|0.02021152 | | 15 | 0.000464039| 0.006960585 | | 16 | 0.000123743| 0.001979888 | | 17 | 2.62956e-05| 0.0004470252 | | 18 | 4.17635e-06| 7.51743e-5 | | 19 | 4.40937e-07| 8.377803e-6 | | 20 | 2.32020e-08| 4.6404e-7 | From, this you can get the average of 5.294 as the sum of \$n p(n)\$. <!-- DELETE THIS COMMENT -->