Returns the binomial coefficient using the factorial function.

View versions (2)

Interface

#include <codecogs/maths/combinatorics/arithmetic/binomial_coefficient.h>

using namespace Maths::Combinatorics::Arithmetic;

The binomial coefficient $\left ( \begin{array}{c}n\\k \end{array} \right )$ is the number of ways to pick k unordered outcomes from n possibilities. This is also known as combination number, $_{n}C_k$. It is defined as:

$$_nC_k \equiv \left ( \begin{array}{c}n\\k \end{array} \right ) \equiv \frac{n!}{k!(n-k)!}$$
(1)

Parameters

n
number of possibilities
k
number of outcomes

Returns

the binomial coefficient C(n, k), i.e. n! / (k!(n-k)!)
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

n
k
Result