Stars & Bars with limitations I've heard about the term Stars & Bars and found that it relates to a problem I'm attempting to solve, yet I'm not sure how to implement it.
The problem states that 3 fair dice are rolled, where every die has the numbers $[1,7]$, and we're tasked with finding the probability that the sum would be $14$.
My attempt in converting this to a stars & bars problem was the intuition that $|\Omega|=7^3$ , and we can notate $E$ for all solutions where the sum is $14$, hence $|E|$ would be the number of solutions to the equation $x_1+x_2+x_3=14$, with the restriction $1\leq x_i\leq7$.
If the restriction were $x_i\geq0$, this would be a simple plug into formula situation.
I've read on how to handle a one way limitation, for example $1\leq x_i$, though I'm unsure on how to approach a two way limitation (I assume it would require to split the problem and then reunite in some way).
 A: First note that the number of solutions to
$$x_1 + x_2 + x_3 = 14, \,\,\;\; x_1,x_2,x_3\ge1$$
is the same as with
$$x_1 + x_2 + x_3 = 11, \,\,\;\; x_1,x_2,x_3\ge0$$
which is $\binom{11+3-1}{3-1}=78$.
Each solution that involves an $x$ larger than $6$ is therefore also a solution to
$$7+x_1 + x_2 + x_3 = 11, \,\,\;\; x_1,x_2,x_3\ge0$$
or
$$x_1 + x_2 + x_3 = 4, \,\,\;\; x_1,x_2,x_3\ge0$$
which is $\binom{4+3-1}{3-1}=15$.
There are three ways that this $x$ can be placed, so the final answer is $78-3\cdot15=33$.
A: I hope that by now you have solved your problem using stars and bars, here's an algebraic approach you may like.
Basically, we need to find
coefficient of $x^{14}$ in the expansion of $(x+x^2+x^3+...+x^7)^3$
= coefficient of $x^{11}$ in the expansion of $(1+x+x^2+....+x^6)^3$
$= [(1-x^7)/(1-x)]^3$
$= (1-x^7)^3\cdot(1-x)^{-3}$
Expand the second term using the negative binomial Theorem, and collect coefficients of $x^{11}$, thus
$[1-\binom31 x^7]\cdot[1+\binom31 x + \binom42 x^2 + ...+\binom64 x^4 + ...+\binom{13}{11} x^{11}]$
$= 1\cdot\binom{13}{11} - \binom31\cdot\binom64 = 33$
