Question: An unbiased cubical die is thrown $n$ times. If $x_i$=outcome on the $i^{\text{th}}$ throw and $X=\text{GCD}(x_1,x_2,\dots,x_n)$, then find $E(X)$.
The way I tried to do this: There are 6 possible values for $X$. So we multiply each possible value by the probability of it's occurence and then sum the values. But I cannot figure out how to compute this probability for 1, 2 and 3 when there are $n$ throws.
To get started, you need to figure out the conditions under which $\text{GCD}(x_1, \ldots, x_n)$ is equal to each possible value, and then figure out the probability of each of those conditions.
As an example, let's figure out under what conditions $\text{GCD}(x_1, \ldots, x_n) = 6$. This is true iff every $x_i = 6$, so the probability is $P(x_1 = 6, \ldots, x_n = 6)$. You'll need to work out the conditions for the rest of the possible values of the GCD.