Skip to main content

Combinations with repetition

Computes the number of ways to choose k elements among n, allowing repetitions.

Syntax

combinations_with_repetition(Integer, Integer)
combinations_with_repetition(List | Vector, Integer)

Description

Given two integers nn and kk, returns the number of ways to choose kk elements among nn, allowing repetitions.

combinatorics.combinations_with_repetition1.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, allowing repetition.

combinatorics.combinations_with_repetition2.calc.png