Skip to main content
Module

x/simplestatistics/index.js>combinations

simple statistics for node & browser javascript
Go to Latest
function combinations
import { combinations } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

Implementation of Combinations Combinations are unique subsets of a collection - in this case, k x from a collection at a time. https://en.wikipedia.org/wiki/Combination

Examples

combinations([1, 2, 3], 2); // => [[1,2], [1,3], [2,3]]

Parameters

x

any type of data

k

the number of objects in each group (without replacement)