How can I calculate the number at a given row and column in Pascal's Triangle?
I'm trying to create a function that, given a row and column, will calculate the value at that position in Pascal's Triangle. Example: val = GetPasVal(3, 2); // returns 2 So here I'm specifying row 3, column 2, which as you can see: 1 1 1 1 2 1 ...should be a 2. The Pascal's triangle contains the Binomial Coefficients C(n,k); There is a very convenient recursive formula C(n, k) = C(n-1, k-1) + C(n-1, k) You can use this formula to calculate the Binomial coefficients. Using Armen's equation the recursive code for implementing pascals triangle will be like below: using System; using System