Skip to main content

Combinations

Computes the number of ways to choose k elements among n: nk.

Syntax

combinations(Integer, Integer)
combinations(List | Vector, Integer)

Description

Given two integers nn and kk, returns the number of ways to choose kk elements among nn: nk\binom{n}{k}.

combinatorics.combinations1.calc.png

Given a list or vector L and an integer kk, returns a list with all the possible ways to choose kk element among LL.

combinatorics.combinations2.calc.png