Combinations with repetition

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

Syntax

combinations_with_repetition(Integer, Integer)
 Vector, Integer)

Description

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

combinatorics.combinations_with_repetition1.calc.png

Given a list or vector L and an integer kLaTeXk, returns a list with all the possible ways to choose kLaTeXk element among LLaTeXL, allowing repetition.

combinatorics.combinations_with_repetition2.calc.png