Combinatorics – Stars & Bars with Limitations

combinatoricsprobability

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).

Best Answer

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$.

Related Question