Efficient Calculation of Combinations with a Fixed Number of Elements

In summary, the conversation discusses a problem involving finding the 12th combination of combinations with 3 elements from a list of numbers. The conversation goes on to explore different strategies for calculating combinations faster and generalizing the process for larger combinations. It also discusses the possibility of repeating elements in the combinations and how it affects the total number of possibilities. Lastly, it touches on a new problem involving finding the 197th combination of size 5 without repeating elements.
  • #1
ryt
9
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
  • #2
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.
 
  • #3
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.
 
  • #4
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?
 
  • #5
r is the size of the combination; in your case 3.
 
  • #6
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
 
  • #7
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.
 
  • #8
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:
  • #9
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.
 

Related to Efficient Calculation of Combinations with a Fixed Number of Elements

1. How do you solve a simple combinations problem?

A simple combinations problem can be solved by using the formula nCr = n! / (r!*(n-r)!), where n represents the total number of items and r represents the number of items being selected. For example, if you have 5 different colored marbles and you want to select 3 of them, the formula would be 5C3 = 5! / (3! * (5-3)!) = 10. This means there are 10 different ways to select 3 marbles from a total of 5.

2. What is the difference between a combination and a permutation?

A combination is a selection of objects where the order does not matter, while a permutation is a selection of objects where the order does matter. For example, if you have 3 different colored socks and you want to select 2 of them, a combination would give you 3C2 = 3 different options (red and blue, red and green, blue and green), while a permutation would give you 3P2 = 6 different options (red and blue, blue and red, red and green, green and red, blue and green, green and blue).

3. How do you know when to use a combination or a permutation?

You would use a combination when the order of the objects does not matter, such as selecting a group of people for a team. You would use a permutation when the order of the objects does matter, such as arranging a set of numbers.

4. Can a combination or permutation have repeated elements?

No, a combination or permutation cannot have repeated elements. This means that once an object is selected, it cannot be selected again in the same combination or permutation.

5. How can I check my work for a simple combinations problem?

You can check your work by using the formula nCr = n! / (r!*(n-r)!), where n represents the total number of items and r represents the number of items being selected. Make sure to simplify the factorial expressions and check that your final answer is a whole number. You can also use a calculator or online combination calculator to double check your work.

Similar threads

  • Advanced Physics Homework Help
Replies
11
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Precalculus Mathematics Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
18K
  • Introductory Physics Homework Help
Replies
12
Views
868
  • Programming and Computer Science
Replies
9
Views
1K
  • Precalculus Mathematics Homework Help
Replies
10
Views
2K
  • Programming and Computer Science
Replies
5
Views
3K
  • Calculus and Beyond Homework Help
Replies
28
Views
5K
  • Programming and Computer Science
Replies
2
Views
2K
Back
Top