Iterating over all k-element subsets of a finite set.

The problem stated in the title belongs to the class of ‘traditional’ combinatorial problems and it often appears in practice. Let us restate it in more exact terms first:

Given an n-element set S, enumerate all k-element subset where k is less or equal n.

Example: With S = {1,2,3} and k = 2 all 2-element subsets are

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
applied.math.coding

applied.math.coding

526 Followers

I am a mathematician and software developer who likes writing advanced code and to do research in applied and pure mathematics.