combinatorics utilities