I have a $10$ sided die numbered $1-10$. I keep rolling it until it lands on a prime number. Let $X$ be the number of times I roll the die.
What is the expected value $E(X)$?
What I have so far is the probability of rolling a prime is $P(\text{prime}) = \frac{4}{10}$.
How do I calculate the expected value? I tried the formula: $$\sum_{s\in S} P(s) \cdot X(s) = P(1)X(1) + P(2)X(2) +P(3)X(3)+P(4)X(4)$$
Where $P(s)$ is the probability of rolling a prime and $X(s)$ is the number of rolls. I plug in $\frac{4}{10}$ for each $P$ and $X$ is incremented from $1$. I am getting $4$ and the answer is $\frac{10}4$. Can someone guide me to what is going wrong here?