Say we are given a predetermined sum and average of $n$ distinct natural numbers ranging from $0-50.$ Knowing the sum and average of any such set of natural numbers, is it be possible to determine what that set is? If so, would the solution be unique?
E.g., Let's say $n=5.$ It looks like the solution is not unique, but is there any way to functionally determine the set, or is it just guess and check?
For a set of $n$ numbers, you have $n$ "degrees of freedom".
Generally speaking, each condition you impose loses a degree of freedom.
Naively, you would assume $(n-2)$ degrees of freedom after imposing two conditions on $n$ variables.
However, the sum $S$ and mean $M$ are closely related: $S=nM$.
For example, say you have three numbers with sum 30 and mean 10. Then you need $x_1+x_2+x_3=30$ and $\frac{1}{3}(x_1+x_2+x_3)=10$. But this last condition is equivalent to $x_1+x_2+x_3=30$.
Say you have three numbers with the sum 30 and the mean 5. Then you need $x_1+x_2+x_3=30$ and $\frac{1}{3}(x_1+x_2+x_3)=5$. This last condition is equivalent to $x_1+x_2+x_3=15$, and so you need $15=30$ which is impossible; there are no such numbers.
In short, if the sum and mean are compatible, i.e. $S=nM$, then you have one, and only one, condition: $$x_1+\cdots+x_n=S$$
You need to know the number of partitions of $S$.