If two dice are thrown simultaneously, find the probability of getting a sum of 7 or 11

Solution:

Sample space of rolling of 2 dice is as below,

S = {(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6) (6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)}

n(S) = 36

Let A = sum of numbers is 7 = { (1, 6)(2, 5)(3, 4) (4, 3) (5, 2) (6, 1)}

n(A) = 6

P (Sum of numbers is 7) = n(A) / n(S)

= 6/36 = 1/6

Therefore, the probability of rolling two dice and getting a sum of 7 is 1/6.

Summary:

The probability of rolling two dice and getting a sum of 7 is 1/6.

In general, the problem of restricted partitions is quite difficult. I'll frame the problem in a more general setting:

Suppose we have $n$ dice, having $k$ faces numbered accordingly. How many ways are there to roll some positive integer $m$?

This problem can be de-worded as:

How many solutions are there to the equation $$\sum_{i=1}^n x_i=m$$ With the condition that $x_i\in \mathbb{N}_{\leq k}~\forall i\in\{1,...,k\}.$

The solution to this problem is not so simple. In small cases, like $n=2, k=6, m=7$, this can be easily checked with a table; a so called brute force approach. But for larger values of $n,k$ this is simply not feasible. Based on this post I think in general the solution to this problem is the coefficient of $x^m$ in the multinomial expansion of $$\left(\sum_{j=1}^k x^j\right)^n=x^n\left(\frac{1-x^k}{1-x}\right)^n$$ In fact, let us define the multinomial coefficient: $$\mathrm{C}(n,(r_1,...,r_k))=\frac{n!}{\prod_{j=1}^k r_j!}$$ And state that $$\left(\sum_{j=1}^k x_j\right)^n=\sum_{(r_1,...,r_k)\in S}\mathrm{C}(n,(r_1,...,r_k))\prod_{t=1}^k {x_t}^{r_t}$$ Where $S$ is the set of solutions to the equation $$\sum_{j=1}^k r_j=n$$ With the restriction that $r_j\in \mathbb{N}~\forall j\in\{1,...,k\}.$ However, herein lies the problem: In order to compute the number of ways to roll $m$ with $n$ $k$ sided die, which is a problem of computing restricted partitions of the number $m$, we need to find the coefficient of $x^m$ in a multinomial expansion. But, in order to compute this multinomial expansion, we need to compute restricted partitions of $n$. As you can see the problem is a bit circular. But, $n$ is usually smaller than $m$, so it might speed up the computation process a little. But at the end of the day some amount of brute-force grunt work will be required.