# expected value for the number of rolls of the dice until getting a 6 with a max of 10 trials

Suppose that we roll a fair die until a 6 comes up or we have rolled it 10 times. What is the expected number of times we roll the die?

The ith roll of the dice may give a 6 where $i=1,2,3,…,10$

Let X be the random variable for the ith roll of the die.

All possible values of X={1,2,3,4,5,6,7,8,9,10}

So I am computing the expected value for the number of rolls of the fair dice until getting a 6 or stop with a max of 10 trials

$1(1/6)+2(5/6)(1/6)+3(5/6)^2 (1/6)+4(5/6)^3 (1/6)+5(5/6)^4 (1/6)+6(5/6)^5 (1/6)+7(5/6)^6 (1/6)+8(5/6)^7 (1/6)+9(5/6)^8 (1/6)+10(5/6)^9 (1/6)=3.415911$

However, the book answer is 5.03. How?

The probability of rolling 10 times is not $(\frac{5}{6})^9\frac{1}{6}$, but $(\frac{5}{6})^9$, since once you roll the 10th time, whatever you get, you will stop
$$R = \sum\limits_{i=1}^{10}X_i$$ where each $$X_i$$ is $$1$$ if we roll the $$i^{th}$$ die and $$0$$ otherwise.
$$\mathbb{E}[R] = \sum\limits_{i=1}^{10} \mathbb{E}[X_i] = \sum\limits_{i=1}^{10} \mathbb{P}[X_i=1] = \sum\limits_{i=1}^{10} (\frac{5}{6})^{i-1} = 6(1-\frac{5}{6}^{10})$$