Suppose $1\le x \le k, 1\le y \le k$, and we need to find a explicit formula for the the number of integers solution for the equation such that $x+y=z$ where $z \in\{2,...,2k\}$
I'm doing this because I am trying to find the probability mass function of the distribution $Z=X+Y$ where $X$ and $Y$ are two discrete uniform distribution random variables on $\{1,...,k\}$.
And while I was trying to find the pmf of $Z$, it occured to me that $f_Z(z) = \dfrac{\text{ The number of solutions for the linear Diophantine equation above}}{k^2}$
Am I overthinking this? Or am I approaching the problem in a wrong way?