Rolling dice probability by solving inequlity I was trying to solve a problem where I have to find the probability of the sum of $\mathcal 3$ rolls of a die being less than or equal to $\mathcal 9$.
In order to solve the problem I try first to find the number of non-negative integer solutions to the following inequality:  $x_{1} + x_{2} + x_{3} \le 6$
From this it follows that by introducing the slack variable $x_{4}$ , I could rewrite the inequality as the following equation:  $x_{1} + x_{2} + x_{3} + x_{4} = 6$  where  $x_{4} = 6 - (x_{1} + x_{2} + x_{3})$
Therefore the answer would be $\binom{9}{3}$ solutions, where I have to remove 4 impossible solutions leaving me with $\frac{80}{6^3}$ as the probability.
I was wondering however, if the introduction of the slack variable $x_{4}$(forcing the equation to look like as if there were $\mathcal 4$ rolls of a die instead of $\mathcal 3$), could eventually result in a wrong probability?  Is this method a reliable way for computing this probability?
 A: Your solution is correct, except that you count 4 illegal solutions instead of 3.
As Barak Manos says, the probability of the event that the sum of the dice is at most 9 is the number of dice rolls in which the sum is at most 9 divided by 216, the total number of rolls.
It remains to count the number of solutions to $x_1+x_2+x_3 \leq 9$ for integers between 1 and 6. This is now strictly a counting problem - it has nothing to do with probability or dice anymore. Barak Manos solves it by going over all possible solutions, but this would be impractical for a large number of dice - your proposed solution is better I think.
As you explain, the number of solutions is equal to the number of nonnegative integer solutions to $ y_1+y_2+y_3+y_4 = 6$ where $0 \leq y_1,y_2,y_3 \leq 5$ and $y_4 \geq 0$. The first three $y$'s correspond to the first three $x$'s minus 1, which is why they are at most $5$. The slack variable $y_4$ has no such constraint. Now by the stars and bars method the number of solutions is $\binom{9}{3}$, minus the 3 illegal solutions in which one of the three $x_i$'s is 7. This gives 81 solutions, which yields the same probability that Barak Manos got.
A: An alternative solution (not a direct answer to your question):
Sums equal to $3$:


*

*We have $1$ permutation  of $1,1,1$


Sums equal to $4$:


*

*We have $3$ permutations of $1,1,2$


Sums equal to $5$:


*

*We have $3$ permutations of $1,1,3$

*We have $3$ permutations of $1,2,2$


Sums equal to $6$:


*

*We have $3$ permutations of $1,1,4$

*We have $6$ permutations of $1,2,3$

*We have $1$ permutation  of $2,2,2$


Sums equal to $7$:


*

*We have $3$ permutations of $1,1,5$

*We have $6$ permutations of $1,2,4$

*We have $3$ permutations of $1,3,3$

*We have $3$ permutations of $2,2,3$


Sums equal to $8$:


*

*We have $3$ permutations of $1,1,6$

*We have $6$ permutations of $1,2,5$

*We have $6$ permutations of $1,3,4$

*We have $3$ permutations of $2,2,4$

*We have $3$ permutations of $2,3,3$


Sums equal to $9$:


*

*We have $6$ permutations of $1,2,6$

*We have $6$ permutations of $1,3,5$

*We have $3$ permutations of $1,4,4$

*We have $3$ permutations of $2,2,5$

*We have $6$ permutations of $2,3,4$

*We have $1$ permutation  of $3,3,3$


So the number of sums less than or equal to $9$ is $81$.
The total number of sums is $6^3=216$, hence the probability is $\frac{81}{216}$.
