Solution:
Answer: (210071+21005)2
We note the probability that he ends up in the same row is equal to the probability that he ends up in the same column by symmetry. Clearly these are independent, so we calculate the probability that he ends up in the same row.
Now we number the rows 0−7 where 0 and 7 are adjacent. Suppose he starts at row 0. After two more turns, the probability he is in row 2 (or row 6) is 41, and the probability he is in row 0 again is 21. Let an,bn,cn and dn denote the probability he is in row 0,2,4,6 respectively after 2n moves.
We have a0=1, and for n≥0 we have the following equations:
an+1bn+1cn+1dn+1=21an+41bn+41dn=21bn+41an+41cn=21cn+41bn+41dn=21dn+41an+41cn
From which we get the following equations:
an+cn=21xn=an−cn=21(an−1−cn−1)=2xn−1
So
a1006+c1006=21x0=1, x1006=210061a1006=210071+21005
And thus the answer is (210071+21005)2.