0

Let's say i have two sets: Set_A = {1,2,3} and Set_B = {4,5,6}.

I am looking two find all possible combinations between the elements of the two sets but without changing the order of the elements of each set.

For example (1,2,3,4,5,6) is a valid combination. But (2,1,3,4,5,6) is not valid. So the elements of Set_A must be ordered within the combination so the elements of Set_B.

  • Can you give more examples of valid arrangements? Is $(1,4,2,5,3,6)$ a valid combination? If we were to just arrange three identical $a$'s and three identical $b$'s in some order, such as $(a,b,a,b,a,b)$ and then replace the first $a$ with $1$, replace the second $a$ with $2$, and the third $a$ with $3$... and then do the same for replacing the $b$'s from left to right with the numbers $4,5,6$... So... how many ways can you arrange identical $a$'s and identical $b$'s? – JMoravitz Apr 20 '20 at 17:05
  • To answer your first question , Yes this is a valid combination. As for your second argument i don't think that leads to a solution of what i am looking for. The elements don't necessarily need to be oscillating like you said (a,b,a,b,a,b) etc – Vaios Argiropoulos Apr 20 '20 at 17:10
  • If you are asking how many combinations are possible, I think this problem is equivalent to choosing 3 numbers from the set { 1,2,3,4,5,6} as the positions for elements of the set A,whose ordering is forced. The remaining positions are for set B, with forced order. I am not posting a solution because I am not sure this is your question and that my point is totally valid – Giuseppe Tenaglia Apr 20 '20 at 17:22
  • To form my combinations i choose whatever number from Set_A or Set_B as long as it doesn't break the order in which the elements appear on both of these sets. For example i can't choose element 2 first and after some steps to choose element 1. Or for example i can't choose element 5 first and later to choose element 4. – Vaios Argiropoulos Apr 20 '20 at 17:28
  • Another valid example is this. I choose element 4 first, element 5 second, element 1 third, element 6 fourth, element 2 fifth and element 3 last. So my valid combination would be (4,5,1,6,2,3) – Vaios Argiropoulos Apr 20 '20 at 17:30
  • I never said that they needed to be oscilating. $\color{red}{aa}\color{blue}{b}\color{red}{a}\color{blue}{bb}$ would be another valid example corresponding to the arrangement $\color{red}{12}\color{blue}{4}\color{red}{3}\color{blue}{56}$. The point is that you can completely ignore that it was numbers, and just use what set they come from... ignoring everything except the label of the set itself. – JMoravitz Apr 20 '20 at 17:40
  • 1
    Just choose which of the available spaces were used by the elements of $A$ simultaneously... Once having chosen which spaces are given to the elements of $A$, place the elements of $A$ in those spaces in the correct order. Then for the remaining spaces, place the elements of $B$ in their correct order. This gives a count of $\binom{|A|+|B|}{|A|}$ – JMoravitz Apr 20 '20 at 17:40
  • @JMoravitz Your counting seems correct. I've found 20 combinations by doing it by hand. By |A| you mean the number of elements of A right ? – Vaios Argiropoulos Apr 20 '20 at 17:49

0 Answers0