Skip to content

Combinations ​

Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand.

Return all k-element combinations of a collection.

WikipediaCombinationMathWorldCombinationWikidataQ202805Encyclopedia of MathematicsCombinationBritannicatopic/combinationRosetta CodeCombinations
Combinations((S, integer) -> list<string> where S: string) & ((collection, integer) -> list<list>)as compute-engine declares it
Typed signatures
TypePackageApplies
((S, integer) -> list<string> where S: string) & ((collection, integer) -> list<list>)compute-enginealways

Domain: Compute engine

Examples

Basic #

The 2-element combinations of a list

live ↗
InCombinations([1,2,3],2)\mathrm{Combinations}(\bigl\lbrack1, 2, 3\bigr\rbrack, 2)Out[[1,2],[1,3],[2,3]]\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack1, 3\bigr\rbrack, \bigl\lbrack2, 3\bigr\rbrack\bigr\rbrack
About
Examples1
CrosswalkWikipediaMathWorldWikidataEncyclopedia of MathematicsBritannicaRosetta Code