Expected value of rolling dice until getting a $3$

No, this logic doesn't make sense; but, let's see if we can clear that up!

For a fixed number $k$, let's think about the event $\{X=k\}$. If we can find the probabilities of each of these events (for $k=1,2,3,\ldots$), then $$ \mathbb{E}[X]=\sum_{k=1}^{\infty}kP(X=k). $$ What does it mean to say that $X=k$? It means that the first $k-1$ rolls of the dice gave a number other than $3$, and that the $k$th roll gave exactly $3$. Thus $$ P(X=k)=\left(\frac{5}{6}\right)^{k-1}\cdot\frac{1}{6}. $$ So, we find that. $$ \mathbb{E}[X]=\frac{1}{6}\sum_{k=1}^{\infty}k\left(\frac{5}{6}\right)^{k-1} $$ Now, this must be simplified... but that's not so bad, if you remember some stuff about sequences and series. First, remember that $$ \sum_{k=0}^{\infty}x^k=\frac{1}{1-x},\qquad \lvert x\rvert<1. $$ Differentiating each side of this, we find $$ \frac{1}{(1-x)^2}=\frac{d}{dx}\left[\frac{1}{1-x}\right]=\frac{d}{dx}\left[\sum_{k=0}^{\infty}x^k\right]=\sum_{k=1}^{\infty}kx^{k-1},\qquad \lvert x\rvert<1. $$ In particular, taking $x=\frac{5}{6}$ yields $$ \mathbb{E}[X]=\frac{1}{6}\sum_{k=1}^{\infty}k\left(\frac{5}{6}\right)^{k-1}=\frac{1}{6}\cdot\frac{1}{(1-\frac{5}{6})^2}=6. $$


What you describing is a Geometric distribution with probability of success $1/6$. The probability function is $$P(X=k)=(1-p)^{k-1}p$$ where X is a random variable that corresponds to the number of trials in an experiment until the first success. So the the mean value is by the definition (but it can be proved quite easily) $$E(X)=1/p=1/(1/6)=6$$

You can find more here


A solution without calculus:

$E[x]$ is simply the sum of the number of rolls times the probability that this number of rolls have occurred. If exactly $n$ rolls occur before one stops, then one must roll something other than $3$ $n-1$ times, and then a $3$ $1$ time. The probability of this happening is $$ \left(\frac{5}{6}\right)^{n-1}\cdot\left(\frac{1}{6}\right) $$ And thus we want to compute $$ E[x]=\frac{1}{6}\cdot \sum_{n=1}^{\infty} n\left(\frac{5}{6}\right)^{n-1} $$ So $$ \frac{5}{6}E[x]=\frac{1}{6}\cdot \sum_{n=1}^{\infty} n\left(\frac{5}{6}\right)^n=\frac{1}{6}\sum_{n=2}^{\infty} (n-1)\left(\frac{5}{6}\right)^{n-1}=\frac{1}{6}\sum_{n=2}^{\infty}n\left(\frac{5}{6}\right)^{n-1}-\frac{1}{6}\sum_{n=2}^{\infty}\left(\frac{5}{6}\right)^{n-1} $$ $$ =E[x]-\frac{1}{6}-\frac{1}{6}\cdot \frac{5}{6}\cdot\frac{1}{1-\frac{5}{6}}=E[x]-\frac{1}{6}-\frac{5}{6}=E[x]-1 $$ But then $\frac{1}{6}E[x]=1$, so $E[x]=6$.