Number of ways to pick elements such mutual ordering remains maintained?

42 Views Asked by At

The number of ways to pick elements from two sets such that mutual ordering remains intact of both the sets.

For example:
Set 1:(a,b)
Set2:(c,d)
What I mean is a should come before b in any order you pick similarly c before d.
Number of ways is 6
{abcd,acdb,acbd,cabd,cadb,cdab} 
1

There are 1 best solutions below

0
On

In general, if the first ordered set has $m$ elements and the second $n$, then every such order is found by having $n+m$ places reserved and picking the $m$ places where the elements of the first set are going to go (in order). The remaining places get the second set elements (also in order).

Picking $m$ places from $n+m$ can be done in $\binom{n+m}{m}$ ways. Note that we could also pick the places for set $2$ first too, but this gives the same result as $\binom{n+m}{n} = \binom{n+m}{m}$.

In your case $n=m=2$ and indeed $\binom{4}{2} = \frac{4!}{2! 2!} = \frac{24}{4}=6$.