I am aware of figuring out the number of non-negative integers which sum to a certain number.
Number of ways to write n as a sum of k nonnegative integers
I’ve seen mentions of partitions, “stars and bars”, etc.
In the context of a survey:
Let’s say we have 5 questions with likert scales which range from 1 to 6 for possible values.
Then let’s say I want to know all of the permutations to get the sum score of 20. Order matters because each question is getting at a specific/useful piece of information even when they are being added together into a sum/composite score.
I am wondering if there is already a generalized solution to this where you can easily change the number of questions, the range of values for each question, and the sum score of interest.
If there isn’t one, I am hoping to find out what would help lead me to find one/if one has to create a specific solution for each specific set of parameters (ie it doesn’t generalize well).
I also saw that this kind of problem can be considered related to the knapsack problem.