# (Probability)Bars and stars problem with two constraints

What is the probability that you roll 4 die and get a sum less than or equal to 5?

So far, I have come up with this:

$x_1 + x_2 + x_3 + x_4 \leqslant5$

Constraints:

$x_1, x_2, x_3, x_4 \leqslant6$

$x_1, x_2, x_3, x_4 \geqslant 1$

Now we typically find $y_1, y_2, y_3$ and $y_4$ to adjust the equation for the constraints but the fact that there are two of them is throwing me off.

$y_1 = x_1 - 0 = x_1$

$y_2 = x_1 -7$

I'm having a hard time seeing how we can transfer both of the equations above to the same variable and add it to the main equation nicely in order to find the slack variable and use the stars and bars method to find the answer.

Do we simply do

$y_1 = x_1 - 7$ and so on ?

I know that this is a simple problem but I was wondering if anybody could explain the general rule to me so that I can solve others with a larger sum involved.

• Hint: The only ways to get a sum $≤5$ are all $1's$ or three $1's$ and one $2$. – lulu Feb 2 '16 at 1:35
• Indeed. Don't over complicate matters. Do the least amount of work necessary. (PS @Lulu post that as an answer. ) – Graham Kemp Feb 2 '16 at 1:41

There are only two paths to success here: Either four $1's$ or three $1's$ and a $2$. Let's just analyze them separately.
Four $1's$: Probability $\frac 1{6^4}$.
Three $1's$ and a $2$: the two can be on any of the four die. If we fix a location for the $2$ we get probability $\frac 1{6^4}$, so the probability that we win along this path is $\frac 4{6^4}$.
Finally, the answer is $$\frac 1{6^4}+\frac 4{6^4}=\frac 5{6^4}\sim .00386$$
You can ignore the first constraint. If any of them were $6$ or higher, the sum would be greater than $5$. You only have to consider the second one.