We start with our game in the box number $0$. We throw a die with: "$+1$", "$+2$", "$+3$", "$-1$", "$-2$" and "$-3$" written on its faces. After each throw we move to the right of the number of boxes shown by the die. Once we get to the box number $+20$ (or more) or $-20$ (or less) the game is finished. What is the expected value of throw to finish the game?
My first idea was to work with 41 functions from $f_{-20}(n)$ to $f_{+20}(n)$ defined as following:
$f_x(n)$ is the probability that after $n$ throws we are in the box number $x$ without having finished the game before. we can easily see by symmetry that: $$f_x(n)=f_{-x}(n)$$ Therefore we can work with 21 functions. Then I saw that $f_x(0)$ is 0 for every $x$ except $x=1$. And I could find a recurrence relation for every function such as: $f_4(n+1)=\frac{1}{6}\left(f_1( n ) + f_2( n ) +f_3( n ) +f_5( n ) +f_6( n ) +f_7\ (n) \right)$
I'm afraid that I'll have to solve an equation of degree 20 in order to find a formula for $f_{20}(n)$. Then the expected value would be: $$\sum_{i=0}^{\infty}2\cdot f_{20}(i)$$ ($2$ comes from the simmetry)
This approach only gives me a nice hint on how to find a numerical answer with excel, but I don't care about the numerical result, I only mind the proper solution.
I thought that Catalan numbers or the proof of the formula for Catalan numbers might come useful but the only way i could find something useful with them is when the dice has only the faces "+1" and "-1"
The usual approach is to consider simultaneously the mean $t_x$ of the number of steps needed to reach $+20$ or more or $-20$ or less, starting from each integer value $x$. Then $t_x=0$ for every $|x|\geqslant20$ and, for every $|x|\lt20$, $$ t_x=1+\tfrac16(t_{x-3}+t_{x-2}+t_{x-1}+t_{x+1}+t_{x+2}+t_{x+3}). $$ A frequent continuation is to introduce the generating function $$ g(s)=\sum_xt_xs^x, $$ and to deduce from the linear system solved by $(t_x)$ and described above, a functional relation solved by $g(s)$. Then the idea is to identify $g(s)$, and finally the constant coefficient $t_0$ of the function $g$.
In the present case, one could use the fact that, due to the symmetry of the model, $(t_x)$ is even hence the linear system involves $20$ nonzero unknown quantities $(t_x)_{0\leqslant x\leqslant19}$ instead of $39$. Likewise, $g(s)=g(1/s)$ for every $s\ne0$. But does this really simplify things?