Pairing of elements

87 Views Asked by At

Suppose I have two lists (not sure that's the right word), each with $N$ not necessarily distinct elements. In how many ways can I make distinct pairings of the two lists?

Example

I have the lists $(A, A, A, B, C)$ and $(A, D, D, E, E)$. A few of the distinct pairings I could form would be

$(AA, AD, AD, BE, CE)$

$(AA, AD, AE, BD, CE)$

$(AA, AD, AE, BE, CD)$

But how many pairings are there in total?

I have a feeling the answer is obvious, I'm just not seeing it at the moment.

Edit

After some more googling I found this page which suggests the solution isn't obvious at all.

Can anyone confirm the answer given there is correct?