So the problem statement goes like this -

Points A, B and C lie on a circle and are arranged in clockwise order. We roll a fair 6-sided die and perform any of the 3 following operations based on the roll of the die.

* Move Clockwise - if 1 or 2 shows up.
* Move Anti-Clockwise - if 3 or 4 shows up.
* Do not move - if 5 or 6 show up.

We take A as our starting point. We roll the dice 8 times and perform the operations based on the dice roll.
What is the probability that we end up getting back to A.
[This is how A, B & C lie on the circle](https://i.stack.imgur.com/ig3wG.png)

I want to solve the problem considering valid cases out of the various possible $3^8$ cases.

I looked up the editorial for this and it stated the answer to be 1/3 due to symmetry (equal probabilities of performing ay of the operations.) However, I wanted to try out forming the valid cases by myself and was unable to reach the answer -

My approach :
Let us call
cc - total clockwise operations |
ac - total anticlockwise operations |
xx - total no movement operation

We can have

* Equal Number of Both Clockwise and Anticlockwise cases.
* If ac or cc is a multiple of 3 and the other is 0.
* If not a multiple of 3 and unequal, then ( (cc%3) - ac) || ((ac%3) - cc) == 0 ) where % stands for modulus whih yields the remainder

My valid cases - (ac, cc, xx)

* (1, 1, 6) = 56
* (2, 2, 4) = 840
* (3, 0, 5) = 56
* (5, 0, 3) = 56
* (3, 3, 2) = 560
* (4, 4, 0) = 70
* (4, 1, 3) = 280
* (1, 4, 3) = 280
* (5, 2, 1) = 168
* (2, 5, 1) = 168
* (6, 0, 2) = 28
* (0, 6, 2) = 28
* (7, 1, 0) = 8
* (1, 7, 0) = 8
* (0, 0, 8) = 1

Total equals = 2607.
When I divide it by $3^8$, I get it as 0.397 (not exactly 0.33).

Am I missing certain cases ?