Farmer has 7 pigs and 180 potatoes. How many combinations of distributing those 180 potatoes there are? Order does not matter. Each pig can get from zero to 180 potatoes, but all 7 pigs must get exactly 180 potatoes (no less). How to tackle this problem generally: How many combinations of K sets exist which sum up exactly to N?
I would like to apply the solution in the field of election math for calculation of probability of election reversal. Philosophizing what would happen if invalid ballots (potatoes) were valid and if they were distributed among competing candidates (pigs).
Here is something similar but without the condition that all potatoes must be eaten. https://stackoverflow.com/questions/4588429/number-of-ways-to-add-up-to-a-sum-s-with-n-numbers Moreover, it has been solved with recursive function, not an elegant formula.