Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to eliminate the repeated case from polynomial counting?

assume a die throw $3$ times, do not allow repeated number appear

$$(x+x^2+x^3+x^4+x^5+x^6)^3 - y$$

how to count the repeated case, that should be minused in above polynomial counting? what is $y$ in terms of polynomial of $x$?

Mark six maple code

subs(z=0, diff(expand((1+z*x)*(1+z*x^2)*(1+z*x^3)*(1+z*x^4)*(1+z*x^5)*(1+z*x^6)*(1+z*x^7)*(1+z*x^8)*(1+z*x^9)*(1+z*x^10)
*(1+z*x^41)*(1+z*x^42)*(1+z*x^43)*(1+z*x^44)*(1+z*x^45)*(1+z*x^46)*(1+z*x^47)*(1+z*x^48)*(1+z*x^49)), z$6));
share|cite|improve this question
up vote 4 down vote accepted

Instead of subtracting out the repeated cases, it's easier to only generate the non-repeated cases in the first place:


Then the coefficient of $z^3x^n$ counts the number of partitions of $n$ into $3$ distinct parts from $1$ to $6$, and the number of ways of getting that sum from the dice is $3!$ times that number, which is the coefficient of $x^n$ in

$$\left.\frac{\partial^3}{\partial z^3}\left((1+zx)(1+zx^2)(1+zx^3)(1+zx^4)(1+zx^5)(1+zx^6)\right)\right|_{z=0}\;.$$

share|cite|improve this answer
very useful for counting mark six gambling – M-Askman Mar 3 '12 at 13:20
after diff and subs z = 0, the whole equation become zero – M-Askman Mar 4 '12 at 9:51
@Marco: I don't see any equations here. In case you mean the expression I wrote down, please explain why you believe its value is zero. Wolfram|Alpha thinks otherwise. – joriki Mar 4 '12 at 15:34
sorry it is not zero, 6*x^15+6*x^14+12*x^13+18*x^12+18*x^11+18*x^10+18*x^9+12*x^8+6*x^7+6*x^6, if there is no ordering, i think that no need to multiply 3!, thank you – M-Askman Mar 5 '12 at 1:39
@Marco: Your question failed to specify whether you wanted to distinguish by order; I inferred that you did from the facts that the expression you gave for the count with repeated cases distinguished by order and that in the context of dice rolls one is usually interested in probabilities, for which order needs to be distinguished. – joriki Mar 5 '12 at 4:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.