Calculating Possible Combinations in 2 Vectors

  • Context: Undergrad 
  • Thread starter Thread starter King
  • Start date Start date
  • Tags Tags
    Combinations
Click For Summary

Discussion Overview

The discussion revolves around calculating the number of possible combinations of placing values from a one-dimensional vector into a two-dimensional vector. The inquiry is focused on understanding the mathematical principles behind combinations and permutations, particularly in the context of programming applications.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Conceptual clarification

Main Points Raised

  • One participant seeks to determine how many combinations can exist when placing 5 numbers from a one-dimensional vector into a two-dimensional vector with 9 spots.
  • Another participant suggests using combinations to select spots and then calculating permutations of the numbers, proposing the formula \(\binom{9}{5} 5! = 15,120\) as the answer.
  • There is mention of the concept of permutations, with one participant explaining that permutations consider the order of placement, unlike combinations.
  • Clarification is provided regarding the notation \(P(9,5)\), which represents the number of permutations of 5 items from a total of 9, calculated as \(9 \times 8 \times 7 \times 6 \times 5 = 15,120\).
  • Participants express confusion about the definitions of permutations and combinations, indicating a need for further clarification on these concepts.

Areas of Agreement / Disagreement

Participants generally agree on the mathematical approach to calculating combinations and permutations, but there is some confusion regarding the definitions and implications of these terms. The discussion remains somewhat unresolved as participants seek further clarification on specific concepts.

Contextual Notes

There is a lack of consensus on the understanding of permutations versus combinations, and some participants express uncertainty about the notation used in the calculations.

King
Messages
43
Reaction score
0
Hi all,

I am working on a programming project and want to know how many possible combinations can exist in a particular situation, but I have no idea how to work it out. It isn't homework, I just want to know because I am sure it is a VERY large number and want to make a point.

There are 2 vectors, one vector is one dimensional and is, say, 5 in length with values in it: [ 1 | 2 | 3 | 4 | 5 ] and the second vector is two dimensional and empty (to be filled with the numbers in the one dimensional vector), say like so:
+---------+
| - | - | - |
| - | - | - |
| - | - | - |
+---------+
How would I go about working out working out how many combinations of those 5 numbers can be placed in the above two dimensional vector?
eg. one would be:
+---------+
| 1 | 2 | 3 |
| 4 | 5 | - |
| - | - | - |
+---------+
another:
+---------+
| 1 | 3 | 2 |
| 4 | 5 | - |
| - | - | - |
+---------+

Thank you for any help :smile:
 
Physics news on Phys.org
There are 9 spots and 5 numbers to place in them. First pick 5 of the spots and then calculate the permutation of the 5 numbers in those 5 spots. I think this should be the answer, unless I am misunderstanding completely.

[tex]\binom{9}{5} 5! = 15,120[/tex]

This can also be calculated as the number of 5-permutations of 9 objects, since the first number would have 9 possible spots to occupy, the second would have 8 possibilities, etc...

P(9,5) = 15,120
 
Thanks for the quick reply! But what are permutations? I see that the 120 came from the 5! but I'm not sure what P(9,5) is... :confused:
 
King said:
Thanks for the quick reply! But what are permutations? I see that the 120 came from the 5! but I'm not sure what P(9,5) is... :confused:

P(a, b) is the answer to your question with 9 slots in the matrix and 5 in the vector. It was defined on the spot, it's not a usual symbol.
 
The intermediate step is P(9,5) = 9*8*7*6*5 = 15,120.

Permutations are similar to combinations except in permutations, the order matters. In combinations, the order does not.
 
Thank you very much for the help :smile:
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
7K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K