[Math] Total number of combinations for pairing from two different sets

combinationscombinatoricspermutations

Assume we have two sets of numbers {1, 2, 3} and {4,5,6}. My aim is to pair two numbers together from the two different sets such as

{1} with {4}

{2} with {5}

{3} with {6}

another pairing would be

{1} with {5}

{2} with {6}

{3} with {4}

Rule is no two numbers from same set can be paired with same number from the second set.

What is the total number of combinations that I can have?

How can I generalize this result, more precisely assume the two sets have $N$ numbers what is the total number of combinations that can be considered.

Thanks,

Best Answer

A "pairing" is an injective function from $\{1,2,3\}$ to $\{4,5,6\}$. For the image of $1$ you have $3$ choices. There are two choices left for the image of $2$, and one choice for the image of $3$. The conclusion comes from the product rule: there are $1\times 2\times 3 = 6$ injective functions.