Efficient Calculation of Combinations with a Fixed Number of Elements

  • Thread starter Thread starter ryt
  • Start date Start date
  • Tags Tags
    Combinations
Click For Summary

Homework Help Overview

The discussion revolves around calculating combinations, specifically focusing on the combinations of a fixed number of elements from a given set of integers. The original poster presents a problem involving the calculation of the 12th combination of three elements from the set {1, 2, 3, 4, 5, 6, 7} and seeks a more efficient method than enumerating each combination step by step.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • Participants explore various methods for calculating combinations, including reasoning about the structure of combinations and the lexicographic order of elements. Some participants question the assumptions about ordering and the total number of combinations possible.

Discussion Status

The discussion is active, with participants providing insights into different approaches to the problem. Some guidance has been offered regarding the generalization of combinations and the implications of ordering. However, there is no explicit consensus on the best method or resolution to the original poster's query.

Contextual Notes

There is a mention of constraints regarding the uniqueness of elements in combinations and the potential for missing combinations if order is not considered. Additionally, the original poster raises a new question about finding the 197th combination of size 5 from a larger set, indicating a shift in focus within the discussion.

ryt
Messages
9
Reaction score
0
[SOLVED] simple combinations problem

Homework Statement



what is 12. combination of combinations with 3 elements of 1,2,3,4,5,6,7 ?

Homework Equations





The Attempt at a Solution



i tried step by step
123 - 124 - 125 - 126 - 127 - 134 - 135 - 136 - ... - and finaly i arrived at 12. witch is 147

is there a way to calculate it faster?, not step by step
 
Physics news on Phys.org
I guess you can quickly reason that there must be five that begin with 12, four that begin with 13 and three that begin with 14 the last one of which must end in 7.

To generalize, let L be a list of r-combinations of the integers n_1, n_2, ..., n_m (n_1 < n_2 < ... < n_m) ordered in increasing lexicographic order.

There will be m - r + 1 that begin with n_1...n_(r-2)n_(r-1), m - r that begin with n_1...n_(r-2)n_r, m - r - 1 that begin with n_1...n(r-2)n_(r+1), etc. Knowing this you can quickly find the ith component in the sequence.
 
I don't really understand the question.
If you want to make combinations of three elements with the numbers 1, 2, 3, 4, 5, 6, 7 in which a number may not occur more than once, you can do it like this:
Suppose you have three places, ..., and you want to put a number on each of them. For the first one, you can choose 1, 2, 3, 4, 5, 6 or 7, so 7 possibilities. After you have chosen a number, say 4, it looks like: 4.. and you must choose a number from 1, 2, 3, 5, 6 and 7 to put in the second spot. Whatever number you chose for the first, you have 6 possibilities left for the second number. Then for the last place, you have 5 possibilities left. The total number of possibilities is thus 7 x 6 x 5 = 210.
 
e(ho0n3 said:
To generalize, let L be a list of r-combinations of the integers n_1, n_2, ..., n_m (n_1 < n_2 < ... < n_m) ordered in increasing lexicographic order.

There will be m - r + 1 that begin with n_1...n_(r-2)n_(r-1), m - r that begin with n_1...n_(r-2)n_r, m - r - 1 that begin with n_1...n(r-2)n_(r+1), etc. Knowing this you can quickly find the ith component in the sequence.

i think i understand, almost.
What is r? Is this total number of combinations?
 
r is the size of the combination; in your case 3.
 
thx

CompuChip said:
If you want to make combinations of three elements with the numbers 1, 2, 3, 4, 5, 6, 7 in which a number may not occur more than once, you can do it like this:
Suppose you have three places, ..., and you want to put a number on each of them. For the first one, you can choose 1, 2, 3, 4, 5, 6 or 7, so 7 possibilities. After you have chosen a number, say 4, it looks like: 4.. and you must choose a number from 1, 2, 3, 5, 6 and 7 to put in the second spot. Whatever number you chose for the first, you have 6 possibilities left for the second number. Then for the last place, you have 5 possibilities left. The total number of possibilities is thus 7 x 6 x 5 = 210.

might also help, thx
 
Ah, I think I understand it as well :smile:
Do note that you are missing some combinations now.
E.g. in the series
123 - 124 - 125 - 126 - 127 - 134 - 135 - 136 - ... -
you will never have 132, so you will have to use a slightly different reasoning in case the numbers don't have to be ordered.
 
now i came to a bigger problem, and i stuck.

what is the 197. combination of size 5 without repeating of elements a,b,c,d,e,f,g,h,i,j,k,l ?
 
Last edited:
12x11x10x9x8= 12! - 7!= 95040. Same way as before RYT. You don't really expect me to write them all down? The above shows that there are more than 197 combinations of size 5 possible.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
9
Views
2K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
20K
  • · Replies 0 ·
Replies
0
Views
281
  • · Replies 18 ·
Replies
18
Views
14K
Replies
12
Views
2K
Replies
10
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K