0

Consider a 6 sided dice which takes values from $\{1,2,...,6\}$. let $n_i$ denote the number of times $i \in [6]$ appears on the dice. From this dice we create a non-decreasing sequence $(a_1,...,a_6)$ which represents the values taken by the 6 sides of the dice. So given $$(1) \; \sum_{i=1}^{6} n_i = 6$$ $$(2) \; \sum_{i=1}^{6} in_i =21 $$ how would I count the number of sequences that satisfy this property.

I'm not looking for the numerical answer as that was given to me to be 33 but rather a way to understand how the result is found. I know without the 2nd constraint the question is similar to finding number of non-decreasing functions from $[6] \rightarrow [6]$ which is given by $\binom{11}{6}$

RobPratt
  • 45,619
  • With a script, I found $32$ sequences only: $(1,1,1,6,6,6)$, $(1,1,2,5,6,6)$, $(1,1,3,4,6,6)$, $(1,1,3,5,5,6)$, $(1,1,4,4,5,6)$, $(1,1,4,5,5,5)$, $(1,2,2,4,6,6)$, $(1,2,2,5,5,6)$, $(1,2,3,3,6,6)$, $(1,2,3,4,5,6)$, $(1,2,3,5,5,5)$, $(1,2,4,4,4,6)$, $(1,2,4,4,5,5)$, $(1,3,3,3,5,6)$, $(1,3,3,4,4,6)$, $(1,3,3,4,5,5)$, $(1,3,4,4,4,5)$, $(1,4,4,4,4,4)$, $(2,2,2,3,6,6)$, $(2,2,2,4,5,6)$, $(2,2,2,5,5,5)$, $(2,2,3,3,5,6)$, $(2,2,3,4,4,6)$, $(2,2,3,4,5,5)$, $(2,2,4,4,4,5)$, $(2,3,3,3,4,6)$, $(2,3,3,3,5,5)$, $(2,3,3,4,4,5)$, $(2,3,4,4,4,4)$, $(3,3,3,3,3,6)$, $(3,3,3,3,4,5)$, $(3,3,3,4,4,4)$. – VTand Dec 21 '21 at 16:32
  • Hello yasrey, can you please un-accept my answer? I just realized that I made a foolish error; if you actually code up the function in my post, you will see it is not counting the thing you are trying to count. I want to delete my wrong answer, but cannot since you have accepted it. – Mike Earnest Dec 22 '21 at 04:17

1 Answers1

1

Generating functions and computer algebra systems to the rescue! In the product $$ \prod_{i=1}^6 \sum_{k=0}^6 z^k q^{ki} = (1+zq+z^2q^2+\cdots+z^6q^6)\cdots (1+zq^6+z^2q^{12}+\cdots+z^6q^{36}),$$ the term $z^3q^{12}$ in $(1+zq^4 + z^2q^8 + z^3q^{12} + z^4q^{16} + z^5q^{20} + z^6q^{24})$, for instance, corresponds to $i = 4$ occurring $n_i = 3$ times. That is, in each term, the exponent of $z$ gives the frequency (your $n_i$) and the exponent of $q$ gives the contribution to the sum (your $in_i$ in (2)).

In the expanded product, since exponents sum, the terms with $z^6$ correspond to length 6 sequences and terms with $q^{21}$ have the desired sum. So the coefficient of $z^6q^{21}$ gives the number of your sequences. (One notation for this is $[z^6q^{21}]\prod_{i=1}^6 \sum_{k=0}^6 z^k q^{ki}$.) Using your favorite computer algebra system (Mathematica for me), this is easily found to be 32, corroborating VTand's count.

To better understand the connection, the sequence $(1,1,4,5,5,5)$ in VTand's list corresponds to the term $$z^2q^{2\cdot 1} \cdot z^0q^{0\cdot 2} \cdot z^0q^{0\cdot 3} \cdot z^1q^{1\cdot 4} \cdot z^3q^{3\cdot 5} \cdot z^0q^{0\cdot 6} = z^2q^2 \cdot zq^4 \cdot z^3q^{15} = z^6q^{21}$$ for two 1s, no 2s, no 3s, one 4, three 5s, and no 6s. The sequence $(1,4,4,4,4,4)$ corresponds to $$z^1q^{1\cdot 1} \cdot z^0q^{0\cdot 2} \cdot z^0q^{0\cdot 3} \cdot z^5q^{5\cdot 4} \cdot z^0q^{0\cdot 5} \cdot z^0q^{0\cdot 6} = zq \cdot z^5q^{20} = z^6q^{21}$$ for one 1, no 2s, no 3s, five 4s, no 5s, and no 6s. Etc. The 32 sequences listed in the comment correspond to $32z^6q^{21}$ in the expansion.

In case you're interested in other sums besides 21 still with 6-sided dice with possible values $\{1,2,3,4,5,6\}$ on each face, here are some relevant terms from the expansion: $$\cdots + 29z^6q^{18} + 30z^6q^{19} + 32z^6q^{20} + 32z^6q^{21} + 32z^6q^{22} + 30z^6q^{23} + 29z^6q^{24} + \cdots$$