599 views
0 votes
0 votes

Consider the following function that computes the value of $\binom{m}{n}$ correctly for legal m and n

int func(int m,int n)
{
    if(n==0)||(m==n) return 1;
    else return E;
}

In the function which is correct expression for E?

a)func(m-1,n)+func(m-1,n-1)

b)func(m-1,n+1)+func(m-1,n)

c)func(m,n)+func(m,n-1)

d)None

1 Answer

Best answer
2 votes
2 votes

Using Pascal's identity,

$\binom{m}{n} = \binom{m-1}{n} +\binom{m-1}{n-1}$

Hence, option A is correct.

selected by

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
1 answer
3
Hrithik Vashishtha asked Jul 4, 2022
388 views
#include <stdio.h int main () { int i, j; int a [8] = {1, 2, 3, 4, 5, 6, 7, 8}; for(i = 0; i < 3; i++) { a[i] = a[i] + 1; i++; } i ; for (j = 7; j 4; j ) { int i = j/2; ...
2 votes
2 votes
2 answers
4
atulcse asked Jan 15, 2022
682 views
Consider the following programint find (int n) { int a = 1; for (i = 1; i < = n; i ++) for (j = 1; j < = i; j++) for (k = 1; k <= j, k++) a = a + 1; ...