0

Having this recursive function :

int F(int n, int m){
    if(m == 0 || m == n)
        return 1;
    return F(n-1, m-1) + F(n-1, m);
}

what is the effect of the function?

For the example, F(15, 13) returns 105. I'm struggling to find the answer but i couldn't resolve this.

Gabi
  • 125

1 Answers1

1

$$F(n,m) = \binom{n}{m}.$$

The function $F(n,m)$ computes the $m$th entry in the $n$th row of Pascal's triangle (if you count starting at $0$).

angryavian
  • 89,882