Calculating Possible Combinations in 2 Vectors

  • Thread starter Thread starter King
  • Start date Start date
  • Tags Tags
    Combinations
AI Thread Summary
The discussion centers on calculating the number of possible combinations of filling a two-dimensional vector with values from a one-dimensional vector. The one-dimensional vector has 5 values, while the two-dimensional vector has 9 spots. The calculation involves selecting 5 spots from the 9 and then determining the permutations of the 5 numbers in those spots, leading to the formula P(9,5) = 15,120. Participants clarify that permutations account for the order of placement, unlike combinations. Understanding these concepts is crucial for accurately determining the number of combinations in this scenario.
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.

\binom{9}{5} 5! = 15,120

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:
 
I was reading documentation about the soundness and completeness of logic formal systems. Consider the following $$\vdash_S \phi$$ where ##S## is the proof-system making part the formal system and ##\phi## is a wff (well formed formula) of the formal language. Note the blank on left of the turnstile symbol ##\vdash_S##, as far as I can tell it actually represents the empty set. So what does it mean ? I guess it actually means ##\phi## is a theorem of the formal system, i.e. there is a...

Similar threads

Back
Top