How many solutions exist for $$x+2y+4z=100$$ in non-negative integers?
The author, Martin Erickson, in his book, Aha! Solutions, published by MAA, gives the following brief solution :
There are $26$ choices for $z$, namely, all integers from $0$ to $25$. Among these choices, the average value of $4z$ is $50$. So, on average, $x+2y=50$. In this equation, there are $26$ choices for $y$, namely, all integers from $0$ to $25$. The value of $x$ is determined by the value of $y$. Hence, altogether there are $26^2=676$ solutions to the original equation.
Can somebody explain to me why this mindblowing solution works using averages?