Binomial coefficients: binomial comb nCr

### 5.6.2 Binomial coefficients: binomial comb nCr

The comb command computes the binomial coefficients.
nCr is a synonyms for comb.

- comb takes two arguments:
  n and p, integers.
- comb(n,p) returns (pn) =Cnp.

#### Example

Input:

comb(5,2)

Output:

10

Remark.
The binomial command (see Section 8.4.3) can also compute the binomial coefficients, but unlike comb and nCr it can take an optional third argument, a real number a, to compute the binomial distribution. In this case binomial(n,p,a) returns (pn) ap(1−a)n−p, the probability of p successes in n independent Bernoulli trials, where each trial has a probability a of success.

#### Example

Input:

binomial(5,2,0.5)

Output:

0.3125