How to count number of positive solutions of an equation $x_1 + x_2 +...+ x_n = s$ where $0 < x_i \le c $.

41 Views Asked by At
  • I want to solve the equation:
    $$ x_1 + x_2 +...+ x_n = s \\ \text{where }\ 0 < x_i \le c $$
  • Or to rephrase the question count number of ways to break number $s$ in to $n$ numbers where each number is between $1$ to $c$.
  • Without upper bound $x_i < c$ I can use stars and bars method. But since i have upper limit can i still use same method with some modification? Or can you reference me to some other method which can help me solve this.