You have a die with $9$ faces, which are numbered $1, 2, 3, \dots,9$. All the numbers have an equal chance of appearing. You roll the die repeatedly, write the digits one after another, and you stop when you obtain a multiple of $3$. For example, you could roll a $4$, then a $1$, then a $7$. You would stop at this point, because $417$ is a multiple of $3$ but $4$ and $41$ are not.
Find the expected number of times that you roll the die.
I'm not sure how to find the expected value of something, can I get a solution to this problem?
Note that at any point, there are $3$ values from $1\to 9$ that would make the number a multiple of $3$ if rolled, since a number is a multiple of $3$ iff its sum of digits is.
If the sum of the currently rolled digits mod $3$ is $1$, then $2,5,8$ would make the number a multiple of $3$.
If the sum mod $3$ is $2$, then $1,4,7$ would make the number a multiple of $3$.
If this is the first roll, then $3,6,9$ would make the number a multiple of $3$.
So, the expected value is just $$\frac1{1/3}=3$$