like a k=2-combination would for example be {26, 92}

Solved

Posted on 2006-10-24

Thinking along the lines of permutations, I wonder what the precise terminology is to describe the following (and I know permutations is NOT the correct term):

I have a set of numbers, say:

{26, 74, 92}

From this I want to create sets that include 1 or more values from the original set, any any order, but never repeating the same member of the set. To express it in binary, it would look like this:

100

010

110

001

101

011

111

Which equates to these sets:

{26}

{74}

{26, 74}

{92}

{26, 92}

{74, 92}

{26, 74, 92}

Does that make sense? What I've done is solved a problem where I have a value, say x, and I want to find out which subsets of the original value set, sum up to x. The program works, but I know I'm using the wrong terminology when I call it "permutations," which by definition involves all the members of the original set.

In looking on the web, I found something that suggests it should be called "k-combinations", but this is a little above my head:

(From Wikipedia)

In combinatorial mathematics, a combination is an un-ordered collection of unique elements. Given S, the set of all possible unique elements, a combination is a subset of the elements of S. The order of the elements in a combination is not important (two lists with the same elements in different orders are considered to be the same combination). Also, the elements cannot be repeated in a combination (every element appears uniquely once). A k-combination (or k-subset) is a subset with k elements. The number of k-combinations (each of size k) from a set S with n elements (size n) is the binomial coefficient

Does anyone know for sure what I would call this operation?

I have a set of numbers, say:

{26, 74, 92}

From this I want to create sets that include 1 or more values from the original set, any any order, but never repeating the same member of the set. To express it in binary, it would look like this:

100

010

110

001

101

011

111

Which equates to these sets:

{26}

{74}

{26, 74}

{92}

{26, 92}

{74, 92}

{26, 74, 92}

Does that make sense? What I've done is solved a problem where I have a value, say x, and I want to find out which subsets of the original value set, sum up to x. The program works, but I know I'm using the wrong terminology when I call it "permutations," which by definition involves all the members of the original set.

In looking on the web, I found something that suggests it should be called "k-combinations", but this is a little above my head:

(From Wikipedia)

In combinatorial mathematics, a combination is an un-ordered collection of unique elements. Given S, the set of all possible unique elements, a combination is a subset of the elements of S. The order of the elements in a combination is not important (two lists with the same elements in different orders are considered to be the same combination). Also, the elements cannot be repeated in a combination (every element appears uniquely once). A k-combination (or k-subset) is a subset with k elements. The number of k-combinations (each of size k) from a set S with n elements (size n) is the binomial coefficient

Does anyone know for sure what I would call this operation?

3 Comments

Comment Utility

combinations is the correct term. k-combinations assumes a value of k given, where k is the number of elements in the resulting combination from the original set.

like a k=2-combination would for example be {26, 92}

like a k=2-combination would for example be {26, 92}

Comment Utility

Hi jmundsack,

combinations

Given a set of n numbers,this involves choosing k numbers from these n in such a way that no value is repeated. Such a combination would be called k-combination. In the example you gave, you generated all possible combinations (for k=1 to 3)

http://en.wikipedia.org/wiki/Combination

Cheers!

sunnycoder

combinations

Given a set of n numbers,this involves choosing k numbers from these n in such a way that no value is repeated. Such a combination would be called k-combination. In the example you gave, you generated all possible combinations (for k=1 to 3)

http://en.wikipedia.org/wi

Cheers!

sunnycoder

Comment Utility

Thanks! I see you both posted at 7:21 EST so I'm splitting points.

Title | # Comments | Views | Activity |
---|---|---|---|

How to keep data stored in generic List<T> available during all processes at the same page. | 3 | 87 | |

Microsoft C++ code failing in executable that worked | 9 | 51 | |

SUM 2 INTEGER ARRAYS INTO 1 | 10 | 56 | |

Recommendation vb6 to vb.net or others | 14 | 23 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**16** Experts available now in Live!