A magic die, with the numbers 1, 2, 3, 4, 6, and 7 on its six faces, is rolled.

After this roll, if an odd
number appears on the top face, all odd numbers on the die are squared.

If an even number appears on the top face, all the previously odd numbers are increased by 3 and then all the even numbers are halved and then squared.

If the given die changes as described and assuming a perfectly balanced die,

what is the probability that the number appearing on the second roll

of the die is 1 mod 8?

(In reply to

analytical solution by Daniel)

When I started my comment, Daniel's had not yet appeared. It seems he has found a further ambiguity. I did not see anything in the text which suggested that the values shown on the faces of the dies were magically changed to their mod8 values, but only that to answer the probabilities question we needed to ask how many of the final sides in each case (odd on top, even on top) were themselves = 1 (mod8).

Perhaps this also reflects a different interpretation of what would happen on a SECOND roll. I took the text literally that the transformations applied only to the first roll ("THIS roll"); to indicate that a future roll would also be converted should have been stated as "On EACH roll" the faces would be magically converted. Magic has become muddle.