Find the expected value and variance Determine the expected value ($\mathbb{E}[X]$) and variance of the number of times it is necessary to roll a dice until the result "1" ocurres 4 times in a row.
I know it is a negative binomial distribution, maybe with parameters 4 and 1/6, and I think $X_n:$ "amount of rolls to obtain $n$ consecutive 1s" could be the random variable.
Any help is welcome!
 A: There is an easier and more elementary way to calculate the expectation and variance, by conditioning on the first occurrence of a non-1 face.
After a thourough search, I found that "drhab" already did the calculations for the general case, so all you have to do is just to plug in $N=4$ and $p=\frac{1}{6}$ in his second answere here: variance of the number of coin toss to get N heads in row.
Yet another way is to calculate the generating function like in robjohn answer here: Expected Number of Coin Tosses to Get Five Consecutive Heads and use its derivatives to calculate the desired mean and variance.
Yet another way (perhaps more intuitive) is to condition on the number of non-one rolls. If we denote by $T$ the occurence of a non-1 roll, then we can divide each sample in a (random) number of runs:
$$\underbrace{1\ldots 1T}_{\text{Run } \#1}\ \underbrace{1\ldots 1T}_{\text{Run } \#2}\ \cdots\ \underbrace{1\ldots 1T}_{\text{Run } \#N-1}\ \underbrace{1111}_{\text{Run} \#N}$$
Where the last run consists of for ones in a row, and the other $N-1$ runs are one of the $T$, $1T$, $11T$, or $111T$ (note that $N$ is also a random variable).
If we denote by $X_i$ the number of rolls of Run $\#i$, we can write:
$$X=X_1+X_2+\ldots+X_{N-1}+X_N$$
Where $X_N=4$ and for $i<N$ we have $X_i$ are i.i.d. random variables distributed as:
$$X_i=\begin{cases}
1 & \text{ with probability }\frac{5\cdot 6^3}{6^4-1} \\
2 & \text{ with probability }\frac{5\cdot 6^2}{6^4-1} \\
3 & \text{ with probability }\frac{5\cdot 6}{6^4-1} \\
4 & \text{ with probability }\frac{5}{6^4-1}
\end{cases}$$
Therefore $E[X_i]=\frac{1550}{6^4-1}$, $\operatorname{Var}(X_i)=\frac{381750}{(6^4-1)^2}$, and:
$$X=X_1+X_2+\ldots+X_{N-1}+4$$
Where $N\sim\operatorname{Geometric}\left(\frac{1}{6^4}\right)$ independent of $X_1, X_2, \ldots X_N$, so $E[N]=6^4$, $\operatorname{Var}(N)=6^4(6^4-1)$.
By conditioning on $N$:
$$E[X]=E[E[X|N]]=E[(N-1)E[X_1]+4]=(E[N]-1)E[X_1]+4=1550+4=1554$$
And:
$$\operatorname{Var}(X)=\operatorname{Var}(E[X|N])+E[\operatorname{Var}(X|N)]=E[X_1]^2\cdot\operatorname{Var}(N)+\operatorname{Var}(X_1)\cdot(E[N]-1)=2404650$$
