Hacker News new | past | comments | ask | show | jobs | submit login

A permutation is any of the possible ways to turn a set into an ordered list. For example, the set {1,2,3} has the following permutations:

[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1].

A set of n elements has n! (n factorial) permutations: you have n options to pick the first element, n-1 to pick the second element, and so on.

A combination of a set is one of its subsets, including the set itself and the empty set. The set {1,2,3} has the following subsets:

{}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}.

A set of n elements has exactly 2^n combinations; for each element you either include or exclude it.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: