<commit_before>---
published: true
title: Combination
tags: math probability
---
> _nCr_ a selection of items from a set that has distinct members, such that the order of selection does not matter (unlike permutations). - [wikipedia](https://en.wikipedia.org/wiki/Combination) / [calculator](https://www.calculatorsoup.com/calculators/discretemathematics/combinations.php)

5 C 3 = 10: 3 elements subsets of 5 elements set

![caption](https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Combinations_without_repetition%3B_5_choose_3.svg/440px-Combinations_without_repetition%3B_5_choose_3.svg.png)<commit_msg>Update 2022-02-18-math-combination.md<commit_after>---
published: true
title: Combination
tags: math probability hash
---
> _nCr_ a selection of items from a set that has distinct members, such that the order of selection does not matter (unlike permutations). - [wikipedia](https://en.wikipedia.org/wiki/Combination) / [calculator](https://www.calculatorsoup.com/calculators/discretemathematics/combinations.php)

5 C 3 = 10: 3 elements subsets of 5 elements set

![caption](https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Combinations_without_repetition%3B_5_choose_3.svg/440px-Combinations_without_repetition%3B_5_choose_3.svg.png)

### [Combinatorial Number system](https://en.wikipedia.org/wiki/Combinatorial_number_system)

The combinatorial number system of degree k (for some positive integer k), also referred to as combinadics, or the Macaulay representation of an integer, is a correspondence between natural numbers (taken to include 0) N and k-combinations, represented as strictly decreasing sequences ck > ... > c2 > c1 ≥ 0. Since the latter are strings of numbers, one can view this as a kind of numeral system for representing N, although the main utility is representing a k-combination by N rather than the other way around. Distinct numbers correspond to distinct k-combinations, and produce them in lexicographic order

This can be seen as a kind of perfect hash for certain situation
{'fraction_non_alphanumeric': 0.08768472906403942, 'fraction_numerical': 0.023645320197044337, 'mean_word_length': 5.366771159874608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '508458', 'n_tokens_mistral': 620, 'n_tokens_neox': 568, 'n_words': 202}