Let's say I want to roll $n$ 20-sided dice, and I want none of those dice to be a 1. I figure that the probability at least one die will be a 1 is $\frac{19}{20}^n$. But now let's say that we will re-roll each individual die that is a 1 up to $r$ times. I want to know 2 things:
- Given the above, what is the probability one or more of the dice will be a 1?
- Suppose I play this game a million times. How many dice rolls will a given game make on average? In other words, for each game, I will make $n+t$ dice rolls, where $t$ is the number of retries I've made. What would $t$ be on average?
If I got your question right,
Let's consider one game, the probability of getting a $1$ is given by $1-\left( \frac{19}{20} \right)^r$, now the probability of getting at least a $1$ is the complement of getting no $1$s, that is $1-\left(1-1+ \left( \frac{19}{20} \right)^r \right)^n=1-\left( \frac{19}{20} \right)^{nr}$
I will ignore the million time thing, since if you take the average of an expectation you end up with the same result (due to unbiasedness of the average estimator). For one game, the probability of throwing the die $k\in [1:r-1]$ times is $\frac{1}{20} \left( \frac{19}{20} \right)^{k-1}$ and the probability of throwing $r$ times is $\left( \frac{19}{20} \right)^{r-1}$ (the last throw can be $1$ or not). A good sanity check is to verify this sums to $1$. To obtain the expectation we compute \begin{align*} &\frac{1}{20} \sum_{k=1}^{r-1} k \left( \frac{19}{20} \right)^{k-1} + r \left( \frac{19}{20} \right)^{r-1}\\ =&\left(\frac{19}{20}\right)^{r - 1} r + \frac{20}{19} \frac{(-19 (19^r - 20^r) - 19^r r)}{20^{r}} \end{align*} by the Arithmetico-geometric formula (and after few steps)
EDIT : I think that my first one is wrong, see Mike Earnest's answer. And by the way you may have to use $r+1$ instead of $r$ in my formula for the second one depending if you are allowed throw the dice $r$ times or re-throw it $r$ times