Probability of $\mathbf X+n\mathbf Y$ mod K where $\mathbf X, \mathbf Y$ are independent uniform I am trying to solve a problem (from Durrett's PTE), and a component of it requires me to find the distribution of $\mathbf{Z_n}=\mathbf{X} + n\mathbf{Y}$ mod $\mathit{K}$ where $\mathit{K}\geq 3$ is a prime number, $\mathbf{X}$ and $\mathbf{Y}$ are uniformly distributed as $\{0,1,...,\mathit{K}-1\}$, and $0\leq\mathbf{n}\lt\mathit{K}$.
Since $\mathit{K}$ is prime, I know that the range of possible values of $\mathbf{Z_n}$ is $\{0,1,...,\mathit{K}-1\}$, and doing a bunch of examples by hand (and it makes sense intuitively), I can see that the distribution is:
$\mathbf{P}[\mathbf{Z_n}=i]=1/K$, $0\leq\ i \lt\mathit{K}$ so in other words $\mathbf{Z_n}\sim uniform\{0,1,...,\mathit{K}-1\}$
But I am at a bit of a loss as to how to show this rigorously. Or this a standard result that I can find in some book that you can point me to?
 A: Let us first prove : $f = nY \mod k$ is uniform over $S=\{0,1,2..,k-1\}$
As $k$ is prime, for all $i$ belonging to $S$, $\gcd(k,i)=1$. This implies $S$ forms a multiplicative group of integers modulo $k$. Suppose $a, b$ belong to $S$. $a = a' \mod k, b = b' \mod k \implies ab = a'b' \mod k$. As $a'b' \mod k$ belongs $\geq 0$ and $< k$, it belongs to $S$. Closure holds. For a fixed $n > 0$ and $n < k, n$ belongs to $S$. $nY$ belongs to $S$. Let the set $n \times Y \mod k$ be denoted as $M$. $M$ is a subgroup of $S$ as for $n, Y ($as a,b) belongs to S, and $a > 0$, $ab \mod n$ belongs to S and M. Therefore M is a subgroup of S. From Lagrange's Theorem, order of M must divide order of G. Clearly for a fixed $n > 0$ & $n < k, M$ has at least two elements: $n \times 0 = 0$ and $n \times 1 = n$. There order of $M \geq 2$. Order of $S=k$, as $k=$ prime, only no. less than or equal to $k \neq 1$ that divides k is itself. Therefore order $M = k.$
That is, $M = S.$ 
Now, assume, for a fixed n, there exists at least 1 a,b such that $a > 0$ and a,b belong to S such that $na \mod k = nb \mod k$. Clearly the function $AB \mod C$ returns unique value for unique A, B, C. S has k unique elements (k possible values of a and b). Therefore, if a and b exist, no. of unique elements in $M <$ no. of elements in S. Therefore it is a contradiction, and all $na \mod k$ are unique.
Therefore $nY \mod k$ is a bijective mapping from S to S. Hence if Y is uniform, $nY \mod k$ too is uniform.
$Z= X + nY$
if $n=0, Z=X$ and given X is uniformly distributed over S, therefore Z is too.
if $n>0, nY$ is uniformly distributed over S. Let X take the value 'x'. Each element of S 's' can be written as $s + x \mod k$. Only the ordering of elements will change. Hence set S remains unchanged. Therefore $x + nY$ is uniform over S. As $x$ is arbitrarily chosen, $Z = X + nY$ is uniform over $S$.
