0
$\begingroup$

I'm trying to understand a psychology study I've just read and I'm encountering a combinatorics problem that I can't solve and could use some help with.

There is a questionnaire that asks 5 questions, each of which can have values 1, 2, 3, 4, 5, 6, or 7. After answering each question, the values for each question are summed up to produce an aggregate score. Hence, the only possible final, aggregate scores subjects can receive are anywhere from 5 - 35.

QUESTION: How many unique sequences of answers can be generated from this?

For example, the aggregate score of 6 can be achieved in 5 ways:

(1,1,1,1,2)

(1,1,1,2,1)

(1,1,2,1,1)

(1,2,1,1,1)

(2,1,1,1,1)

I'm also curious how to solve the general problem of the following form. Given $n$ questions, each which can take on $k$ values, and after summing each of the answers to each question (an aggregate score), how do we determine how many unique sequences of answers can be generated?

$\endgroup$
0

2 Answers 2

2
$\begingroup$

The number of ways each score can be attained are the coefficient of the following polynomial \begin{eqnarray*} (x+x^2+x^3+x^4+x^5+x^6+x^7)^5. \end{eqnarray*}

$\endgroup$
2
  • $\begingroup$ Interesting. I unfortunately don't understand how this follows. Can you please explain a little for me? $\endgroup$ Commented Feb 24, 2020 at 22:09
  • $\begingroup$ For each question you record $x^{s}$ where $s$ is the score. Now when you multiply the $5$ terms together $x^{s_1+s_2+s_3+s_4+s_5}$ you will get an $x^{T}$ ... the above generating function will count these for you. $\endgroup$ Commented Feb 24, 2020 at 22:13
2
$\begingroup$

Assume that the score of the $i^\text{th}$ question is $s_i$ and the given aggregate score is $a$. We then want to find the number of integer solutions to the equation: $$ \sum_{i=1}^n s_i = a, 1\leq s_i\leq k.$$ This can be solved using the method of generating functions For the general case, the answer is co-efficient $d_a$ of $x^a$ in $f(x)$ where \begin{align} f(x) &= \left[\sum_{i=1}^k x^i\right]^n=\left[\frac{x^{k+1}-x}{x-1}\right]^n=x^n\left[\frac{x^{k}-1}{x-1}\right]^n\\&=x^n\sum_{j=0}^{n}\binom{n}{j}x^{kj}\times\sum_{l=0}^{\infty}\binom{-n}{l}(-x)^{l}\\ &=x^n\sum_{j=0}^{n}\binom{n}{j}x^{kj}\times\sum_{l=0}^{\infty}\binom{n+l-1}{l}x^{l}\\ &=x^n\sum_{j=0}^{n}\sum_{l=0}^{\infty}\binom{n}{j}\binom{n+l-1}{l}x^{l+kj}. \end{align} Thus, the coefficient of $x^a$ is \begin{align} d_a &= \sum_{j=0}^{n}\binom{n}{j}\binom{n+l-1}{l} \text{ with } l+kj+n=a\\ &= \sum_{j=0}^{n}\binom{n}{j}\binom{a-kj-1}{a-kj-n}. \end{align}

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .