Let a point P move on a straight line according to the score shown on a fair dice that we throw by the following rules. P starts from the origin O. If the score is 6, the P returns to the origin O.
If the score is 1,2, or 3, then P moves 1 in a positive direction.
If the score is 4 or 5, then P moves 1 in a negative direction.
When we throw the dice four times, the probablity that the point P is at the origin O is (??)
At first glance, this doesn't look too hard since all it is is the P(being at origin), but when I tried to take the (cases where P is at the origin)/(the total amount of cases) I stumbled at how to calculate the total amount of cases.
As for what I could figure out:
there are only 3 possible outcomes
a= anything, p = positive number, n = negative number 6 = rolling a 6
aaa6
a6pn
ppnn
taking the probablity of all of these, I got $5^3/6^4$, %5/6^3$, and $1/6^2$. Taking all of that over the total cases seems fairly hard as it is, but how do I even begin to get the total amount of cases?
I thought about multiplying 6 four times since we are rolling the dice 4 times, but that doesn't make since, since the total number of cases is just the total number of  permuations of 6. So i tried taking the n!/(n-1)! of this equation, and that didn't work either.
Maybe I messed up my math somewhere, IDK.
the answer is apparently: 7/18
All help is appreciated!
 A: If the last time $6$ is rolled was at an odd index(first or third roll), then P would be at an odd position. Hence, three distinct cases shall be considered:

*

*$4^\textrm{th}$ roll is a $6$.

If the last roll is a $6$, P will return to origin regardless of previous rolls. Probability of this is $\frac{1}{6}$.


*$2^\textrm{nd}$ roll is a $6$ and P moves back and forth once in third and fourth rolls.

After P returns to the origin in the second roll, it should keep its position by moving in both directions exactly once, $(+,-)$ or $(-,+)$. Probability of this is $\frac{1}{6}\times 2\times\frac{3}{6}\times\frac{2}{6}=\frac{1}{18}$.


*P moves back and forth twice.

Index of positive and negative movement times correspond to $\binom{4}{2}=6$ different cases, with probability $\left(\frac{3}{6}\right)^2\times\left(\frac{2}{6}\right)^2=\frac{1}{36}$ each. Overall probability is $6\times \frac{1}{36} = \frac{1}{6}$
The probability of P being at the origin is $\frac{1}{6} + \frac{1}{18} + \frac{1}{6} = \frac{7}{18}$.
A: You could find the number of equally likely ways of reaching each position and then dividing by the total number of ways.  If $p_n(k)$ is the probability of being at position $k$ after $n$ rolls with $p_0(0)=1$, you would have the recurrence $$p_{n+1}(k)=\frac36p_{n}(k-1) +\frac26p_{n}(k+1) +\frac16 I_{[k=0]}$$
which gives
  rolls 0    1     2       3        4
position                    
 4                               81/1296
 3               0/36   27/216   27/1296
 2               9/36    9/216  270/1296
 1          3/6  3/36   72/216  162/1296
 0      1   1/6 18/36   48/216  504/1296
-1          2/6  2/36   48/216  108/1296
-2               4/36    4/216  120/1296
-3                       8/216    8/1296
-4                               16/1296 

giving $p_4(0)= \frac{504}{1296} = \frac7{18}\approx 0.3889$, the same as oty found.
This is an ergodic Markov chain, and has a stationary distribution which is approached after a large number of rolls. The stationary distribution is the solution to $p(k)=\frac36p(k-1) +\frac26p(k+1) +\frac16 I_{[k=0]}$ with $\sum\limits_{k \in \mathbb Z} p(k)=1$ and is
$$p(k)= \left\{\begin{align} \frac{\sqrt{3}}{6}\left(\frac{3-\sqrt{3}}{2}\right)^k & \qquad \text{ when }k>0 \\ 
\frac{\sqrt{3}}{6}\approx 0.2887& \qquad  \text{ when }k=0 \\ 
\frac{\sqrt{3}}{6}\left(\frac{3+\sqrt{3}}{2}\right)^k &  \qquad  \text{ when }k<0\end{align}\right.$$
A: Here is a solution, with $P,N,\text {and}\; O$ signifying one step in the positive, negative and return to origin through a $6$ being rolled.
If it is not at the origin after $3$ steps, the last roll has to be a six, and it is easy to enumerate the position after three rolls
It is at the origin after three steps in:

*

*OOO: $1$ permuation $\times 1 = 1 $ way


*POO: $2$ permutations $\times 3 = 6$ ways


*NOO: $2$ permutations $\times 2 = 4$ ways


*PPO: $1$ permutation $\times 9 = 9$ ways


*NNO: $1$ permutation $\times 4 = 4$


*PNO: $6$ permutations $\times 6 = 36$ ways,


*Total such $=\boxed {60}$ ways, remaining $= 156$ ways
Thus adding up, and correcting for double counting OOOO $Pr = \left(\frac{60}{6^3} + \frac{156}{6^4}= \frac{49}{108}\right) - \frac1{108} = \frac7{18}$
