Number of Solutions of a Linear Equation
## Formula
For non-negative integer solutions of:
$$x_1+x_2+\cdots+x_n=r$$
the number of solutions is:
$${}^{r+n-1}C_{n-1}$$
For positive integer solutions:
$${}^{r-1}C_{n-1}$$
## Usage
- Used to solve counting problems by interpreting variables as numbers of objects assigned to different groups.