Top "Binomial-coefficients" questions

It is the coefficient of the `x^k` term in the polynomial expansion of the binomial power `(1 + x)^n` which is `(n!)/((n-k)!*k!)`.

Number of combinations (N choose R) in C++

Here I try to write a program in C++ to find NCR. But I've got a problem in the result. …

c++ combinatorics binomial-coefficients
How to efficiently calculate a row in pascal's triangle?

I'm interested in finding the nth row of pascal triangle (not a specific element but the whole row itself). What …

algorithm combinations binomial-coefficients pascals-triangle
Which is better way to calculate nCr

Approach 1: C(n,r) = n!/(n-r)!r! Approach 2: In the book Combinatorial Algorithms by wilf, i have found this: C(…

c performance algorithm mathematical-optimization binomial-coefficients
Fast n choose k mod p for large n?

What I mean by "large n" is something in the millions. p is prime. I've tried http://apps.topcoder.com/…

c++ algorithm modular binomial-coefficients
What is a good way to implement choose notation in Java?

... preferably in Java. Here is what I have: //x choose y public static double choose(int x, int y) { if (…

java combinations binomial-coefficients
Binomial test in Python for very large numbers

I need to do a binomial test in Python that allows calculation for 'n' numbers of the order of 10000. I …

python binomial-coefficients
point biserial and p-value

I am trying to get a point biserial correlation between a continuous vocabulary score and syntactic productivity (dichotomous: productive vs …

r correlation binomial-coefficients
Calculating nCr mod p efficiently when n is very large

I need to calculate nCr mod p efficiently. Right now, I have written this piece of code, but it exceeds …

python binomial-coefficients
Algorithm to find Sum of the first r binomial coefficients for fixed n modulo m

I am trying to find the sum of the first r binomial coefficients for a fixed n. (nC1 + nC2 + nC3 + ... + …

algorithm modulo binomial-coefficients