This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# | |
# This snippet provides a simple function "combination" that can compute an | |
# arbitrary k-combination of n elements given an index m into the | |
# lexicographically ordered set of all k-combinations of n elements. | |
from math import comb | |