On average, how many times must I roll a dice until I get a $6$?

You can calculate the average this way also.

The probability of rolling your first $6$ on the $n$-th roll is $$\left[1-\left(\frac{5}{6}\right)^n\right]-\left[1-\left(\frac{5}{6}\right)^{n-1}\right]=\left(\frac{5}{6}\right)^{n-1}-\left(\frac{5}{6}\right)^{n}$$

So the weighted average on the number of rolls would be $$\sum_{n=1}^\infty \left(n\left[\left(\frac{5}{6}\right)^{n-1}-\left(\frac{5}{6}\right)^{n}\right]\right)=6$$

Again, as noted already, the difference between mean and median comes in to play. The distribution has a long tail way out right pulling the mean to $6$. enter image description here

For those asking about this graph, it is the expression above, without the Summation. It is not cumulative. (The cumulative graph would level off at $y=6$). This graph is just $y=x\left[\left(\frac{5}{6}\right)^{x-1}-(\left(\frac{5}{6}\right)^{x}\right]$

It's not a great graph, honestly, as it is kind of abstract in what it represents. But let's take $x=4$ as an example. There is about a $0.0965$ chance of getting the first roll of a $6$ on the $4$th roll. And since we're after a weighted average, that is multiplied by $4$ to get the value at $x=4$. It doesn't mean much except to illustrate why the mean number of throws to get the first $6$ is higher than around $3$ or $4.$

You can imagine an experiment with $100$ trials. About $17$ times it will only take $1$ throw($17$ throws). About $14$ times it will take $2$ throws ($28$ throws). About $11$ times it will take $3$ throws($33$ throws). About $9$ times it will take $4$ throws($36$ throws) etc. Then you would add up ALL of those throws and divide by $100$ and get $\approx 6.$


Your calculation is almost correct, but it's calculating the wrong thing.

${(5/6)}^{n-1}$ is the probability that you roll any other number at least $n$ times until rolling a six. Setting this to $1/2$ gives:

$$n = \frac{-1}{\log_2 (5/6)}+1$$

This is the median of the distribution: the numerical value separating the higher half of the distribution from the lower half.

It is not the mean (average).


The probability of the time of first success is given by the Geometric distribution.

The distribution formula is:

$$P(X=k) = pq^{n-1}$$

where $q=1-p$.

It's very simple to explain this formula. Let's assume that we consider as a success getting a 6 rolling a dice. Then the probability of getting a success at the first try is

$$P(X=1) = p = pq^0= \frac{1}{6}$$

To get a success at the second try, we have to fail once and then get our 6:

$$P(X=2)=qp=pq^1=\frac{1}{6}\frac{5}{6}$$

and so on.

The expected value of this distribution answers this question: how many tries do I have to wait before getting my first success, as an average? The expected value for the Geometric distribution is:

$$E(X)=\displaystyle\sum^\infty_{n=1}npq^{n-1}=\frac{1}{p}$$

or, in our example, $6$.

Edit: We are assuming multiple independent tries with the same probability, obviously.