0
$\begingroup$

In how many ways a positive number X can be represented as a sum of Y positive integer numbers and how to find them?

Eg 1: 7 (X) can be represented as a sum of 2 (Y) numbers in following way: (3+4), (2+5), (1+6).

Eg 2: 7 (X) can be represented as a sum of 3 (Y) numbers in following way: (1+1+5), (1+2+4), (1+3+3), (2+2+3).

What happens when p = 1 here.

  • 0
    See whether this helps you: http://math.stackexchange.com/questions/217597/number-of-ways-to-write-n-as-a-sum-of-k-nonnegative-integers2017-01-09

1 Answers 1

0

A helpful fuction code is available here.